DEV: Only add ember-global deprecation for Ember 3 (#24667)

(otherwise, we're accidentally extending support into Ember 5!)

Followup to 106c1c317f
This commit is contained in:
David Taylor 2023-12-01 14:50:15 +00:00 committed by GitHub
parent f8bf4bda00
commit 9f9c82ea97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 20 deletions

View File

@ -35,27 +35,29 @@ define("discourse/lib/deprecate-shim", ["exports"], function (exports) {
);
// Patch ember-global deprecation
Object.defineProperty(window, "Ember", {
enumerable: true,
configurable: true,
get() {
require("@ember/debug").deprecate(
"Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.",
false,
{
id: "ember-global",
until: "4.0.0",
url: "https://deprecations.emberjs.com/v3.x/#toc_ember-global",
for: "ember-source",
since: {
enabled: "3.27.0",
},
}
);
if (window.hasOwnProperty("Ember")) {
Object.defineProperty(window, "Ember", {
enumerable: true,
configurable: true,
get() {
require("@ember/debug").deprecate(
"Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.",
false,
{
id: "ember-global",
until: "4.0.0",
url: "https://deprecations.emberjs.com/v3.x/#toc_ember-global",
for: "ember-source",
since: {
enabled: "3.27.0",
},
}
);
return require("ember").default;
},
});
return require("ember").default;
},
});
}
};
});