amdjs / amdjs-api

Houses the Asynchronous Module Definition API
https://groups.google.com/group/amd-implement
4.31k stars 499 forks source link

Definition of anonymous module behaviour requested #3

Closed huntc closed 12 years ago

huntc commented 12 years ago

I don't think that the definition of a module's "id" is very clear. It appears that it can be anything (good), but in the absence of a module having declared its id then anonymous ids appear to be derived from a module's path with no ".js" extension (you show an example of this).

Using paths for anonymous modules makes sense, but I wonder if we can have this clarified in the specification.

Thanks.

jrburke commented 12 years ago

Sorry for the delay in responding, we did not seem to get notifications of new issues in this project. Mentioning @unscriptable since he wanted to get notifications, hopefully that primes the pump.

In general, I think we need to expand the API with more illustrative text and examples. I'll keep this ticket open as a reminder to add some more info on module IDs.

unscriptable commented 12 years ago

+1 James. I got a lot of questions about module ids when I presented to the Boston jQuery group.

jrburke commented 12 years ago

I just updated the AMD wiki page with more information about the structure and format of module IDs. GIve a holler if you think anything else needs to be added. Going to close this for now, but we can reopen as necessary.

huntc commented 12 years ago

That's much better. Thanks.

huntc commented 12 years ago

I wonder if it'd be useful to plagiarise the CommonJS statement further:

Unspecified This specification leaves the following important points of interoperability unspecified:

jrburke commented 12 years ago

The PATH comment is definitely not applicable. In fact I would go so far as to say a PATH thing should explicitly not be supported since it will not work in the browser. But if we want to get that specific it is probably better to open up the discussion on the amd-implement list.

huntc commented 12 years ago

OK, but I thought the following statement was nice:

Whether modules are stored with a database, file system, or factory functions, or are interchangeable with link libraries