@module-federation/runtime 0.0.0-next-20240202024430 → 0.0.0-next-20240202083257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -263,7 +263,7 @@ let Module = class Module {
263
263
  remoteInfo: this.remoteInfo,
264
264
  origin: this.host
265
265
  });
266
- remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
266
+ await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
267
267
  await this.host.hooks.lifecycle.initContainer.emit(_extends$4({}, initContainerOptions, {
268
268
  remoteEntryExports
269
269
  }));
@@ -1402,7 +1402,7 @@ class FederationHost {
1402
1402
  const versions = scope[name];
1403
1403
  const activeVersion = versions[version];
1404
1404
  const activeVersionEager = Boolean(activeVersion && (activeVersion.eager || ((_activeVersion_shareConfig = activeVersion.shareConfig) == null ? void 0 : _activeVersion_shareConfig.eager)));
1405
- if (!activeVersion || !activeVersion.loading && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > activeVersion.from)) {
1405
+ if (!activeVersion || activeVersion.strategy !== 'loaded-first' && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > activeVersion.from)) {
1406
1406
  versions[version] = shared;
1407
1407
  }
1408
1408
  };
package/dist/index.esm.js CHANGED
@@ -261,7 +261,7 @@ let Module = class Module {
261
261
  remoteInfo: this.remoteInfo,
262
262
  origin: this.host
263
263
  });
264
- remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
264
+ await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
265
265
  await this.host.hooks.lifecycle.initContainer.emit(_extends$4({}, initContainerOptions, {
266
266
  remoteEntryExports
267
267
  }));
@@ -1400,7 +1400,7 @@ class FederationHost {
1400
1400
  const versions = scope[name];
1401
1401
  const activeVersion = versions[version];
1402
1402
  const activeVersionEager = Boolean(activeVersion && (activeVersion.eager || ((_activeVersion_shareConfig = activeVersion.shareConfig) == null ? void 0 : _activeVersion_shareConfig.eager)));
1403
- if (!activeVersion || !activeVersion.loading && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > activeVersion.from)) {
1403
+ if (!activeVersion || activeVersion.strategy !== 'loaded-first' && !activeVersion.loaded && (Boolean(!eager) !== !activeVersionEager ? eager : hostName > activeVersion.from)) {
1404
1404
  versions[version] = shared;
1405
1405
  }
1406
1406
  };
@@ -95,6 +95,6 @@ export type RemoteEntryInitOptions = {
95
95
  export type InitScope = Array<Record<string, never>>;
96
96
  export type RemoteEntryExports = {
97
97
  get: (id: string) => () => Promise<Module>;
98
- init: (shareScope: ShareScopeMap[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
98
+ init: (shareScope: ShareScopeMap[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void | Promise<void>;
99
99
  };
100
100
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.0.0-next-20240202024430",
3
+ "version": "0.0.0-next-20240202083257",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.esm.js",
@@ -45,6 +45,6 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.0.0-next-20240202024430"
48
+ "@module-federation/sdk": "0.0.0-next-20240202083257"
49
49
  }
50
50
  }