Skip to content

Do not populate EmberENV with default values#24

Merged
rwjblue merged 1 commit intoemberjs:masterfrom
simonihmig:no-default-value
Sep 17, 2018
Merged

Do not populate EmberENV with default values#24
rwjblue merged 1 commit intoemberjs:masterfrom
simonihmig:no-default-value

Conversation

@simonihmig
Copy link
Copy Markdown
Contributor

This is to enable the Ember runtime to distinguish between true by default and explicitly true. Which is required to correctly implement the jQuery.originalEvent deprecation, where this should only be triggered when jQuery is enabled by default, and not when it is explicitly enabled. Previously EmberENV['_JQUERY_INTEGRATION'] would be true for both cases, with no way to distinguish. Now when the flag is not explicitly set EmberENV['_JQUERY_INTEGRATION'] will be undefined, which Ember will still treat as true by default here

The default value will now only be used for the isFeatureEnabled() check, but not for populating EmberENV anymore.

Fixes emberjs/ember.js#16849

Note: I confirmed with the provided reproduction that this fixes the jQuery issue above. But I am not sure if this can have any unexpected implications for the other two optional features, as I am unaware how exactly they are implemented. So please double check if the changes here are acceptable! If not, maybe we would have to introduce another flag for a given feature, that specifies if the default value should be set or not!? 🤔

@simonihmig
Copy link
Copy Markdown
Contributor Author

Travis is failing due to some dependency not working with node 4 anymore. So let's drop it as well: #25

Will rebase this once #25 is merged. This is passing locally, so still ready for review! 😀

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Sep 14, 2018

#25 is landed...

@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Sep 14, 2018

Changes look good, will land once rebase...

This is to enable the Ember runtime to distinguish between `true` by default and explicitly `true`. Which is required to correctly implement the `jQuery.originalEvent` deprecation, where this should only be triggered when jQuery is enabled by default, and not when it is explicitly enabled. Previously `EmberENV['_JQUERY_INTEGRATION']` would be `true` for both cases, with no way to distinguish. Now when the flag is not explicitly set `EmberENV['_JQUERY_INTEGRATION']` will be `undefined`.

The default value will now only be used for the `isFeatureEnabled()` check, but not for populating `EmberENV` anymore.

Fixes emberjs/ember.js#16849
@simonihmig
Copy link
Copy Markdown
Contributor Author

@rwjblue done!

@rwjblue rwjblue merged commit 8aaee9c into emberjs:master Sep 17, 2018
@rwjblue rwjblue added the bug Something isn't working label Sep 17, 2018
@simonihmig simonihmig deleted the no-default-value branch September 17, 2018 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jquery-integration optional feature prints a warning even when enabled

2 participants