mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 21:03:29 +08:00
DEV: Ensure that Discourse global is available for widget init (#15862)
Under ember-cli, we rely on the `ember-export-application-global` addon to make `window.Discourse` available. This happens in an initializer. Previously this inititalizer would run after `auto-load-modules`, and so any widget/helper modules would not be able to access it. This commit sets some `after` parameters on the `auto-load-modules` and `inject-objects` initializers to ensure that `export-application-global` is run first.
This commit is contained in:
parent
ecc07fd8dc
commit
03b7d71827
@ -36,5 +36,6 @@ export function autoLoadModules(container, registry) {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "auto-load-modules",
|
name: "auto-load-modules",
|
||||||
|
after: "inject-objects",
|
||||||
initialize: (container) => autoLoadModules(container, container.registry),
|
initialize: (container) => autoLoadModules(container, container.registry),
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,7 @@ import deprecated from "discourse-common/lib/deprecated";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "inject-objects",
|
name: "inject-objects",
|
||||||
|
after: isLegacyEmber() ? null : "export-application-global",
|
||||||
initialize(container, app) {
|
initialize(container, app) {
|
||||||
// This is required for Ember CLI tests to work
|
// This is required for Ember CLI tests to work
|
||||||
setDefaultOwner(app.__container__);
|
setDefaultOwner(app.__container__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user