From 9240e169ecf8fa91413f26ca5ff4dea72864d3d4 Mon Sep 17 00:00:00 2001 From: Oscar Sanchez Date: Tue, 13 Nov 2018 02:20:15 +0300 Subject: [PATCH 1/4] Added babel optional proposal. --- packages/react-scripts/config/webpack.config.js | 1 + packages/react-scripts/package.json | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 80391927084..b6975b41c43 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -384,6 +384,7 @@ module.exports = function(webpackEnv) { }, }, ], + require.resolve('@babel/plugin-proposal-optional-chaining'), ], // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index dfef220b781..60be9efa136 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,7 +1,7 @@ { - "name": "react-scripts", + "name": "frodo-react-scripts", "version": "2.1.1", - "description": "Configuration and scripts for Create React App.", + "description": "Configuration and scripts for Create React App. + optional chaining", "repository": "facebook/create-react-app", "license": "MIT", "engines": { @@ -25,6 +25,7 @@ "types": "./lib/react-app.d.ts", "dependencies": { "@babel/core": "7.1.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@svgr/webpack": "2.4.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "9.0.0", @@ -62,6 +63,7 @@ "postcss-safe-parser": "4.0.1", "react-app-polyfill": "^0.1.3", "react-dev-utils": "^6.1.1", + "react-error-overlay": "^5.1.0", "resolve": "1.8.1", "sass-loader": "7.1.0", "style-loader": "0.23.0", From fcb29a461c87f65bee0e031a4e2c807e742b51cb Mon Sep 17 00:00:00 2001 From: Oscar Sanchez Date: Tue, 13 Nov 2018 20:29:00 +0300 Subject: [PATCH 2/4] Added decorators. --- .../react-scripts/config/webpack.config.js | 19 +++++++++++++------ packages/react-scripts/package.json | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index b6975b41c43..278a81d0a6b 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -374,17 +374,24 @@ module.exports = function(webpackEnv) { // @remove-on-eject-end plugins: [ [ - require.resolve('babel-plugin-named-asset-import'), + require.resolve("@babel/plugin-proposal-decorators"), + { + decoratorsBeforeExport: false, + legacy: false + } + ], + [ + require.resolve("babel-plugin-named-asset-import"), { loaderMap: { svg: { ReactComponent: - '@svgr/webpack?-prettier,-svgo![path]', - }, - }, - }, + "@svgr/webpack?-prettier,-svgo![path]" + } + } + } ], - require.resolve('@babel/plugin-proposal-optional-chaining'), + require.resolve("@babel/plugin-proposal-optional-chaining") ], // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 60be9efa136..dc3de4e223b 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "frodo-react-scripts", - "version": "2.1.1", + "version": "2.1.3", "description": "Configuration and scripts for Create React App. + optional chaining", "repository": "facebook/create-react-app", "license": "MIT", @@ -25,6 +25,7 @@ "types": "./lib/react-app.d.ts", "dependencies": { "@babel/core": "7.1.0", + "@babel/plugin-proposal-decorators": "^7.1.2", "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@svgr/webpack": "2.4.1", "babel-core": "7.0.0-bridge.0", From ac12b5a705de628f407d958a2320e0ce9e0e8a9d Mon Sep 17 00:00:00 2001 From: Oscar Sanchez Date: Sun, 30 Dec 2018 13:15:11 +0300 Subject: [PATCH 3/4] Removed decorators, added graphql-tag + class properties. --- packages/react-scripts/config/webpack.config.js | 16 ++++++++-------- packages/react-scripts/package.json | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 278a81d0a6b..03bd7cfa28a 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -49,6 +49,7 @@ const cssRegex = /\.css$/; const cssModuleRegex = /\.module\.css$/; const sassRegex = /\.(scss|sass)$/; const sassModuleRegex = /\.module\.(scss|sass)$/; +const graphqlRegex = /\.(graphql|gql)$/; // This is the production and development configuration. // It is focused on developer experience, fast rebuilds, and a minimal bundle. @@ -373,13 +374,6 @@ module.exports = function(webpackEnv) { ), // @remove-on-eject-end plugins: [ - [ - require.resolve("@babel/plugin-proposal-decorators"), - { - decoratorsBeforeExport: false, - legacy: false - } - ], [ require.resolve("babel-plugin-named-asset-import"), { @@ -391,7 +385,8 @@ module.exports = function(webpackEnv) { } } ], - require.resolve("@babel/plugin-proposal-optional-chaining") + require.resolve("@babel/plugin-proposal-optional-chaining"), + require.resolve("@babel/plugin-proposal-class-properties"), ], // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ @@ -503,6 +498,11 @@ module.exports = function(webpackEnv) { 'sass-loader' ), }, + { + test: graphqlRegex, + exclude: /node_modules/, + loader: 'graphql-tag/loader' + }, // "file" loader makes sure those assets get served by WebpackDevServer. // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `build` folder. diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index dc3de4e223b..9f951f9e7ec 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "frodo-react-scripts", - "version": "2.1.3", + "version": "2.1.7", "description": "Configuration and scripts for Create React App. + optional chaining", "repository": "facebook/create-react-app", "license": "MIT", @@ -25,6 +25,7 @@ "types": "./lib/react-app.d.ts", "dependencies": { "@babel/core": "7.1.0", + "@babel/plugin-proposal-class-properties": "^7.2.3", "@babel/plugin-proposal-decorators": "^7.1.2", "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@svgr/webpack": "2.4.1", @@ -50,6 +51,7 @@ "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", "fs-extra": "7.0.0", + "graphql-tag": "^2.10.0", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", "jest": "23.6.0", From 74848a261dd35201d50688b70ea0f560a2037437 Mon Sep 17 00:00:00 2001 From: Oscar Sanchez Date: Tue, 1 Jan 2019 23:07:45 +0300 Subject: [PATCH 4/4] Updated version. --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 9f951f9e7ec..bb6c4b4b779 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "frodo-react-scripts", - "version": "2.1.7", + "version": "2.1.11", "description": "Configuration and scripts for Create React App. + optional chaining", "repository": "facebook/create-react-app", "license": "MIT",