Skip to content

Commit 646aefc

Browse files
[core] Upgrade Babel 6 to Babel 7
1 parent 1b90855 commit 646aefc

File tree

5 files changed

+902
-320
lines changed

5 files changed

+902
-320
lines changed

.babelrc

+29-35
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"presets": ["./scripts/material-ui-babel-preset", "stage-1", "react"],
3-
"plugins": [
4-
"transform-object-assign"
5-
],
2+
"presets": ["./scripts/material-ui-babel-preset", "@babel/preset-stage-1", "@babel/preset-react"],
3+
"plugins": ["@babel/plugin-transform-object-assign"],
64
"env": {
75
"coverage": {
86
"plugins": [
@@ -16,19 +14,15 @@
1614
"@material-ui/icons": "./packages/material-ui-icons/src"
1715
}
1816
}
19-
],
17+
]
2018
]
2119
},
2220
"development": {
2321
"sourceMaps": "both",
24-
"plugins": [
25-
"transform-flow-strip-types"
26-
]
22+
"plugins": ["@babel/plugin-transform-flow-strip-types"]
2723
},
2824
"docs-development": {
29-
"presets": [
30-
"next/babel"
31-
],
25+
"presets": ["next/babel"],
3226
"plugins": [
3327
"preval",
3428
[
@@ -44,13 +38,11 @@
4438
}
4539
}
4640
],
47-
"transform-flow-strip-types"
41+
"@babel/plugin-transform-flow-strip-types"
4842
]
4943
},
5044
"docs-production": {
51-
"presets": [
52-
"next/babel"
53-
],
45+
"presets": ["next/babel"],
5446
"plugins": [
5547
"preval",
5648
[
@@ -69,42 +61,44 @@
6961
"transform-react-constant-elements",
7062
"transform-dev-warning",
7163
"transform-runtime",
72-
["react-remove-properties", {"properties": ["data-mui-test"]}],
73-
["transform-react-remove-prop-types", {"mode": "remove"}]
64+
["react-remove-properties", { "properties": ["data-mui-test"] }],
65+
["transform-react-remove-prop-types", { "mode": "remove" }]
7466
]
7567
},
7668
"es": {
7769
"plugins": [
7870
"transform-react-constant-elements",
7971
"transform-dev-warning",
8072
"transform-runtime",
81-
["react-remove-properties", {"properties": ["data-mui-test"]}],
82-
["transform-react-remove-prop-types", {
83-
"mode": "wrap",
84-
"plugins": [
85-
"babel-plugin-transform-flow-strip-types"
86-
]
87-
}]
73+
["react-remove-properties", { "properties": ["data-mui-test"] }],
74+
[
75+
"transform-react-remove-prop-types",
76+
{
77+
"mode": "wrap",
78+
"plugins": ["babel-plugin-@babel/plugin-transform-flow-strip-types"]
79+
}
80+
]
8881
]
89-
},
82+
},
9083
"production": {
9184
"plugins": [
9285
"transform-react-constant-elements",
9386
"transform-dev-warning",
9487
"transform-runtime",
95-
["react-remove-properties", {"properties": ["data-mui-test"]}],
96-
["transform-react-remove-prop-types", {
97-
"mode": "wrap",
98-
"plugins": [
99-
"babel-plugin-transform-flow-strip-types"
100-
]
101-
}]
88+
["react-remove-properties", { "properties": ["data-mui-test"] }],
89+
[
90+
"transform-react-remove-prop-types",
91+
{
92+
"mode": "wrap",
93+
"plugins": ["babel-plugin-@babel/plugin-transform-flow-strip-types"]
94+
}
95+
]
10296
]
103-
},
97+
},
10498
"test": {
10599
"sourceMaps": "both",
106100
"plugins": [
107-
"transform-flow-strip-types",
101+
"@babel/plugin-transform-flow-strip-types",
108102
[
109103
"module-resolver",
110104
{
@@ -114,7 +108,7 @@
114108
"@material-ui/icons": "./packages/material-ui-icons/src"
115109
}
116110
}
117-
],
111+
]
118112
]
119113
}
120114
}

