-
Notifications
You must be signed in to change notification settings - Fork 48.3k
React in RequireJS ? #28
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
Comments
We run React+RequireJS on Instagram. Check out the repo and run Does that answer your question? |
What @petehunt said should work, though it exposes more than you need and might lead to information overload (just look at React.js if you do this! this is what gets exposed by the shipping file). I was hoping the UMD wrapper we have around react.js would just work if you decided to |
Thanks guys. A single 'React' would be sweet imho. On Thu, May 30, 2013 at 4:58 PM, Paul O’Shannessy
|
I think the issue is probably that the shipped Unless the file is loaded asynchronously (or merged together with other files using the For example, jQuery does this to define itself as an AMD module:
|
Lets reopen this then until we ship something that works with require. We're using browserify with the standalone option (which wraps with UMD) to build a mostly compatible module. I'd like to keep the process as simple as possible so we might want to try to fix this in one of those tools. |
@zpao you mean we should modify browserify so that it generates something that works as an AMD module? RequireJS does have the ability to load modules on demand, which is a different sort of philosophy from the monolithic package that browserify produces. Both approaches can be worthwhile, and it should be easy to support both. We've just implicitly preferred the monolithic package approach so far. |
Yea. If what @jriecken said is right, then we can maybe get UMD changed (https://github.com/ForbesLindesay/umd/blob/master/template.js#L12 is what gets used by browserify and it very much does not provide a name to Again, I'm not super familiar with RequireJS so maybe we need more. react.js is already React with all the dependencies so I don't think we need to ship a bundle of modules and can stick with the single file so long as it actually works |
i pack the react.js jquery.js redux.js and so on as vender-bundle.js. but the react.js is a anonymous module in AMD define. |
Learning the library. Any tips on getting it to play nice with RequreJS ?
Looks like it needs a shim but I can't figure out what exactly.
thanks!
The text was updated successfully, but these errors were encountered: