Closed Windvis closed 7 months ago
Partly solved by https://github.com/babel/ember-cli-babel/pull/449 since that removes the "class-properties" plugin.
Looking into it, it seems it won't be this simple (which is probably why it wasn't done before 😅):
Some things I encountered:
after patching ember-cli-babel to remove the transforms, an exception is thrown at runtime by the (legacy) decorator plugin. The docs explicitly mention that those plugins shouldn't be needed anymore if you use preset-env though 🤔. https://babeljs.io/docs/babel-plugin-proposal-decorators#legacy
If you are already using @babel/preset-env, you can safely remove @babel/plugin-transform-class-properties and @babel/plugin-private-methods:
Error message:
Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.
This is the same issue as mentioned here: https://github.com/babel/ember-cli-babel/issues/447
I've opened a discussion in the babel repo to see if this behavior is intended: https://github.com/babel/babel/discussions/15912
ember-cli-babel
hardcodes these plugins so they are always transpiled even if the app's targets support the features natively.@babel/preset-env
v7.14 also includes these plugins by default so these features would still be transpiled if needed.I think we can safely remove the plugins without it being a breaking change.