DEV: Drop Ember 'barrel file' import (#27769)

`import Ember from "Ember"` will be deprecated in an upcoming version of Ember
This commit is contained in:
David Taylor 2024-07-08 13:16:34 +01:00 committed by GitHub
parent 619f132f57
commit 49f6e1133a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,7 @@
// eslint-disable-next-line ember/no-classic-components
import { EventDispatcher } from "@ember/-internals/views";
import Component from "@ember/component";
import EmberObject from "@ember/object";
import Ember from "ember";
import { actionModifier } from "./ember-action-modifier";
/**
@ -55,7 +55,7 @@ export function normalizeEmberEventHandling(app) {
*/
function eliminateClassicEventDelegation() {
// eslint-disable-next-line no-undef
Ember.EventDispatcher.reopen({
EventDispatcher.reopen({
events: {},
});
}

View File

@ -1,4 +1,3 @@
import Ember from "ember";
import loadEmberExam from "ember-exam/test-support/load";
import { start } from "ember-qunit";
import * as QUnit from "qunit";
@ -7,8 +6,7 @@ import setupTests from "discourse/tests/setup-tests";
import config from "../config/environment";
document.addEventListener("discourse-init", () => {
// eslint-disable-next-line no-undef
if (!EmberENV.TESTS_FILE_LOADED) {
if (!window.EmberENV.TESTS_FILE_LOADED) {
throw new Error(
'The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".'
);
@ -27,7 +25,7 @@ document.addEventListener("discourse-init", () => {
const testingCore = !testingTheme && (!target || target === "core");
const disableAutoStart = params.get("qunit_disable_auto_start") === "1";
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
window.EmberENV.LOG_STACKTRACE_ON_DEPRECATION = false;
document.body.insertAdjacentHTML(
"afterbegin",