Skip to content

Commit ef0e1b4

Browse files
[core] Upgrade Babel 6 to Babel 7
1 parent f7af62f commit ef0e1b4

File tree

5 files changed

+1966
-788
lines changed

5 files changed

+1966
-788
lines changed

.babelrc

+33-38
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
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": [
97
"istanbul",
8+
"@babel/plugin-transform-flow-strip-types",
109
[
1110
"module-resolver",
1211
{
@@ -16,19 +15,15 @@
1615
"material-ui": "./packages/material-ui/src"
1716
}
1817
}
19-
],
18+
]
2019
]
2120
},
2221
"development": {
2322
"sourceMaps": "both",
24-
"plugins": [
25-
"transform-flow-strip-types"
26-
]
23+
"plugins": ["@babel/plugin-transform-flow-strip-types"]
2724
},
2825
"docs-development": {
29-
"presets": [
30-
"next/babel"
31-
],
26+
"presets": ["next/babel"],
3227
"plugins": [
3328
"preval",
3429
[
@@ -44,13 +39,11 @@
4439
}
4540
}
4641
],
47-
"transform-flow-strip-types"
42+
"@babel/plugin-transform-flow-strip-types"
4843
]
4944
},
5045
"docs-production": {
51-
"presets": [
52-
"next/babel"
53-
],
46+
"presets": ["next/babel"],
5447
"plugins": [
5548
"preval",
5649
[
@@ -68,43 +61,45 @@
6861
],
6962
"transform-react-constant-elements",
7063
"transform-dev-warning",
71-
"transform-runtime",
72-
["react-remove-properties", {"properties": ["data-mui-test"]}],
73-
["transform-react-remove-prop-types", {"mode": "remove"}]
64+
"@babel/transform-runtime",
65+
["react-remove-properties", { "properties": ["data-mui-test"] }],
66+
["transform-react-remove-prop-types", { "mode": "remove" }]
7467
]
7568
},
7669
"es": {
7770
"plugins": [
7871
"transform-react-constant-elements",
7972
"transform-dev-warning",
80-
"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+
"@babel/transform-runtime",
74+
["react-remove-properties", { "properties": ["data-mui-test"] }],
75+
[
76+
"transform-react-remove-prop-types",
77+
{
78+
"mode": "wrap",
79+
"plugins": ["@babel/plugin-transform-flow-strip-types"]
80+
}
81+
]
8882
]
89-
},
83+
},
9084
"production": {
9185
"plugins": [
9286
"transform-react-constant-elements",
9387
"transform-dev-warning",
94-
"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+
"@babel/transform-runtime",
89+
["react-remove-properties", { "properties": ["data-mui-test"] }],
90+
[
91+
"transform-react-remove-prop-types",
92+
{
93+
"mode": "wrap",
94+
"plugins": ["@babel/plugin-transform-flow-strip-types"]
95+
}
96+
]
10297
]
103-
},
98+
},
10499
"test": {
105100
"sourceMaps": "both",
106101
"plugins": [
107-
"transform-flow-strip-types",
102+
"@babel/plugin-transform-flow-strip-types",
108103
[
109104
"module-resolver",
110105
{
@@ -114,7 +109,7 @@
114109
"material-ui": "./packages/material-ui/src"
115110
}
116111
}
117-
],
112+
]
118113
]
119114
}
120115
}

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,30 @@
5656
},
5757
"dependencies": {},
5858
"devDependencies": {
59+
"@babel/cli": "^7.0.0-beta.46",
60+
"@babel/core": "7.0.0-beta.46",
61+
"@babel/node": "^7.0.0-beta.46",
62+
"@babel/plugin-transform-object-assign": "7.0.0-beta.46",
63+
"@babel/plugin-transform-runtime": "7.0.0-beta.46",
64+
"@babel/preset-env": "7.0.0-beta.46",
65+
"@babel/preset-flow": "7.0.0-beta.46",
66+
"@babel/preset-react": "7.0.0-beta.46",
67+
"@babel/preset-stage-1": "7.0.0-beta.46",
68+
"@babel/register": "^7.0.0-beta.46",
5969
"@types/enzyme": "^3.1.4",
6070
"@types/react": "^16.3.12",
6171
"argos-cli": "^0.0.9",
6272
"autoprefixer": "^8.0.0",
6373
"autosuggest-highlight": "^3.1.1",
64-
"babel-cli": "^6.26.0",
65-
"babel-core": "^6.26.0",
66-
"babel-eslint": "^8.0.2",
67-
"babel-loader": "^7.1.2",
74+
"babel-eslint": "^8.2.2",
75+
"babel-loader": "8.0.0-beta.2",
6876
"babel-plugin-istanbul": "^4.1.5",
6977
"babel-plugin-module-resolver": "^3.0.0",
7078
"babel-plugin-preval": "^1.6.2",
7179
"babel-plugin-react-remove-properties": "^0.2.5",
7280
"babel-plugin-transform-dev-warning": "^0.1.0",
73-
"babel-plugin-transform-flow-strip-types": "^6.22.0",
74-
"babel-plugin-transform-object-assign": "^6.22.0",
7581
"babel-plugin-transform-react-constant-elements": "^6.23.0",
7682
"babel-plugin-transform-react-remove-prop-types": "^0.4.10",
77-
"babel-plugin-transform-runtime": "^6.23.0",
78-
"babel-polyfill": "^6.26.0",
79-
"babel-preset-env": "^1.6.1",
80-
"babel-preset-react": "^6.24.1",
81-
"babel-preset-stage-1": "^6.24.1",
82-
"babel-register": "^6.26.0",
8383
"chai": "^4.1.2",
8484
"clipboard-copy": "^2.0.0",
8585
"cross-env": "^5.1.1",
@@ -121,7 +121,7 @@
121121
"lerna": "^2.9.0",
122122
"lz-string": "^1.4.4",
123123
"mocha": "^5.0.0",
124-
"next": "^5.0.1-canary.7",
124+
"next": "^6.0.0-canary.3",
125125
"nyc": "^11.3.0",
126126
"postcss": "^6.0.16",
127127
"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)