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

.babelrc should be removed from npm #44

Closed
RanzQ opened this issue Feb 8, 2017 · 5 comments
Closed

.babelrc should be removed from npm #44

RanzQ opened this issue Feb 8, 2017 · 5 comments

Comments

@RanzQ
Copy link

RanzQ commented Feb 8, 2017

React Native packager doesn't find preset airbnb. Removing .babelrc fixes it.

reduxjs/redux-thunk#43

facebook/react-native#4062

Also applies to react-with-styles-interface-react-native.

@ljharb
Copy link
Collaborator

ljharb commented Feb 8, 2017

No, it absolutely should not be - npm explore foo && npm install && npm test should always work. The RNP has a flaw in that it transpiles node_modules, and the proper place for a workaround is a postinstall script in your top-level app that removes all .babelrc files from your node_modules.

@ljharb ljharb closed this as completed Feb 8, 2017
@RanzQ
Copy link
Author

RanzQ commented Feb 8, 2017

Ok, thanks for the tip. I thought .babelrc is unnecessary for a transpiled npm package. :)

@ljharb
Copy link
Collaborator

ljharb commented Feb 9, 2017

No worries - untranspiled npm packages shouldn't exist; it's a flaw in the RN ecosystem that it's encouraged and allowed.

@RanzQ
Copy link
Author

RanzQ commented Feb 9, 2017

I also had the impression that untranspiled code would perform better if it's natively supported but that's not true. So I get your point that all packages should be transpiled and there shouldn't be a need for RN packager to touch node_modules.

@ljharb
Copy link
Collaborator

ljharb commented Feb 9, 2017

Definitely not true - older syntax is almost always faster than newer syntax, because older syntax has had time to be optimized.

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

2 participants