Closed tlindig closed 11 years ago
Anonymous define calls are important to allow code to be moved around to different file names/directories and still work. There are no plans to force the id argument, as the anonymous modules have been very useful in practice.
Just adding more useful and relevant (imho) info for @tlindig: ES6 allows modules to be anonymous (no id). CommonJS only has anonymous modules.
Is there a cogent reason that parameter
id
is optional?I would prefer, that it would be required.
If so, the implementation of
define
could be run free of file specific context and would be easy and resource load could be done with better performance.If not,
define
have to get the defaultid
from the requested script filename and so it needs for every loaded module a own context.