Skip to content

Commit

Permalink
Upgrade all dependencies including Babel 7 (#1673)
Browse files Browse the repository at this point in the history
* Upgrade all dependencies including Babel 7

1. ncu --upgradeAll
4. Leave "graphql" to be "^13.2.0" that apollo packages depend on
2. Apply patch of "npx babel-upgrade" output
3. Leave only necessary babel plugins
4. Pass "yarn fix" by disabling stricter rules

fixes #1654 #1626 #1607

* Also ignore babel config file from webpack.config.js
  • Loading branch information
piglovesyou authored and langpavel committed Feb 19, 2019
1 parent 81c96d8 commit 8d6c018
Show file tree
Hide file tree
Showing 6 changed files with 1,868 additions and 1,926 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ module.exports = {
// ESLint plugin for prettier formatting
// https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': 'error',

'react/forbid-prop-types': 'off',
'react/destructuring-assignment': 'off',
},

settings: {
Expand Down
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ module.exports = {
},
},
],
['@babel/preset-stage-2', { decoratorsLegacy: true }],
'@babel/preset-flow',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
ignore: ['node_modules', 'build'],
};
137 changes: 69 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"not ie < 9"
],
"dependencies": {
"@babel/polyfill": "^7.0.0-beta.51",
"@babel/polyfill": "^7.0.0",
"body-parser": "^1.18.3",
"classnames": "^2.2.6",
"cookie-parser": "^1.4.3",
Expand All @@ -24,98 +24,99 @@
"history": "^4.7.2",
"isomorphic-style-loader": "^4.0.0",
"jsonwebtoken": "^8.3.0",
"node-fetch": "^2.1.2",
"node-fetch": "^2.2.0",
"normalize.css": "^8.0.0",
"passport": "^0.4.0",
"passport-facebook": "^2.1.1",
"pretty-error": "^2.1.1",
"prop-types": "^15.6.1",
"prop-types": "^15.6.2",
"query-string": "^6.1.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"sequelize": "^4.37.10",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"sequelize": "^4.38.1",
"serialize-javascript": "^1.5.0",
"source-map-support": "^0.5.6",
"sqlite3": "^4.0.0",
"source-map-support": "^0.5.9",
"sqlite3": "^4.0.2",
"universal-router": "^6.0.0",
"whatwg-fetch": "^2.0.4"
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.51",
"@babel/node": "^7.0.0-beta.51",
"@babel/plugin-transform-react-constant-elements": "^7.0.0-beta.51",
"@babel/plugin-transform-react-inline-elements": "^7.0.0-beta.51",
"@babel/preset-env": "^7.0.0-beta.51",
"@babel/preset-flow": "^7.0.0-beta.51",
"@babel/preset-react": "^7.0.0-beta.51",
"@babel/preset-stage-2": "^7.0.0-beta.51",
"autoprefixer": "^8.6.3",
"babel-core": "^7.0.0-0",
"babel-eslint": "^8.2.3",
"babel-jest": "^23.0.1",
"babel-loader": "^7.1.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"browser-sync": "^2.24.4",
"@babel/core": "^7.0.0",
"@babel/node": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-react-constant-elements": "^7.0.0",
"@babel/plugin-transform-react-inline-elements": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"autoprefixer": "^9.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.18",
"browser-sync": "^2.24.7",
"chokidar": "^2.0.4",
"css-loader": "^0.28.11",
"enzyme": "^3.3.0",
"eslint": "^4.19.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"css-loader": "^1.0.0",
"enzyme": "^3.6.0",
"eslint": "^5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.0.1",
"eslint-import-resolver-node": "^0.3.2",
"eslint-loader": "^2.0.0",
"eslint-plugin-css-modules": "^2.7.5",
"eslint-plugin-flowtype": "^2.49.3",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.9.1",
"file-loader": "^1.1.11",
"flow-bin": "^0.74.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-css-modules": "^2.9.1",
"eslint-plugin-flowtype": "^2.50.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-react": "^7.11.1",
"file-loader": "^2.0.0",
"flow-bin": "^0.81.0",
"front-matter": "^2.3.0",
"glob": "^7.1.2",
"husky": "^0.14.3",
"glob": "^7.1.3",
"husky": "^1.0.0-rc.15",
"identity-obj-proxy": "^3.0.0",
"jest": "^23.1.0",
"lint-staged": "^7.2.0",
"markdown-it": "^8.4.1",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
"markdown-it": "^8.4.2",
"mkdirp": "^0.5.1",
"null-loader": "^0.1.1",
"opn-cli": "^3.1.0",
"pixrem": "^4.0.1",
"pleeease-filters": "^4.0.0",
"postcss": "^6.0.22",
"postcss": "^7.0.2",
"postcss-calc": "^6.0.1",
"postcss-color-function": "^4.0.1",
"postcss-custom-media": "^6.0.0",
"postcss-custom-properties": "^7.0.0",
"postcss-custom-selectors": "^4.0.1",
"postcss-flexbugs-fixes": "^3.3.1",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.1.5",
"postcss-media-minmax": "^3.0.0",
"postcss-nested": "^3.0.0",
"postcss-nesting": "^6.0.0",
"postcss-custom-media": "^7.0.3",
"postcss-custom-properties": "^8.0.5",
"postcss-custom-selectors": "^5.1.2",
"postcss-flexbugs-fixes": "^4.1.0",
"postcss-import": "^12.0.0",
"postcss-loader": "^3.0.0",
"postcss-media-minmax": "^4.0.0",
"postcss-nested": "^4.1.0",
"postcss-nesting": "^7.0.0",
"postcss-pseudoelements": "^5.0.0",
"postcss-selector-matches": "^3.0.1",
"postcss-selector-not": "^3.0.1",
"prettier": "^1.13.5",
"postcss-selector-matches": "^4.0.0",
"postcss-selector-not": "^4.0.0",
"prettier": "^1.14.3",
"raw-loader": "^0.5.1",
"react-deep-force-update": "^2.1.1",
"react-dev-utils": "^5.0.1",
"react-error-overlay": "^4.0.0",
"react-test-renderer": "^16.4.1",
"react-deep-force-update": "^2.1.3",
"react-dev-utils": "^5.0.2",
"react-error-overlay": "^4.0.1",
"react-test-renderer": "^16.5.2",
"rimraf": "^2.6.2",
"stylelint": "^9.3.0",
"stylelint": "^9.5.0",
"stylelint-config-standard": "^18.2.0",
"stylelint-order": "^0.8.1",
"stylelint-order": "^1.0.0",
"svg-url-loader": "^2.3.2",
"url-loader": "^1.0.1",
"webpack": "^4.12.0",
"webpack-assets-manifest": "^3.0.1",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-dev-middleware": "^3.1.3",
"webpack-hot-middleware": "^2.22.2",
"url-loader": "^1.1.1",
"webpack": "^4.19.1",
"webpack-assets-manifest": "^3.0.2",
"webpack-bundle-analyzer": "^3.0.2",
"webpack-dev-middleware": "^3.3.0",
"webpack-hot-middleware": "^2.24.2",
"webpack-node-externals": "^1.7.2"
},
"lint-staged": {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class Html extends React.Component {
<script
dangerouslySetInnerHTML={{ __html: `window.App=${serialize(app)}` }}
/>
{scripts.map(script => <script key={script} src={script} />)}
{scripts.map(script => (
<script key={script} src={script} />
))}
{config.analytics.googleTrackingId && (
<script
dangerouslySetInnerHTML={{
Expand Down
7 changes: 4 additions & 3 deletions tools/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const config = {

// https://babeljs.io/docs/usage/options/
babelrc: false,
configFile: false,
presets: [
// A Babel preset that can automatically determine the Babel plugins and polyfills
// https://github.com/babel/babel-preset-env
Expand All @@ -98,9 +99,6 @@ const config = {
debug: false,
},
],
// Experimental ECMAScript proposals
// https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-
['@babel/preset-stage-2', { decoratorsLegacy: true }],
// Flow
// https://github.com/babel/babel/tree/master/packages/babel-preset-flow
'@babel/preset-flow',
Expand All @@ -109,6 +107,9 @@ const config = {
['@babel/preset-react', { development: isDebug }],
],
plugins: [
// Experimental ECMAScript proposals
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
// Treat React JSX elements as value types and hoist them to the highest scope
// https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements
...(isDebug ? [] : ['@babel/transform-react-constant-elements']),
Expand Down
Loading

0 comments on commit 8d6c018

Please sign in to comment.