-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add to FAQ: What is the function of the files named *.amd.json? #46
Comments
Not good question. All other .amd.json files have exact same reason. They are all local.amd.jsons, just a bit misplaced. Hannes Hirzel wrote:
|
Ok, For example for the project snap.svg demo the local.amd.json file has
and it refers to the Amber-snapsvg-demo. Other How should I restate the question? |
Yes, that. What you did not mention are other possible local.amd.json files (in library directories, if they are .amd.json-aware). I don't know how to restate. Maybe it should actually be two questions, one for local.amd.json, one for dirname.amd.json, which is explained as "just the displaced local.amd.json for directory dirname". Hannes Hirzel wrote:
|
What about this proposal for an answer: (and comment as well on the slightly changed question) Answer
Each project or library is supposed to have such a file. But not all libraries have one. Instead of adding a |
"local.amd.json files refer to mappings of a project name to the source directory where the source files may be found" is very narrow thus not really true. What do you mean by "project name"? What is "source directory"? If you try to apply these to the second part on dirname,amd.json, it fails miserably. You often do not map a path, but you map directly a module. So "project name" (even if you rename it to "namespace") has no analogy. |
The thing is complicated by the fact that what you map is either planned to use as a path (namespace of amber project, for example), but sometimes it is used as a module itself (so it should refer to a file; in which case |
Not a hard thing once you read over the requirejs docs, but scary until that point. |
And of course, *.amd.json does not contain only paths sections, it may contain any other piece of requirejs config, form which "shim" and "map" have also its uses sometimes. |
So we might refer to http://requirejs.org/docs/api.html for the full answer and give a narrower answer which does not cover all cases but some frequent ones people encounter. This means a list of examples explained. Often it is easier to have a full list of explanations then a set of rules to understand an issue. For an implementor of course a spec has to be completly described with a set of rules. |
Whatever works, I just don't want it to be misguiding. As I probably don't know how to present it to the users, I hope someone out there will be able to communicate it better. |
useful graphic and illustration |
New attempt at an answer:
Read more: |
Not just |
For the answer add the link to the wiki entry here .....
The text was updated successfully, but these errors were encountered: