mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Ensure implicit injections shim is run early (#27829)
This needs to run before any component files are `import`'d. In traditional resolver-based tests, this was working previously because component files would only be loaded 'at runtime'. However, in gjs-based tests (e.g. those introduced in the formkit PR), component files are imported before the application is booted.
This commit is contained in:
parent
895e9a5893
commit
a2463313a8
@ -2,16 +2,19 @@
|
||||
import "decorator-transforms/globals";
|
||||
import "./loader-shims";
|
||||
import "./global-compat";
|
||||
import { registerDiscourseImplicitInjections } from "discourse/lib/implicit-injections";
|
||||
/* eslint-enable simple-import-sort/imports */
|
||||
|
||||
// Register Discourse's standard implicit injections on common framework classes.
|
||||
registerDiscourseImplicitInjections();
|
||||
|
||||
import Application from "@ember/application";
|
||||
import { VERSION } from "@ember/version";
|
||||
import require from "require";
|
||||
import { normalizeEmberEventHandling } from "discourse/lib/ember-events";
|
||||
import { registerDiscourseImplicitInjections } from "discourse/lib/implicit-injections";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import { buildResolver } from "discourse-common/resolver";
|
||||
import { VERSION } from "@ember/version";
|
||||
|
||||
const _pluginCallbacks = [];
|
||||
let _unhandledThemeErrors = [];
|
||||
@ -36,9 +39,6 @@ class Discourse extends Application {
|
||||
// between Glimmer and Classic components.
|
||||
normalizeEmberEventHandling(this);
|
||||
|
||||
// Register Discourse's standard implicit injections on common framework classes.
|
||||
registerDiscourseImplicitInjections();
|
||||
|
||||
if (Error.stackTraceLimit) {
|
||||
// We need Errors to have full stack traces for `lib/source-identifier`
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
Loading…
Reference in New Issue
Block a user