From 7b84f37494e2108f867224e33fa34e96839779a3 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Sun, 26 Jun 2022 17:07:39 -0400 Subject: [PATCH] Removing class-property-transpilation is the only way to not transpile class properties --- lib/babel-options-util.js | 71 +-------------------------------------- lib/ember-plugins.js | 1 - 2 files changed, 1 insertion(+), 71 deletions(-) diff --git a/lib/babel-options-util.js b/lib/babel-options-util.js index 6300e3fd..96149f8d 100644 --- a/lib/babel-options-util.js +++ b/lib/babel-options-util.js @@ -321,30 +321,10 @@ function _addDecoratorPlugins(plugins, options, config, parent, project) { } else { addPlugin( plugins, - [require.resolve("@babel/plugin-proposal-decorators"), { legacy: true }], - _buildClassFeaturePluginConstraints( - { - before: ["@babel/plugin-proposal-class-properties"], - }, - config, - parent, - project - ) + [require.resolve("@babel/plugin-proposal-decorators"), { legacy: true }] ); } - if (hasPlugin(plugins, "@babel/plugin-proposal-class-properties")) { - if (parent === project) { - project.ui.writeWarnLine( - `${_parentName( - parent - )} has added the class-properties plugin to its build, but ember-cli-babel provides these by default now! You can remove the transforms, or the addon that provided them, such as @ember-decorators/babel-transforms.` - ); - } - } else { - _addClassProperties(addPlugin, plugins, options, config, parent, project); - } - if (hasPlugin(plugins, "babel-plugin-filter-imports")) { let checker = new VersionChecker(parent).for( "babel-plugin-filter-imports", @@ -365,54 +345,6 @@ function _addDecoratorPlugins(plugins, options, config, parent, project) { return plugins; } -function _addClassProperties(addPlugin, plugins, options, config, parent, project) { - addPlugin( - plugins, - [ - require.resolve("@babel/plugin-proposal-class-properties"), - { loose: options.loose || false } - ], - _buildClassFeaturePluginConstraints( - { - after: ["@babel/plugin-proposal-decorators"], - }, - config, - parent, - project - ) - ); - addPlugin( - plugins, - [ - require.resolve("@babel/plugin-proposal-private-methods"), - { loose: options.loose || false } - ], - _buildClassFeaturePluginConstraints( - { - after: ["@babel/plugin-proposal-decorators"], - }, - config, - parent, - project - ) - ); - addPlugin( - plugins, - [ - require.resolve("@babel/plugin-proposal-private-property-in-object"), - { loose: options.loose || false } - ], - _buildClassFeaturePluginConstraints( - { - after: ["@babel/plugin-proposal-decorators"], - }, - config, - parent, - project - ) - ); -} - function _addTypeScriptPlugin(plugins, parent, project) { const { hasPlugin, addPlugin } = require("ember-cli-babel-plugin-helpers"); @@ -433,7 +365,6 @@ function _addTypeScriptPlugin(plugins, parent, project) { ], { before: [ - "@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-private-methods", "@babel/plugin-proposal-decorators", ], diff --git a/lib/ember-plugins.js b/lib/ember-plugins.js index 3ffbb36c..90569f00 100644 --- a/lib/ember-plugins.js +++ b/lib/ember-plugins.js @@ -163,7 +163,6 @@ function _getProposalDecoratorsAndClassPlugins(config) { if (!config.shouldIgnoreDecoratorAndClassPlugins) { return [ ["@babel/plugin-proposal-decorators", { legacy: true }], - ["@babel/plugin-proposal-class-properties"], ]; } }