React: Upgrade to Babel 7

Created on 5 Apr 2018  路  28Comments  路  Source: facebook/react

Babel 7 is still in beta, but presumably it will be released soon. We should get a head start on upgrading. Perhaps it's stable enough for us to upgrade even before the final release.

One benefit is we could use JSX fragment syntax in tests. Yay!

@reznord has volunteered to pick this up.

Build Infrastructure good first issue (taken)

Most helpful comment

Babel Jest definitely supports Babel 7, we're using them together in CRA

All 28 comments

babel-jest latest version still doesn't support babel v7. The tests might face an issue after I update

Probably should do a beta release with babel-7 support in babel-jest

Did you try the instructions here on how to use Jest with Babel 7?

https://facebook.github.io/jest/docs/en/getting-started.html#using-babel

Note: If you are using a babel version 7 then you need to install babel-jest with the following command:

yarn add --dev babel-jest 'babel-core@^7.0.0-0' @babel/core regenerator-runtime

Babel Jest definitely supports Babel 7, we're using them together in CRA

Not sure about 7.0.0-0, but there is a special version for such cases

yarn add babel-core@bridge --dev

bridge is a tag for 7.0.0-0, so it's the same

Hi @acdlite @gaearon sorry for the delay on the update for this PR. Wasn't doing well recently. I will start working on this PR now.

Once again, sorry for the delay

@reznord may I take this?

Is anyone working on this still ? If not I would give it a try. Thanks :)

I also want to help. @dantesolis can we both work on it together? If no one else is working on it.

@armujahid yes sure, we can work on this together. :)

@dantesolis I have started working on it. https://github.com/armujahid/react/tree/babel7 but its not complete yet.

@armujahid, wow you move fast! I will start working on it today or tomorrow, how should we tackle it so we don鈥檛 work on the same thing at the same time? Basically what have you not done so I can table it today? :)

@dantesolis I have added you as collaborator to my repository. You can see my changes in babel7 branch
I have done the following:

  1. Use babel-upgrade tool to upgrade package.jsons
  2. Manually update references of babel packages in code.
  3. Manually update references of babel packages in .babelrc file (because babel-upgrade doesn't support monorepo yet)

Issues:
Tests are still failing with different errors e.g. "Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation." although its already added in .babelrc file.
We need to resolve these issues so that at least tests won't fail

Let me check on that.

@armujahid I'll be working on this then today and tomorrow.

@acdlite I just finished work on it in my Babel 7 branch. It was huge challenge. I passed all tests, but I just don't sure if I can make PR for it.

@mmarkelov That鈥檚 great! Please open the PR!

@acdlite Just can't figure out what's wrong with last step - node ./scripts/tasks/danger

@mmarkelov is there any updates on this? I'd like to help if you want

@loryman I just got some tests fails - it was a big challenge. Of cause you can help. It will be nice. You can check my actual branch also I can add you as collaborator.

Thank you! I cloned your branch and i've started working on it. I can open a PR to your repo with all the changes

Hey guys! @loryman @mmarkelov still working on this one?

@loryman @mmarkelov are you successful in working on this problem?

Sorry, I haven't been able to work on this. Anyway, I think we have to wait for #15037 to get merged, then I'll try to continue from that

Would it be better to upgrade each package, one by one, to Babel 7 in separate PRs?

Hi, is there any small task, i would like to do

Thanks everyone for your work on this!

@mmarkelov @armujahid Added you two as coauthors to the PR.

Not all packages have been upgraded to babel 7 (for example, react-art), so should we reopen this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UnbearableBear picture UnbearableBear  路  3Comments

bloodyowl picture bloodyowl  路  3Comments

trusktr picture trusktr  路  3Comments

zpao picture zpao  路  3Comments

hnordt picture hnordt  路  3Comments