-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compatibility with ember-cli-babel@7.26+ #362
Conversation
a1ffedd
to
b014e3f
Compare
b014e3f
to
44a6fe7
Compare
ember-cli-babel@7.24 fixed a bug where the `buildBabelOptions` result included a number of non-babel specific properties. Unfortunately, while we were explicitly working around that bug (the `delete`'s in the snippet here) but we **also** ended up relying on it with the usage of `filterExtensions` property. In order to make it possible for ember-auto-import to have a path forward, ember-cli-babel@7.26.0 introduces a new public API to get a list of the supported extensions (`babelAddon.getSupportedExtensions`). This PR uses the presence of the `getSupportedExtensions` function to decide if it needs to clear the abnormal properties or not, and fixes usage of ember-auto-import along with ember-cli-babel@7.26+.
44a6fe7
to
3d65928
Compare
let babelOptions, extensions; | ||
|
||
if (typeof babelAddon.getSupportedExtensions === 'function') { | ||
babelOptions = babelAddon.buildBabelOptions('babel', options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this new signature so that I could make the default invocation without arguments (or options) passed return the broccoli-babel-transpiler style options.
Now that the test updates have landed, we can probably just update the ember-cli-babel version in |
This is breaking ember-auto-import 2.0.0-beta.1 due to emberjs/ember-cli-babel#401. I'm going to revert it and rely on the backward compatible call signature instead. |
ember-cli-babel@7.24 fixed a bug where the
buildBabelOptions
result included a number of non-babel specific properties (reported in emberjs/ember-cli-babel#227). Unfortunately, while we were explicitly working around that bug (thedelete
's in the snippet here) but we also ended up relying on it with the usage offilterExtensions
property.In order to make it possible for ember-auto-import to have a path forward, ember-cli-babel@7.26.0 introduces a new public API to get a list of the supported extensions (
babelAddon.getSupportedExtensions
).This PR uses the presence of the
getSupportedExtensions
function to decide if it needs to clear the abnormal properties or not, and fixes usage of ember-auto-import along with ember-cli-babel@7.26+.Fixes #359
Fixes emberjs/ember-cli-babel#389