Skip to content

Commit

Permalink
Upgrading to babel 7 - Take II (#5151)
Browse files Browse the repository at this point in the history
* Bumping package versions to Babel 7 and required dependency versions.

* Adapting preset/plugin names.

* Using correct import scope for Spinner in OutputList.

* Fixing Jest for Babel 7 in Plugins.

Due to a change in Babel 7 that affects resolution of babel configs[1]
(`.babelrc` is now a hierarchical config, while `babel.config.js` is
not), source files outside of the source root of jest will not be
transpiled. That means, plugins running tests were not able to
require/import source files of core.

With this change, `.babelrc` will be renamed to `babel.config.js`, so it
is still used when a plugin imports a file from core.

[1]: jestjs/jest#6053 (comment)

* Generating cjs modules to enable default-less requires of modules.

* Updating yarn.lock.
  • Loading branch information
dennisoelkers authored and kmerz committed Sep 25, 2018
1 parent 6fb381e commit fce7366
Show file tree
Hide file tree
Showing 9 changed files with 1,079 additions and 5,935 deletions.
10 changes: 0 additions & 10 deletions graylog2-web-interface/.babelrc

This file was deleted.

13 changes: 13 additions & 0 deletions graylog2-web-interface/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
presets: [['@babel/env', { modules: 'cjs' }], '@babel/react', '@babel/flow'],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'add-module-exports',
],
env: {
test: {
plugins: ['babel-plugin-dynamic-import-node'],
},
},
};
20 changes: 11 additions & 9 deletions graylog2-web-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
}
},
"dependencies": {
"babel-preset-env": "^1.6.1",
"bluebird": "^3.4.0",
"bootstrap": "^3.3.7",
"c3": "^0.4.11-rc4",
Expand Down Expand Up @@ -92,22 +91,25 @@
"urijs": "^1.17.0"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@types/bluebird": "^3.5.8",
"@types/jquery": "^2.0.0",
"@types/node": "^8.0.17",
"@types/sockjs-client": "^1.0.31",
"@types/toastr": "^2.1.34",
"@types/typeahead": "^0.11.29",
"assets-webpack-plugin": "^3.5.1",
"babel-core": "^6.22.1",
"babel-jest": "^22.4.1",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-core": "^7.0.0-0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.2",
"babel-plugin-add-module-exports": "^1.0.0",
"babel-plugin-dynamic-import-node": "^2.1.0",
"babel-polyfill": "^6.22.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.22.0",
"babel-preset-stage-0": "^6.22.0",
"clean-webpack-plugin": "^0.1.19",
"compression": "^1.7.2",
"connect-history-api-fallback": "^1.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["env", "stage-0"],
"presets": ["@babel/env"],
"plugins": ["add-module-exports"]
}
11 changes: 5 additions & 6 deletions graylog2-web-interface/packages/graylog-web-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"README.md"
],
"dependencies": {
"babel-eslint": "^8.2.3",
"babel-preset-env": "^1.6.1",
"@babel/preset-env": "^7.1.0",
"babel-eslint": "^9.0.0",
"eslint": "^4.3.0",
"eslint-config-graylog": "file:../eslint-config-graylog",
"html-webpack-plugin": "^3.2.0",
Expand All @@ -46,7 +46,6 @@
"prop-types": "^15.5.10",
"react": "^16.5.1",
"react-addons-pure-render-mixin": "^15.6.0",
"react-addons-test-utils": "^15.6.0",
"react-bootstrap": "^0.31.0",
"react-dom": "^16.5.1",
"react-router": "^3.2.0",
Expand All @@ -58,8 +57,8 @@
"webpack-merge": "^4.1.4"
},
"devDependencies": {
"babel-cli": "^6.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-stage-0": "^6.0.0"
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"babel-plugin-add-module-exports": "^0.2.1"
}
}
Loading

0 comments on commit fce7366

Please sign in to comment.