DEV: Enable jquery-integration runtime deprecation (#18057)

Omitting the flag from optional-features enables the runtime deprecation notice.

Also introduces `ember-jquery-legacy` which can be used to migrate to the new behaviour early. Details at https://deprecations.emberjs.com/v3.x/#toc_jquery-event

Core does not appear to make use of `originalEvent` in Ember event handlers. When searching for `originalEvent` there are some matches which relate to our pan-events mixin, but this is our own implementation and not affected by this deprecation.
This commit is contained in:
David Taylor 2022-08-23 19:28:22 +01:00 committed by GitHub
parent 1b180a3bdb
commit 851bd78347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,4 @@
{
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": true
"default-async-observers": true
}

View File

@ -18,3 +18,16 @@ define("ember-addons/ember-computed-decorators", [
);
return decorators;
});
// Based on https://github.com/emberjs/ember-jquery-legacy
// The addon has out-of-date dependences, but it's super simple so we can reproduce here instead:
define("ember-jquery-legacy", ["exports"], function (exports) {
exports.normalizeEvent = function (e) {
if (e instanceof Event) {
return e;
}
// __originalEvent is a private escape hatch of Ember's EventDispatcher to allow accessing `originalEvent` without
// triggering a deprecation message.
return e.__originalEvent || e.originalEvent;
};
});