Skip to content
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 presets array bug #224

Merged
merged 1 commit into from
May 26, 2018
Merged

Fix presets array bug #224

merged 1 commit into from
May 26, 2018

Conversation

twokul
Copy link
Member

@twokul twokul commented May 26, 2018

In ember-cli when using DELAYED_TRANSPILATION feature, we explicitly
set disablePresetEnv flag to true. shouldRunPresetEnv is a
negation of disablePresetEnv.

Prior to this change options.presets was an array with one false
item in it (shouldRunPresetEnv was set to false) and would not let files
be transplied when DELAYED_TRANSPILATION was enabled.

Useful links:

@twokul
Copy link
Member Author

twokul commented May 26, 2018

unblocks ember-cli/ember-cli#7848 and fixes ember-cli/ember-cli#7850

@twokul
Copy link
Member Author

twokul commented May 26, 2018

/cc @stefanpenner and @kellyselden

index.js Outdated
@@ -221,9 +221,13 @@ module.exports = {
userPostTransformPlugins
).filter(Boolean);

options.presets = [
shouldRunPresetEnv && this._getPresetEnvPlugins(addonProvidedConfig),
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier to add .filter(Boolean) here instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the condition is easier to read than &&

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I agree with @rwjblue, I think the consistency with the above .filter(Boolean) would be better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peer pressure 😝

In `ember-cli` when using `DELAYED_TRANSPILATION` feature, we explicitly
set `disablePresetEnv` flag to `true`. `shouldRunPresetEnv` is a
negation of `disablePresetEnv`.

Prior to this change `options.presets` was an array with one `false`
item in it (`shouldRunPresetEnv` was set to `false`) and would let files
be transplied when `DELAYED_TRANSPILATION` was enabled.

Useful links:

+ https://github.com/ember-cli/ember-cli/blob/2e0cade64c4698cc48b1fdc20fda2219e63cc973/lib/models/addon.js#L256
@twokul
Copy link
Member Author

twokul commented May 26, 2018

@rwjblue @kellyselden comment addressed, I can't merge so w/e you're ready 😺

@rwjblue
Copy link
Member

rwjblue commented May 26, 2018

I’ll get it released in an hour or so...

@kellyselden kellyselden merged commit 194c847 into emberjs:master May 26, 2018
@twokul twokul deleted the fix branch May 26, 2018 20:10
@kellyselden
Copy link
Member

Released in v6.14.1

@Turbo87 Turbo87 added the bug label May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants