Alternatives to YepNope and LabJS [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am wanting to load javascript and css files via a resource loader. I was originally using LabJs but I found YepNope more elegant and easier to work with in my scenario. However I am finding it devastatingly slow, which is odd as apparently it is comparable to LabJs in speed on most things.
One thing I do have are Etags which I am sure will slow everything down as its still requesting from the server rather than just working off the client cache.
Anyway there isnt much outside of the main YepNope site, and they havent released a new version with the fixes on their issues list in a while, so I was wondering what other options there are out there...
My requirements are:
Needs to load Css and Javascript
Needs to do them all in parallel
Can be loaded via Javascript
I wish YepNope was a bit more active but wanted to weigh up the other options...

I would throw require.js up for consideration. It will dynamically add script and css tags to the <head> so it works nicely asynchronously. It will also optimize all your js into one file so if you project is like mine you'll have dozens of js files in development (I think we have about 100) but only 1 for production.
The only thing I haven't got working yet is the optimization of the css files though apparently it has been done.
Good luck

Related

save the size and speed of website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'll work in a project to improve the website. I recommended few best practices for the website like:
Eliminate render-blocking JavaScript and CSS in above-the-fold
content
Enable compression
Minify JavaScript
Prioritize visible content
Optimize images
Minify CSS
Minify HTML
All this changes are based in the https://developers.google.com/speed/pagespeed/insights/. But each time I checked the website I had a different score from the same site.
What I would like, is a place (software, add-on or website) to get a score of a live website and save this information to check again after the changes.
http://yslow.org
Does all of this in spades, can be installed as an extension in all major browsers. Source and command line versions are also available.
Use Pingdom Website Speed Test.
It tests everything from performance grade to load time, content types, etc. It's fantastic!
http://tools.pingdom.com/fpt/
Avoid missing images or files
Set the right expiration times for each file type
Minify + Join + Compress CSS & JS
Use CDN content delivery network on larger sites
Set JS file/s at the end whenever possible

Refactoring monsterous JavaScript-project [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I've found myself from the monstrous JavaScript-project. I haven't seen any references to known design patterns and code files consists of 5000+ rows of messy code. Usual length of the function is about 100 lines. Also namespaces are messy. Any ideas how to get any sense for this project?
I've been trying to read the source code, but there are no comments whatsoever. Also there are no tests, so making changes is a matter of luck.
Abandoning the project is not a choice.
Are there any nice tools for helping? At the moment I'm using sublime & Chrome.
If you have the specs you could write tests then refactor safely. Your tests will tell you if you break anything.
On the other hand if you don't have specs, you can write your tests by generating a bunch of random values and record the associated results. With your current code, you know (by definition) that they are correct.
I have seen the latter approach at a conference about refactoring ugly, legacy code. The speaker generated lots of random value/result pairs, turned them into unit tests, and started refactoring ultra-quickly. The results were quite amazing and you knew for sure that nothing had broken in the process.
Of course, if your application is more complex than the "give me an input, i'll tell you the output" style, this is trickier. But maybe it will get you started !

Learn the inner workings of web browsers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've just recently started looking into the details of which events fire when in what browsers when an html page is loaded, and at how to use JavaScript, especially jQuery, to leverage those events to make a page do exactly what I want, when I want.
It seems like knowledge of when and how browsers set off events and how to access them in JavaScript is a pretty big deal, but there isn't really one, good place to go and learn about it. There are thousands upon thousands of juicy tidbits which contain all the information, many of which are even grouped on certain sites (like this one), but you generally have to know what you're looking for, which prevents a lot of the "stumble upon" effect when learning about a topic.
So is there a good place to learn about all the intricacies of something like the order of events when a page is loaded, or what exactly browsers do during an AJAX call, or just about how browsers deal with an general JavaScript event?
Haven't had time to read it myself but looks quite promising:
How Browsers Work
The holy grail of Javascript (events): quirksmode.
You could try Sitepoint.com http://www.sitepoint.com/javascript-from-scratch/ They do some very good and easy to read books and online guides for every skill level.

How can I integrate CSS/JS/Image preprocessors with django.contrib.staticfiles? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
In Django 1.3, django.contrib.staticfiles provides a nice "blessed" solution to managing static files, like a site's CSS, Javascript, and images.
However, I don't see an obvious way to integrate arbitrary static file preprocessors (concat/minify CSS/JS, spritesheet autogen a la SmartSprite, etc.) with the staticfiles app.
Do any projects/snippets/solutions exist for this that will integrate well with django.contrib.staticfiles?
django-compressor have support for this, asking you to add 'compressor.finders.CompressorFinder' to the STATICFILES_FINDERS setting. I guess you can use or spy their code to see what they have done to achieve this.
django-compressor is definitely my preferred option because of how easy it is to just wrap blocks of css and js includes and have them compressed, however it does not do sprite sheets.
So you could either build in an additional processor to django-compressor using spritesticker or use django-media-bundler instead which does both but takes more effort to setup.

Is there a Javascript cron implementation somewhere that I'm missing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm aware of timing issues in Javascript, how its not exact/off by milliseconds etc, but I need something to at least attempt to do browser-based scheduling.
In terms of features, I'm thinking something along the lines of scheduling patterns described here: http://www.sauronsoftware.it/projects/cron4j/manual.php#p02
Anything out there? I've done google searches and haven't found any implementation worth nothing.
I thought I'd give it a quick go -- obviously this isn't production-code-worthy yet. Have a look.
Pimping my own code here, but I'm busy developing cron.js and its ready for general use.
As long as js engines live inside a browser, I don
t think there's much drive for such a feature. Now.. if one made a server js engine...
Take a look at scheduler.codeeffects.com. I don't know how it works but it has a js-based interface, so may be their scheduling engine is js-based, too. Just trying to help :)

Categories