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

[React Native] Upgrading to Babel 6 and/or adding .babelrc to .npmignore #1033

Closed
ide opened this issue Nov 13, 2015 · 9 comments
Closed

[React Native] Upgrading to Babel 6 and/or adding .babelrc to .npmignore #1033

ide opened this issue Nov 13, 2015 · 9 comments

Comments

@ide
Copy link

ide commented Nov 13, 2015

React Native will be shipping with Babel 6 in about three weeks. One consequence of this is that Babel finds .babelrc in node_modules/redux and tries to consume it -- since Redux is using Babel 5's configuration, this causes Babel 6 to crash. The current verdict is that packages will have to exclude .babelrc when distributed through npm: facebook/react-native#4062.

@gaearon
Copy link
Contributor

gaearon commented Nov 13, 2015

Happy to accept a PR excluding it! (And maybe other useless files for good measure—except src, we want it there.)

@gaearon
Copy link
Contributor

gaearon commented Nov 13, 2015

Also, hey, thanks for the heads up.

@ide
Copy link
Author

ide commented Nov 13, 2015

OK - I wanted to make sure that excluding .babelrc was OK and you weren't shipping it next to src for some reason.

@gaearon
Copy link
Contributor

gaearon commented Nov 13, 2015

Wondering how/whether this affects JSPM.
@timbur?

@ide
Copy link
Author

ide commented Nov 13, 2015

I think you could make the argument that Babel shouldn't be processing .babelrc files under node_modules... imagine npm linked copies of Redux for example.

@gaearon
Copy link
Contributor

gaearon commented Nov 13, 2015

Usually people turn that off with Webpack/Browserify, but React Native Packager doesn't seem to offer/favor ignoring third-party modules?

@ide
Copy link
Author

ide commented Nov 13, 2015

RN is in a unique situation where the JS files under node_modules are ES7, so we want Babel to transform them. But we want Babel to use only the config options that are specified when calling babel.transform(...) plus the options in the root project's .babelrc file. So instead of --ignore node_modules we want (hypothetically) --ignore-babelrc node_modules.

@ghost
Copy link

ghost commented Nov 14, 2015

AFAIK JSPM doesn't care about .babelrc at all but IIRC @guybedford was considering it or had it planned? I don't remember exactly. I've personally always kinda avoided using a .babelrc and most other dotfiles unless necessary. Come to think of it I'll make a note to update my fork of library-boilerplate and remove .babelrc from it.

@gaearon
Copy link
Contributor

gaearon commented Dec 12, 2015

Should be fixed in 3.0.5.

ryankirkman added a commit to ryankirkman/proptypes-schema that referenced this issue Dec 12, 2016
Also add .babelrc to .npmignore so we don't have problems with
React-Native's packager.

Reference: reduxjs/redux#1033
ryankirkman added a commit to ryankirkman/proptypes-schema that referenced this issue Dec 12, 2016
Also add .babelrc to .npmignore so we don't have problems with
React-Native's packager.

Reference: reduxjs/redux#1033
ryankirkman added a commit to ryankirkman/proptypes-schema that referenced this issue Dec 12, 2016
Also add .babelrc to .npmignore so we don't have problems with
React-Native's packager.

Reference: reduxjs/redux#1033
goshacmd added a commit to goshacmd/cyclejs that referenced this issue Dec 14, 2016
It's not needed anyway. It's also causing issues when used with
React-Native packager, which processes node_modules with Babel
(reduxjs/redux#1033 (comment))
goshacmd added a commit to goshacmd/cyclejs that referenced this issue Dec 14, 2016
It's not needed anyway. It's also causing issues when used with

React-Native packager, which

processes node_modules with

Babel

(reduxjs/redux#1033 (comment))
goshacmd added a commit to goshacmd/cyclejs that referenced this issue Dec 14, 2016
It's not needed anyway. It's also causing issues when used with React-Native packager, which

processes node_modules with Babel

(reduxjs/redux#1033 (comment))
goshacmd added a commit to goshacmd/cyclejs that referenced this issue Dec 14, 2016
It's not needed anyway. It's also causing issues when used with React-Native packager, which

processes node_modules with Babel

(reduxjs/redux#1033 (comment))
staltz pushed a commit to cyclejs/cyclejs that referenced this issue Dec 20, 2016
It's not needed anyway. It's also causing issues when used with React-Native packager, which

processes node_modules with Babel

(reduxjs/redux#1033 (comment))
franciscopuyo pushed a commit to franciscopuyo/react-highlight-words that referenced this issue Sep 14, 2017
An alternative solution to bvaughn#19.  I'm guessing @untone is dealing with the same problem that I am - an inability to use react-highlight-words since it's .babelrc is for Babel 5 and we're using Babel 6.

See reduxjs/redux#1033 and reduxjs/redux-thunk#44 if more justification is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants