From 35e8c43b0c4d4644d4f4bb9af2893d5b4ff23e9d Mon Sep 17 00:00:00 2001 From: renatoagds Date: Sat, 27 Jul 2019 00:14:56 -0300 Subject: [PATCH 1/3] Adding optional chaining and nullish plugins dependencies --- packages/babel-preset-react-app/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 09b2e6aabf7..dc611a2d473 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -24,7 +24,9 @@ "@babel/core": "7.6.0", "@babel/plugin-proposal-class-properties": "7.5.5", "@babel/plugin-proposal-decorators": "7.6.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "7.4.4", "@babel/plugin-proposal-object-rest-spread": "7.5.5", + "@babel/plugin-proposal-optional-chaining": "7.2.0", "@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/plugin-transform-destructuring": "7.6.0", "@babel/plugin-transform-flow-strip-types": "7.4.4", From 899a4c36301f316d73a49b6a3c14ac55972955ba Mon Sep 17 00:00:00 2001 From: renatoagds Date: Sat, 27 Jul 2019 00:15:30 -0300 Subject: [PATCH 2/3] Importing optional chaining and nullish plugins --- packages/babel-preset-react-app/create.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/babel-preset-react-app/create.js b/packages/babel-preset-react-app/create.js index 7b7f1da6ed1..2ce8ae41976 100644 --- a/packages/babel-preset-react-app/create.js +++ b/packages/babel-preset-react-app/create.js @@ -190,6 +190,10 @@ module.exports = function(api, opts, env) { ], // Adds syntax support for import() require('@babel/plugin-syntax-dynamic-import').default, + // Adds syntax support for optional chaining (.?) + require('@babel/plugin-proposal-optional-chaining').default, + // Adds syntax support for default value using ?? operator + require('@babel/plugin-proposal-nullish-coalescing-operator').default, isEnvTest && // Transform dynamic import to require require('babel-plugin-dynamic-import-node'), From db0ea6872a89189439149c1f23da1522014b3a46 Mon Sep 17 00:00:00 2001 From: renatoagds Date: Tue, 10 Sep 2019 17:01:14 -0300 Subject: [PATCH 3/3] Update optional-chaining for new version (v7.6.0) --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index dc611a2d473..fdd22f7ec3a 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -26,7 +26,7 @@ "@babel/plugin-proposal-decorators": "7.6.0", "@babel/plugin-proposal-nullish-coalescing-operator": "7.4.4", "@babel/plugin-proposal-object-rest-spread": "7.5.5", - "@babel/plugin-proposal-optional-chaining": "7.2.0", + "@babel/plugin-proposal-optional-chaining": "7.6.0", "@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/plugin-transform-destructuring": "7.6.0", "@babel/plugin-transform-flow-strip-types": "7.4.4",