From 40d60834c21ff4c5c9db10d5c4bf68e21e932e88 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Mon, 21 Feb 2022 15:28:12 +0000 Subject: [PATCH] Add babel plugin to workaround bug in @babel/preset-env (#45664) (#45667) * Add babel plugin to workaround bug in @babel/preset-env (#45664) (cherry picked from commit 05f68c391c67790cbf8c81c4ac295b12c808d310) * Change ordering --- babel.config.json | 3 +++ package.json | 1 + yarn.lock | 25 +++++++++++++------------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/babel.config.json b/babel.config.json index 4de74eb504a..28e9f48eeed 100644 --- a/babel.config.json +++ b/babel.config.json @@ -33,6 +33,9 @@ "allowDeclareFields": true } ], + // added to mitigate https://github.com/babel/babel/issues/14289 + // package (and following line) can be removed once the issue is fixed and released + "@babel/plugin-proposal-class-properties", ["@babel/plugin-proposal-object-rest-spread", { "loose": true }], "@babel/plugin-transform-react-constant-elements", "@babel/plugin-proposal-nullish-coalescing-operator", diff --git a/package.json b/package.json index c4a21acd45f..6912959e9b3 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ }, "devDependencies": { "@babel/core": "7.16.7", + "@babel/plugin-proposal-class-properties": "7.16.7", "@babel/plugin-proposal-nullish-coalescing-operator": "7.16.7", "@babel/plugin-proposal-object-rest-spread": "7.16.7", "@babel/plugin-proposal-optional-chaining": "7.16.7", diff --git a/yarn.lock b/yarn.lock index f69b2c7924f..306363ac499 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1006,6 +1006,18 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-proposal-class-properties@npm:7.16.7, @babel/plugin-proposal-class-properties@npm:^7.16.7": + version: 7.16.7 + resolution: "@babel/plugin-proposal-class-properties@npm:7.16.7" + dependencies: + "@babel/helper-create-class-features-plugin": ^7.16.7 + "@babel/helper-plugin-utils": ^7.16.7 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 3977e841e17b45b47be749b9a5b67b9e8b25ff0840f9fdad3f00cbcb35db4f5ff15f074939fe19b01207a29688c432cc2c682351959350834d62920b7881f803 + languageName: node + linkType: hard + "@babel/plugin-proposal-class-properties@npm:^7.12.1, @babel/plugin-proposal-class-properties@npm:^7.13.0, @babel/plugin-proposal-class-properties@npm:^7.14.5": version: 7.14.5 resolution: "@babel/plugin-proposal-class-properties@npm:7.14.5" @@ -1018,18 +1030,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-proposal-class-properties@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-proposal-class-properties@npm:7.16.7" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3977e841e17b45b47be749b9a5b67b9e8b25ff0840f9fdad3f00cbcb35db4f5ff15f074939fe19b01207a29688c432cc2c682351959350834d62920b7881f803 - languageName: node - linkType: hard - "@babel/plugin-proposal-class-static-block@npm:^7.15.4": version: 7.15.4 resolution: "@babel/plugin-proposal-class-static-block@npm:7.15.4" @@ -19572,6 +19572,7 @@ __metadata: resolution: "grafana@workspace:." dependencies: "@babel/core": 7.16.7 + "@babel/plugin-proposal-class-properties": 7.16.7 "@babel/plugin-proposal-nullish-coalescing-operator": 7.16.7 "@babel/plugin-proposal-object-rest-spread": 7.16.7 "@babel/plugin-proposal-optional-chaining": 7.16.7