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

[REQ] Babel update #206

Closed
NullDivision opened this issue Dec 2, 2015 · 17 comments
Closed

[REQ] Babel update #206

NullDivision opened this issue Dec 2, 2015 · 17 comments

Comments

@NullDivision
Copy link

Would it be possible to update Babel to version 6? Version 5 interferes with newly created projects.

@duro
Copy link

duro commented Dec 4, 2015

I'm running into this as well in a react-native 0.16 project which uses Babel 6 under the hood. Looks like the .babelrc in react-redux throws an unknown option error.

@atticoos
Copy link

atticoos commented Dec 5, 2015

I'm unable to build with the changes made to stage in 6, I believe

{
  "message": "TransformError: /Users/ajwhite/Development/OneMightyRoar/Robin/robin-rooms-react-0.16/node_modules/react-redux/native.js: [BABEL] /Users/ajwhite/Development/OneMightyRoar/Robin/robin-rooms-react-0.16/node_modules/react-redux/native.js: Unknown option: /Users/ajwhite/Development/OneMightyRoar/Robin/robin-rooms-react-0.16/node_modules/react-redux/.babelrc.stage",
  "type": "TransformError",
  "errors": [{}]
}

@NullDivision
Copy link
Author

As a workaround for the unknown option issue was to install babel-core with the presets in my project and babel-cli globally. As long as there's no babel executable in the ./node_modules/.bin/ directory it installs its own.

@atticoos
Copy link

atticoos commented Dec 5, 2015

Interesting, @NullDivision -- so you basically kill the local installations and rely on the global? In theory, it sounds like this might also let you compile react-native@0.16 with a different version of Babel? I'm currently using the @connect decorators that are no longer supported in Babel 6 (and also not resolved with the current workaround in babel-plugin-transform-decorators-legacy)

@NullDivision
Copy link
Author

I'm not sure about the @connect decorators but all my dependencies work just fine with the global installation of babel-cli. For reference I'm using Webpack as my main builder and everything works as it should.

I need babel-core/register for runtime transpiling on Karma and Gulp but everything else uses the global binary.

@eadz
Copy link

eadz commented Dec 7, 2015

Just an idea for another workaround - would using a precompiled version of react-redux would work? I see there is a precompiled version on the CDN, but this is not for the native version.

@NullDivision
Copy link
Author

It's always a posibility but then what's the use of NPM and versioning? It also won't allow you to import it using ES6 unless you download the js file.

@NullDivision
Copy link
Author

Not without a terminal dump.

@martincik
Copy link
Contributor

All the tests are passing now. The PR is ready for review.

@gpbl
Copy link

gpbl commented Dec 10, 2015

I'm waiting for the PR to get merged so I can upgrade to 0.16 – I wonder is the PR intended for react-redux@3.1 right? AFAIK we can't use react-redux@4 with the current react-native version

@boldkhuu
Copy link

When will this PR be merged?

@gaearon
Copy link
Contributor

gaearon commented Dec 14, 2015

Hey folks!

I'm a bit confused why everyone is waiting for us updating to Babel 6. The library is compiled to ES5 :-). You shouldn't care what it uses internally.

The real fix was to stop shipping .babelrc. We fixed that in 3.1.2 and 4.0.1.

@gaearon gaearon closed this as completed Dec 14, 2015
@martincik
Copy link
Contributor

The reason is that it breaks react-native apps builds. Can we also remove .babelrc from redux itself? It's also breaking for me on babel dependency.

Here's where it's failing for react-native apps (0.16):

uncaught error Error: ReferenceError: [BABEL] /Users/PROJECT/node_modules/redux/lib/index.js: Unknown option: /Users/PROJECT/node_modules/redux/.babelrc.stage

@NullDivision
Copy link
Author

I don't know if it would work but could someone try moving the babelrc content into the package.json under "babel"? I think that might solve the issue.

@gaearon
Copy link
Contributor

gaearon commented Dec 14, 2015

The reason is that it breaks react-native apps builds.

The Babel version we use internally doesn't matter. What mattered is that we shouldn't have shipped .babelrc in the package at all. We fixed this already.

And it is also already removed from Redux. Please update to the latest version.

@NullDivision As far as I know there is no issue to solve. What do you mean? It's already solved in the latest update to both packages.

@NullDivision
Copy link
Author

I still see .babelrc on master.

@gaearon
Copy link
Contributor

gaearon commented Dec 14, 2015

We don't need to remove it from the source. (We still need Babel right :-). We removed it from NPM distribution by using "files" whitelist in package.json.

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

8 participants