-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
jquery-integration optional feature prints a warning even when enabled #16849
jquery-integration optional feature prints a warning even when enabled #16849
Comments
@boris-petrov so you have a |
@pixelhandler - now that I think about it, this warning comes from a third-party plugin - namely |
Actually, I lied. This also warns in our own code. I have something like: {{input value=this.filterText keyDown=(action "keyDown") keyUp=(action "keyUp") focusIn=(action "focused") focusOut=(action "unfocused")}} actions:
unfocused: (event) ->
target = event.relatedTarget ? event.originalEvent?.explicitOriginalTarget And this gives the warning. Please tell me if you cannot reproduce it with this code and I will try to create a full sample. |
I can confirm things behave strangely here. Will investigate... |
This basically makes it impossible to distinguish between jQuery being enabled by default and enabled explicitly. But we rely on this distinction here: I would say we should fix this in |
@simonihmig - why do you prefer to fix this in |
@boris-petrov |
@simonihmig - the documentation for deprecate specifies that only falsy values would trigger the deprecation. |
But we want to show the deprecation if the flag is undefined, and only then! We don't show it when it's either true (user explicitly wants jQuery) or false (their is no jQuery available in the first place, so any use of But because of the mentioned behavior in |
FWIW, here's a repo with a failing test for the issue. |
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
@bendemboski Thanks for the reproduction, that was helpful! I created a PR for |
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
I've followed all the steps that are needed for enabling jQuery integration (I have the latest versions of
@ember/jquery
and@ember/optional-features
installed and inpackage.json
; have"jquery-integration": true
inoptional-features.json
) but I still see a warning in the console when accessingoriginalEvent
. I see the following check:Which returns
false
in my case asEmberENV
is:I think
_JQUERY_INTEGRATION
defaults totrue
and perhaps it is being removed from the hash because it has the same value? If this is so, the code above should be changed to:Am I missing something?
P.S. Ember 3.3.1 and latest Ember CLI.
The text was updated successfully, but these errors were encountered: