Change module API to be an instance getter (#31025)
* Change module API to be an instance getter Helps with circular dependencies by not instantating the module API on the initial evaluation of the files. * Add basic test * add another test
This commit is contained in:
@@ -25,7 +25,7 @@ import ElectronPlatform from "./platform/ElectronPlatform";
|
||||
import PWAPlatform from "./platform/PWAPlatform";
|
||||
import WebPlatform from "./platform/WebPlatform";
|
||||
import { initRageshake, initRageshakeStore } from "./rageshakesetup";
|
||||
import ModuleApi from "../modules/Api.ts";
|
||||
import { ModuleApi } from "../modules/Api.ts";
|
||||
|
||||
export const rageshakePromise = initRageshake();
|
||||
|
||||
@@ -145,7 +145,7 @@ export async function loadPlugins(): Promise<void> {
|
||||
|
||||
const modules = SdkConfig.get("modules");
|
||||
if (!modules?.length) return;
|
||||
const moduleLoader = new ModuleLoader(ModuleApi);
|
||||
const moduleLoader = new ModuleLoader(ModuleApi.instance);
|
||||
window.mxModuleLoader = moduleLoader;
|
||||
for (const src of modules) {
|
||||
// We need to instruct webpack to not mangle this import as it is not available at compile time
|
||||
|
||||
Reference in New Issue
Block a user