Skip to content
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

Do change the name of the global "require" #11

Closed
tlindig opened this issue May 13, 2013 · 2 comments
Closed

Do change the name of the global "require" #11

tlindig opened this issue May 13, 2013 · 2 comments

Comments

@tlindig
Copy link

tlindig commented May 13, 2013

From the API Wiki:

This specification reserves the global variable "require" for use by module loaders.
Module loaders are free to use this global variable as they see fit. They may use the
variable and add any properties or functions to it as desired for module loader
specific functionality. They can also choose not to use "require" as well.

And also in the Module Specification we have a function require. But this both functions with the same name, are very different.

So I would suggest, that you do not take the same name for two different function. That is confusing and provokes misunderstandings.

Maybe you could call the global "require" instead "use" or "load".

@jrburke
Copy link
Contributor

jrburke commented May 14, 2013

There have been threads about this on the amd-implement list:
https://groups.google.com/group/amd-implement

but there are no plans to change this. Feel free to start a thread there again, but with inertia and ECMAScript modules on the horizon, it is more likely that AMD modules will just morph to use ECMAScript-compatible APIs.

@jrburke jrburke closed this as completed May 14, 2013
@unscriptable
Copy link
Member

Hey @tlindig,

I agree that it is confusing for newcomers. Many AMD environments declare -- and sometimes force -- an alternative variable. RequireJS has a requirejs variable, curl.js has a curl variable (and no global require), etc.

Documentation seems to be the key to solving this problem, imho.

-- John

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants