5

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...

Grofit
  • 17,693
  • 24
  • 96
  • 176
  • I also found last night that YepNope seemed to only be slow within firefox, it was actually as quick as the others when being used within chrome. Not sure if it is firebug causing the problems there... – Grofit Nov 02 '11 at 09:16

1 Answers1

6

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

Wolfram Arnold
  • 7,159
  • 5
  • 44
  • 64
timDunham
  • 3,318
  • 23
  • 24
  • I have looked into this before, and its main benefit seemed to be that it would output a condensed page with everything in. However as part of my requirements I have dynamically loaded javascript on the page, which acts as a plugin of sorts, but I do have LOTS of javascript files. I am thinking of turning them into groups and concating based on the groups. – Grofit Nov 02 '11 at 09:15