mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 22:26:26 +08:00
DEV: Run implicit-injections shim earlier in boot
We need these Ember framework class overrides to be applied before anything attempts to extend them. An initializer is too late, because initializer files may `import` a module which defines classes which extend the framework classes. In the past this rarely mattered because Ember's legacy `SomeObject.extend` is quite forgiving - it will respect changes made to `SomeObject` right up until the first `.create()` call. However, the native class syntax (`class extends SomeObject`) will 'freeze' `SomeObject` as soon as the class is defined.
This commit is contained in:
parent
fbabea5c76
commit
5aaf5cbaf4
|
@ -5,6 +5,7 @@ import Application from "@ember/application";
|
|||
import { buildResolver } from "discourse-common/resolver";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import { normalizeEmberEventHandling } from "./lib/ember-events";
|
||||
import { registerDiscourseImplicitInjections } from "discourse/lib/implicit-injections";
|
||||
|
||||
const _pluginCallbacks = [];
|
||||
let _unhandledThemeErrors = [];
|
||||
|
@ -28,6 +29,9 @@ const Discourse = Application.extend({
|
|||
// 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;
|
||||
|
|
|
@ -6,8 +6,6 @@ import Session from "discourse/models/session";
|
|||
import Site from "discourse/models/site";
|
||||
import User from "discourse/models/user";
|
||||
|
||||
import { registerDiscourseImplicitInjections } from "discourse/lib/implicit-injections";
|
||||
|
||||
export default {
|
||||
after: "discourse-bootstrap",
|
||||
|
||||
|
@ -38,8 +36,6 @@ export default {
|
|||
|
||||
app.register("location:discourse-location", DiscourseLocation);
|
||||
|
||||
registerDiscourseImplicitInjections();
|
||||
|
||||
startTracking(this.topicTrackingState);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user