Skip to content

Compile react-native- node modules #1626

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

Closed

Conversation

RangerMauve
Copy link

Right now people using this with react-native-web are unable to use any pure JS react-native modules becuase they usually use ES6 and JSX.

React-native's build tool passes all their modules through babel to let module authors use "the latest and greatest" in JS syntax. This tool. however, doesn't compile modules due to performance costs that that would incur.

Many react-native components seem to have names that start with react-native-. I think that a good compromise would be to compile these modules, this enabling react-native-web projects to use this tool to get up and running instantly without needing to eject in order to use dependencies, while at the same time having no real effect on existing projects that don't make use of react-native-web

Currently react-native-web is missing the easy to use tooling that's provided with react-native. This change could bring react-native-web development to about the same level and enable people to build hybrid projects faster.

I've currently got this running with react-native-vector-icons and am planning on using many more as time progresses.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

@RangerMauve
Copy link
Author

Filled out the CLA

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@RangerMauve
Copy link
Author

Any reason this can't be merged in?

@gaearon
Copy link
Contributor

gaearon commented Apr 18, 2017

Hey, sorry this was neglected. Basically, I don‘t think we’ll go this way. I know this is how RN ecosystem works, but their decision to publish uncompiled modules is somewhat baffling to me, as this creates an implicit dependency on the Babel preset shipping with RN. For example, we can’t just enable our Babel preset for node_modules/react-native-* because it won’t match the RN preset exactly. I also know that even some of the people working on RN regret this decision, as it created many issues like this in the RN ecosystem. I’m sorry because I realize how frustrating it must be, but I don’t think this is the right way forward (and as I explained, it’s not correct anyway, as our preset differs from RN preset). 😞

@gaearon gaearon closed this Apr 18, 2017
@RangerMauve
Copy link
Author

Thanks for the explanation! Hopefully there will be a web/RN solution out there eventually. :P

@RangerMauve RangerMauve deleted the react-native-compile branch April 18, 2017 14:46
@gaearon
Copy link
Contributor

gaearon commented Apr 18, 2017

Yea.. 😭

@RangerMauve
Copy link
Author

Might be a bad place to post this, but what's stopping create-react-app from using the same babel preset as react-native?

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants