Highcharts as a CommonJS Asynchronous Module
Hello,
Please add the following code in Highcharts:
// Expose Highcharts as a CommonJS Asynchronous Module
if ( typeof require !== "undefined" && require.def ) {
require.def( [], function () { return Highcharts; } );
}
This code would register Highcharts as an CommonJS asynchronous module.
It would make Highcharts easier to use when working with RequireJS (and other loaders).
I pasted more links for modules and loaders are discussed.
http://dev.jquery.com/ticket/7102 (<--- this will expose jQuery as a module)
http://github.com/jrburke/jquery/commit/93dc7a7e3c383ff8a6507342af7e14821bef8d9b
http://groups.google.com/group/requirejs/browse_thread/thread/65eddc9f35c9e4cf
http://tagneto.blogspot.com/2010/09/anonymous-module-support-in-requirejs.html
Thank you.
Les

-
Noah commented
+1 for AMD support.
-
Wachunga Asdf commented
It would also be desirable for Highcharts to register itself as an AMD module. See here for a workaround: http://stackoverflow.com/questions/8186027/loading-highcharts-with-require-js
-
Les commented
This feature was added in jQuery 1.7 and it would be very simple to add it to HC.
http://code.jquery.com/jquery-1.7.js
Search for "Expose jQuery as an AMD module"