Recs.
Updated
Browser only, promise like and extremely lightweight module loader using XHR/XDR requests and localStorage caching to dynamically load JavaScript modules, JSON, HTML, CSS, text and Bundles (single script containing multiple concatenated modules) with automatic dependency resolution and support for custom handlers. Qoopido.demand, in addition, supports loading of legacy JavaScript libraries like jQuery. Works on Chrome, Firefox, Safari, Opera, IE9, IE10, IE11 and Edge.
Specs
Pros
Pro Additional support for loading HTML, CSS, JSON, and text
Loading is dealt with via handlers
that are themselves modules (dynamically loaded and cached). Qoopido.demand comes with support for its own module format built-in and offers handlers
for css
, json
and text
. Due to handlers
being modules themselves it is really easy to write custom handlers.
Pro Offers internal auto-bundling to reduce the number of requests
By taking advantage of auto-bundling, it means that demand itself will combine requests without the user having to manually define a bundle.
Pro Can load new modules without being recompiled
It's the one of the few modules in this category that can handle IOC-style dependency injection. The others work well for apps that have knowable dependency lists at compile time, but this is one of the few that can load new modules without being recompiled.
Pro Optional cookie support to communicate module caching state to the server
Cookie support within Qoopido.demand can be enabled globally or per module. Whenever the localStorage cache for a module changes an accompanying cookie gets updated/deleted so the server can handle the clients module caching state and, e.g., inline modules as long as the client das not have them in localStorage.
Pro Supports loading of non-module scripts
Qoopido.demand offers loading of legacy scripts as if they were modules through probe
functions. These probe
functions are similiar to Require.js shim
, but where shim
allows only string parameters, Qoopido.demand's probes
are JavaScript functions that can check whatever you want.
Cons
Recommendations
Comments
Flagged Pros + Cons
Con Needs CORS headers set
Since modules are loaded via XHR/XDR you need to have CORS headers set.