Module naming and declarations

Sam Tobin-Hochstadt samth at ccs.neu.edu
Wed May 8 13:06:41 PDT 2013


On Wed, May 8, 2013 at 3:59 PM, Domenic Denicola
<domenic at domenicdenicola.com> wrote:
>
> From: James Burke [jrburke at gmail.com]
>
> > On Wed, May 8, 2013 at 11:35 AM, Domenic Denicola <domenic at domenicdenicola.com> wrote:
> >> This is the core of my problem with AMD, at least as I have used it in the real world with RequireJS. You have no idea what `require("string")` means---is `"string"` a package or a URL relative to the base URL? It can be either in RequireJS, and it sounds like that would be the idea here. Super-confusing!
>
> > What part is confusing? Logical IDs are found at baseURL + ID + '.js', and if it is not there, then look at the require.config call to find where it came from.
>
> This dual behavior is exactly what is confusing.

This dual behavior is there in lots of systems.  For example, Java
looks first locally, then in the CLASSPATH, and all of that is
mediated by the class loader.

Sam


More information about the es-discuss mailing list