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

remove apiName, apiContext, defineName, defineContext config options (breaking change) #176

Closed unscriptable closed 10 years ago

unscriptable commented 11 years ago

All of the following configuration options will be removed in curl 0.8: apiName, apiContext, defineName, defineContext.

The new way to alter curl's global API is as follows:

var define = curl('curl/define'); 
my.curl = curl;
my.define = define;
curl.restore(); // like $.noConflict(), this will revert to any previous globals

This is how to mimic requirejs:

var require = curl; curl.restore();

This code can only run after curl has been loaded. There will be no way to tell curl to redefine its public API using the global.curl object.

We can restore the old functionality in a shim. If you rely on this functionality and cannot (or prefer not to) use the new features, please say so now! We will create a shim.

unscriptable commented 11 years ago

cram.js will still need to be aware if the dev has decided to relocate define so we'll stil plan to add this feature to cram.js.