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

Google Closure module support #17

Open
blq opened this issue Apr 17, 2013 · 4 comments
Open

Google Closure module support #17

blq opened this issue Apr 17, 2013 · 4 comments

Comments

@blq
Copy link

blq commented Apr 17, 2013

Support for the Google Closure module system is easy to add also.
Example: https://developers.google.com/closure/library/docs/tutorial

Just add this style at the top of the file:

if (typeof goog != 'undefined' && typeof goog.provide == 'function') {
    goog.provide('MyModule');

    goog.require('MyDependency1');
    goog.require('MyDependency2');
    // ...
}

The tool then used to build the full dependency tree is found here:
https://developers.google.com/closure/library/docs/depswriter

Regards
/ Fredrik Blomqvist

@addyosmani
Copy link
Member

@beriberikix you're a little more familiar with the closure module system than I am (I think) :) Could you let me know if you think this addition is worth adding to a UMD (universal module def pattern).

@beriberikix
Copy link

Only marginally. @cramforce did some work module server IIRC.

@cramforce
Copy link

@beriberikix Module server doesn't know anything about the closure module system actually and is really designed for CJS modules.
Anyway: The above would probably work. I have no idea whether it would be worth it.

@jrburke
Copy link
Member

jrburke commented Apr 22, 2013

I would generally favor a "needs multiple implementations" rule for UMD inclusion -- CJS, AMD, browser globals fit in this realm, but things like google closure, old Dojo and YUI would not. That said, I am not opposed to others working out different rules or different patterns. However, I will not have the time to maintain them or manage any pull requests for them.

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

5 participants