Skip to content

Commit 18f646b

Browse files
authored
for #950, update babel to v7 (#1077)
* for #950, upgrade babel to v7 * fix linting errors * for #950, remove @babel/core from devDependencies (so it's only in dependencies) and change babel-loader config to use .babelrc * for #950, changes to .babelrc to make work * for #950, include core-js modules in webpack config for IE support with babel/plugin-syntax-dynamic-import * for #950, update babel and associated packages to LTS
1 parent 84e240e commit 18f646b

18 files changed

+3398
-3395
lines changed

.babelrc

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,83 @@
11
{
2-
"presets": ["react", "env", "stage-0"],
2+
"presets": [
3+
"@babel/preset-react",
4+
"@babel/preset-env"
5+
],
36
"env": {
47
"production": {
58
"plugins": [
69
"transform-react-remove-prop-types",
7-
"transform-react-constant-elements",
8-
"transform-react-inline-elements"
10+
"@babel/plugin-transform-react-constant-elements",
11+
"@babel/plugin-transform-react-inline-elements",
12+
"@babel/plugin-syntax-dynamic-import",
13+
"@babel/plugin-syntax-import-meta",
14+
[
15+
"@babel/plugin-proposal-decorators",
16+
{
17+
"legacy": true
18+
}
19+
],
20+
[
21+
"@babel/plugin-proposal-class-properties",
22+
{
23+
"loose": true
24+
}
25+
],
26+
"@babel/plugin-proposal-json-strings",
27+
"@babel/plugin-proposal-function-sent",
28+
"@babel/plugin-proposal-export-namespace-from",
29+
"@babel/plugin-proposal-numeric-separator",
30+
"@babel/plugin-proposal-throw-expressions",
31+
"@babel/plugin-proposal-export-default-from",
32+
"@babel/plugin-proposal-logical-assignment-operators",
33+
"@babel/plugin-proposal-optional-chaining",
34+
[
35+
"@babel/plugin-proposal-pipeline-operator",
36+
{
37+
"proposal": "minimal"
38+
}
39+
],
40+
"@babel/plugin-proposal-nullish-coalescing-operator",
41+
"@babel/plugin-proposal-do-expressions",
42+
"@babel/plugin-proposal-function-bind"
943
],
10-
"presets": ["env", "react", "react-optimize", "stage-0"]
44+
"presets": [
45+
"@babel/preset-env",
46+
"@babel/preset-react"
47+
]
1148
}
12-
}
13-
}
49+
},
50+
"plugins": [
51+
"@babel/plugin-syntax-dynamic-import",
52+
"@babel/plugin-syntax-import-meta",
53+
[
54+
"@babel/plugin-proposal-decorators",
55+
{
56+
"legacy": true
57+
}
58+
],
59+
[
60+
"@babel/plugin-proposal-class-properties",
61+
{
62+
"loose": true
63+
}
64+
],
65+
"@babel/plugin-proposal-json-strings",
66+
"@babel/plugin-proposal-function-sent",
67+
"@babel/plugin-proposal-export-namespace-from",
68+
"@babel/plugin-proposal-numeric-separator",
69+
"@babel/plugin-proposal-throw-expressions",
70+
"@babel/plugin-proposal-export-default-from",
71+
"@babel/plugin-proposal-logical-assignment-operators",
72+
"@babel/plugin-proposal-optional-chaining",
73+
[
74+
"@babel/plugin-proposal-pipeline-operator",
75+
{
76+
"proposal": "minimal"
77+
}
78+
],
79+
"@babel/plugin-proposal-nullish-coalescing-operator",
80+
"@babel/plugin-proposal-do-expressions",
81+
"@babel/plugin-proposal-function-bind"
82+
]
83+
}

client/modules/IDE/components/Editor.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ class Editor extends React.Component {
283283
}
284284
}
285285

286-
_cm: CodeMirror.Editor
287-
288286
render() {
289287
const editorSectionClass = classNames({
290288
'editor': true,

client/modules/IDE/components/ErrorModal.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class ErrorModal extends React.Component {
2626
staleProject() {
2727
return (
2828
<p>
29-
The project you have attempted to save has been saved from another window. Please refresh the page to see the latest version.
29+
The project you have attempted to save has been saved from another window.
30+
Please refresh the page to see the latest version.
3031
</p>
3132
);
3233
}

client/modules/IDE/components/SketchList.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class SketchList extends React.Component {
3636
}
3737

3838
renderEmptyTable() {
39-
if (!this.props.loading && this.props.sketches.length === 0) return (<p className="sketches-table__empty">No sketches.</p>);
39+
if (!this.props.loading && this.props.sketches.length === 0) {
40+
return (<p className="sketches-table__empty">No sketches.</p>);
41+
}
4042
return null;
4143
}
4244

client/modules/IDE/reducers/project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const project = (state, action) => {
5050
return Object.assign({}, state, { updatedAt: action.value });
5151
case ActionTypes.START_SAVING_PROJECT:
5252
return Object.assign({}, state, { isSaving: true });
53-
case ActionTypes.START_STOP_PROJECT:
53+
case ActionTypes.END_SAVING_PROJECT:
5454
return Object.assign({}, state, { isSaving: false });
5555
default:
5656
return state;

index.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@ if (process.env.NODE_ENV === 'production') {
44
require('./dist/server.bundle.js');
55
} else {
66
let parsed = require('dotenv').config();
7-
require('babel-register')({
8-
"plugins": [
9-
[
10-
"babel-plugin-webpack-loaders",
11-
{
12-
"config": "./webpack/config.babel.js",
13-
"verbose": false
14-
}
15-
]
16-
]
7+
require('@babel/register')({
8+
presets: ["@babel/preset-env"]
179
});
18-
require('babel-polyfill');
10+
require('@babel/polyfill');
1911
//// in development, let .env values override those in the environment already (i.e. in docker-compose.yml)
2012
// so commenting this out makes the docker container work.
2113
// if (process.env.NODE_ENV === 'development') {

0 commit comments

Comments
 (0)