Repository navigation
Ensure external helpers are not used when modules are not transpiled. - #267
Merged
rwjblue merged 1 commit intoFeb 12, 2019
Merged
Conversation
rwjblue
force-pushed
the
tweak-should-include-external-helpers
branch
from
February 12, 2019 14:42
a0b1b2f to
cada0c1
Compare
When using something akin to the following somewhat common pattern:
```js
let babel = this.addons.find(addon => addon.name === 'ember-cli-babel');
let tree = babel.transpileTree(input, {
'ember-cli-babel': {
compileModules: false,
}
});
```
The previous logic would still attempt to use external helpers even when
modules themselves are not being transpiled. This meant that the final
output would include untranspiled `import` statements.
This affects common addons such as:
* ember-fetch
* ember-service-worker
* ember-data
* @ember/test-helpers
* ember-angle-bracket-invocation-polyfill
* ember-modifier-manager-polyfill
---
The fix here is to detect that modules will not be compiled, and avoid
usage of the external helpers.
This also moves the validation that parent addon's do not specify
`includeExternalHelpers` in their own config to the shared
`getAddonConfig` method (and makes the logic in that method a bit easier
to grok).
pzuraq
approved these changes
Feb 12, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using something akin to the following somewhat common pattern:
The previous logic would still attempt to use external helpers even when modules themselves are not being transpiled. This meant that the final output would include untranspiled
importstatements.This affects common addons such as:
The fix here is to detect that modules will not be compiled, and avoid usage of the external helpers.
This also moves the validation that parent addon's do not specify
includeExternalHelpersin their own config to the sharedgetAddonConfigmethod (and makes the logic in that method a bit easier to grok).Fixes ember-polyfills/ember-modifier-manager-polyfill#4