cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.89k stars 216 forks source link

Combo Loader #177

Closed ttfkam closed 11 years ago

ttfkam commented 11 years ago

Have you considered support for a combo loader like what YUI has? Instead of loading up files one by one, you use a concatenated URL like so:

http://combohost/combo?jquery/jquery-1.9-min.js&mymodule/mymodule-2.0-min.js

As long as the modules are versioned, the combo loader can cache effectively by URL. Even for unnamed modules, because curl would know the order of loading (since it constructed the URL in the first place), it could apply the names to each subsequent call to define(...).

Saves a step from r.js and makes development vs. production more seamless.

unscriptable commented 11 years ago

Hello @ttfkam,

Many people have built things like this over the past few years. Hardly anybody agrees on the best design, though. Should the version numbers be explicit or implicit? Should the server navigate the dependency graph or should the client send it on the url? What language should the server be written in?

It sounds like a fun thing to tackle. I say go for it, if you like. :)

At this point in time, I'm not sure it's something we want in cujo.js. But we keep thinking about it. Maybe now that the specs for ES6 modules are coalescing, some common patterns might emerge.

I'm going to close the issue, but keep commenting if you like!

Regards,

-- John