Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
5.4
Description
One of the last major hurdles is to support aggregation of AMD modules; this would imply that the modules become part of a JavaScriptStack.
There are definitely some challenges to this; primarily the need to rewrite the JavaScript slightly:
define(["dep1", "dep2", "dep3"], function(dep1, dep2, dep3)
{ ... });needs to be rewitten to:
define("my/module/name", ["dep1", "dep2", "dep3", function(dep1, dep2, dep3) { ... }
);
This can probably be accomplished using a regular expression.
RequireJS's r.js utility is powerful; part of its job is to automatically hunt down transitive dependencies from a root namespace. I don't know if we can effectively duplicate that; because of issues such as CoffeeScript vs. JavaScript (vs. other languages), the fact that certain modules are created at runtime, and other factors ... we may need to the user to supply a list of which modules should be included, and the others will be fetched on-demand.