Skip to content

Commit

Permalink
Switch to Babel 7 (facebook#3522)
Browse files Browse the repository at this point in the history
* Update dependencies in react-scripts

* Add first pass of working dependencies for babel-preset-react-app and react-scripts

* Bump more dependency versions

* Adjust more versions and edit fix options

* Restore functionality of old preset

* Disable Uglify in iframe webpack

* Apply prettier

* Re-enable cache in dev and clean deps

* Lock packages and move babel/core to dep in preset

* Bump babel-jest

* Re-enable uglify

* Nest forceAllTransforms correctly in webpack config

* Install babel-core bridge for jest

* Add jest-cli and babel-core bridge to make tests in react-error-overlay pass

* Re-enable transform-dynamic-import

* Add dynamic import syntax support back

* Use new babel in kitchensink

* Transform modules in test

* Revert "Transform modules in test"

This reverts commit 539e46a.

* Attempt fix for ejected tests

* try this

* Add regenerator back

* Bump babel deps to beta.34

* Remove bad files

* Use default when requiring babel transform plugin

* Bump deps

* Try the fix?

* Oopsie

* Remove some weird things

* Run Babel on react-error-overlay tests

* Try fixing kitchensink

* Use new API for codeFrame

* Add missing (?) babelrc

* Maybe this helps?

* Maybe fix mocha

* I shouldn't have deleted this 🤦
  • Loading branch information
clemmy authored and Timer committed Jan 15, 2018
1 parent bada5bc commit 2087a17
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ module.exports = {
// Resolve Babel runtime relative to react-scripts.
// It usually still works on npm 3 without this but it would be
// unfortunate to rely on, as react-scripts could be symlinked,
// and thus babel-runtime might not be resolvable from the source.
'babel-runtime': path.dirname(
require.resolve('babel-runtime/package.json')
// and thus @babel/runtime might not be resolvable from the source.
'@babel/runtime': path.dirname(
require.resolve('@babel/runtime/package.json')
),
// @remove-on-eject-end
// Support React Native Web
Expand Down
6 changes: 3 additions & 3 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ module.exports = {
// Resolve Babel runtime relative to react-scripts.
// It usually still works on npm 3 without this but it would be
// unfortunate to rely on, as react-scripts could be symlinked,
// and thus babel-runtime might not be resolvable from the source.
'babel-runtime': path.dirname(
require.resolve('babel-runtime/package.json')
// and thus @babel/runtime might not be resolvable from the source.
'@babel/runtime': path.dirname(
require.resolve('@babel/runtime/package.json')
),
// @remove-on-eject-end
// Support React Native Web
Expand Down
4 changes: 0 additions & 4 deletions fixtures/kitchensink/.babelrc

This file was deleted.

6 changes: 3 additions & 3 deletions fixtures/kitchensink/.template.dependencies.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dependencies": {
"babel-register": "6.22.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.22.0",
"babel-polyfill": "6.20.0",
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.36",
"@babel/polyfill": "7.0.0-beta.36",
"@babel/register": "7.0.0-beta.36",
"chai": "3.5.0",
"jsdom": "9.8.3",
"mocha": "3.2.0",
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
"react-scripts": "./bin/react-scripts.js"
},
"dependencies": {
"@babel/core": "7.0.0-beta.36",
"@babel/runtime": "7.0.0-beta.36",
"autoprefixer": "7.1.6",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.0.2",
"babel-jest": "22.0.6",
"babel-loader": "7.1.2",
"babel-loader": "8.0.0-beta.0",
"babel-preset-react-app": "^3.1.1",
"babel-runtime": "6.26.0",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "1.1.3",
"css-loader": "0.28.7",
Expand Down

0 comments on commit 2087a17

Please sign in to comment.