From f8adaf23f4455a56e2f22036c0e736940b483fd9 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 | 46 +++++++++++++++++++-------------------- lib/ember-plugins.js | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/babel-options-util.js b/lib/babel-options-util.js index 6300e3fd..3abdc6e5 100644 --- a/lib/babel-options-util.js +++ b/lib/babel-options-util.js @@ -322,28 +322,28 @@ function _addDecoratorPlugins(plugins, options, config, parent, project) { addPlugin( plugins, [require.resolve("@babel/plugin-proposal-decorators"), { legacy: true }], - _buildClassFeaturePluginConstraints( - { - before: ["@babel/plugin-proposal-class-properties"], - }, - config, - parent, - project - ) + // _buildClassFeaturePluginConstraints( + // { + // before: ["@babel/plugin-proposal-class-properties"], + // }, + // config, + // parent, + // project + // ) ); } - 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-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( @@ -368,10 +368,10 @@ function _addDecoratorPlugins(plugins, options, config, parent, project) { function _addClassProperties(addPlugin, plugins, options, config, parent, project) { addPlugin( plugins, - [ - require.resolve("@babel/plugin-proposal-class-properties"), - { loose: options.loose || false } - ], + // [ + // require.resolve("@babel/plugin-proposal-class-properties"), + // { loose: options.loose || false } + // ], _buildClassFeaturePluginConstraints( { after: ["@babel/plugin-proposal-decorators"], diff --git a/lib/ember-plugins.js b/lib/ember-plugins.js index 3ffbb36c..24012f78 100644 --- a/lib/ember-plugins.js +++ b/lib/ember-plugins.js @@ -163,7 +163,7 @@ function _getProposalDecoratorsAndClassPlugins(config) { if (!config.shouldIgnoreDecoratorAndClassPlugins) { return [ ["@babel/plugin-proposal-decorators", { legacy: true }], - ["@babel/plugin-proposal-class-properties"], + // ["@babel/plugin-proposal-class-properties"], ]; } }