package.json

+12-14
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"react-dom": "^15.3.0 || ^16.0.0"
6868
},
6969
"dependencies": {
70+
"@babel/runtime": "7.0.0-beta.42",
7071
"@types/jss": "^9.3.0",
7172
"@types/react-transition-group": "^2.0.6",
72-
"babel-runtime": "^6.26.0",
7373
"brcast": "^3.0.1",
7474
"classnames": "^2.2.5",
7575
"deepmerge": "^2.0.1",
@@ -97,30 +97,28 @@
9797
"warning": "^3.0.0"
9898
},
9999
"devDependencies": {
100+
"@babel/core": "7.0.0-beta.42",
101+
"@babel/plugin-transform-object-assign": "7.0.0-beta.42",
102+
"@babel/plugin-transform-runtime": "7.0.0-beta.42",
103+
"@babel/preset-env": "7.0.0-beta.42",
104+
"@babel/preset-flow": "7.0.0-beta.42",
105+
"@babel/preset-react": "7.0.0-beta.42",
106+
"@babel/preset-stage-1": "7.0.0-beta.42",
107+
"@babel/register": "^7.0.0-beta.42",
100108
"@types/enzyme": "^3.1.4",
101109
"@types/react": "16.3.4",
102110
"argos-cli": "^0.0.9",
103111
"autoprefixer": "^8.0.0",
104112
"autosuggest-highlight": "^3.1.1",
105-
"babel-cli": "^6.26.0",
106-
"babel-core": "^6.26.0",
107-
"babel-eslint": "^8.0.2",
108-
"babel-loader": "^7.1.2",
113+
"babel-eslint": "^8.2.2",
114+
"babel-loader": "8.0.0-beta.2",
109115
"babel-plugin-istanbul": "^4.1.5",
110116
"babel-plugin-module-resolver": "^3.0.0",
111117
"babel-plugin-preval": "^1.6.2",
112118
"babel-plugin-react-remove-properties": "^0.2.5",
113119
"babel-plugin-transform-dev-warning": "^0.1.0",
114-
"babel-plugin-transform-flow-strip-types": "^6.22.0",
115-
"babel-plugin-transform-object-assign": "^6.22.0",
116120
"babel-plugin-transform-react-constant-elements": "^6.23.0",
117121
"babel-plugin-transform-react-remove-prop-types": "^0.4.10",
118-
"babel-plugin-transform-runtime": "^6.23.0",
119-
"babel-polyfill": "^6.26.0",
120-
"babel-preset-env": "^1.6.1",
121-
"babel-preset-react": "^6.24.1",
122-
"babel-preset-stage-1": "^6.24.1",
123-
"babel-register": "^6.26.0",
124122
"chai": "^4.1.2",
125123
"clipboard-copy": "^2.0.0",
126124
"cross-env": "^5.1.1",
@@ -163,7 +161,7 @@
163161
"lerna": "^2.9.0",
164162
"lz-string": "^1.4.4",
165163
"mocha": "^5.0.0",
166-
"next": "^5.0.1-canary.7",
164+
"next": "^6.0.0-canary.3",
167165
"nyc": "^11.3.0",
168166
"postcss": "^6.0.16",
169167
"prettier": "^1.8.2",

scripts/material-ui-babel-preset.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (ENV === 'es') {
1010
config = {
1111
presets: [
1212
[
13-
'babel-preset-env',
13+
'@babel/preset-env',
1414
{
1515
targets: {
1616
ie: 11,
@@ -27,4 +27,4 @@ if (ENV === 'es') {
2727
};
2828
}
2929

30-
module.exports = config;
30+
module.exports = () => config;

test/mocha.opts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
--require babel-register
1+
--require @babel/register
22
--reporter dot
33
--recursive
44
test/utils/setup.js

0 commit comments

Comments
 (0)