-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Bundle with rollup: es6 imports, cycles in JS source, ReactNative getters #15233
Comments
Closing this as it doesn't seem to report a particular issue with React Native itself. If you disagree, can you take a look at the issue template and edit your post to fit the guidelines? |
Pff, it's not a particular issue -- but how else is someone supposed to have a discussion about the architecture/engineering decisions taken by the react-native team that now affect thousands of developers not particularly tied to the internal fb system? Properly supporting rollup, webpack and possibly other bundlers would - not only in my opinion - be a meaningful step into making react-native more available to anyone. I'd like to help - and in fact have figured out most of the internals of the not-so-stellarly-documented rn-packager (now called metro) myself. But I'm not ready to put in days of development without having an idea of where you folks are heading. This would seem like the proper forum where both react-native developers and the community can voice their ideas and/or help out. My most important specific/concrete question is about the cyclic dependencies. Is this a bug, or intented behavior? |
There's actually several places, and they are all listed in the contribution guide that is linked from the top of the template that is shown when you open a new issue. Here's the link: http://facebook.github.io/react-native/docs/contributing.html#how-to-get-in-touch For discussion-type issues, an exception can be made for skipping the template -- just make it very clear that you're looking to start a discussion. At some point we're going to switch to having all issues automatically close if the template is not followed, so I'm just trying to figure out a way of properly flagging when an issue is submitted for discussion. When I see phrases such as "is this a bug" and the issue skipped the whole template, my first assumption is that you did not read the template and are not intentionally proposing a change. I apologize if I made the wrong assumption. |
Ok so this ain't get solved, and is closed? |
I had a go at getting react-native bundled with https://github.com/rollup/rollup.
Config: https://gist.github.com/EmielM/0d59a0c4e711ace245ab736f208fc6be
I would like to output in
iife
form (eg just execute modules in order). That doesn't really work (that well) with cyclic requires, of which I encountered a few: https://pastebin.com/cWfGG1Am. Is the idea to - at some point - try to phase out these cyclic requires? There are some hints in the source suggesting these cycles are unintentional. Or should I come up with a different way to bundle?My
rollup
config currently transforms therequire()
calls back toimport/export
format. That doesn't really work that great with tree shaking and takes a lot of time. Is there somewhere on the roadmap to move toimport
/export
?Same for the whole haste
@providesModule
system, although the haste loader is only 20 lines or so.react-native-implementation.js
has this very weird way of defining its exports using getters. That obliterates any tree shaking possibilities. Is that a design choice? As I can tell, this results in the modules to only be evaluated when used -- and that would mean their side effects aren't really that important making them ideal candidates for pruning using tree shaking.Thanks!
The text was updated successfully, but these errors were encountered: