Skip to content

Commit

Permalink
Removing class-property-transpilation is the only way to not transpil…
Browse files Browse the repository at this point in the history
…e class properties
  • Loading branch information
NullVoxPopuli committed Jun 26, 2022
1 parent 315df8a commit f8adaf2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions lib/babel-options-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion lib/ember-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
];
}
}
Expand Down

0 comments on commit f8adaf2

Please sign in to comment.