@module-federation/runtime 0.2.2 → 0.2.3

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
@@ -1983,7 +1983,7 @@ class FederationHost {
1983
1983
  // maybe will change, temporarily for internal use only
1984
1984
  initContainer: new AsyncWaterfallHook('initContainer')
1985
1985
  });
1986
- this.version = "0.2.2";
1986
+ this.version = "0.2.3";
1987
1987
  this.moduleCache = new Map();
1988
1988
  this.loaderHook = new PluginSystem({
1989
1989
  // FIXME: may not be suitable , not open to the public yet
@@ -1991,7 +1991,7 @@ class FederationHost {
1991
1991
  createScript: new SyncHook(),
1992
1992
  createLink: new SyncHook(),
1993
1993
  // only work for manifest , so not open to the public yet
1994
- fetch: new AsyncHook('fetch')
1994
+ fetch: new AsyncHook()
1995
1995
  });
1996
1996
  // TODO: Validate the details of the options
1997
1997
  // Initialize options with default values
package/dist/index.esm.js CHANGED
@@ -1981,7 +1981,7 @@ class FederationHost {
1981
1981
  // maybe will change, temporarily for internal use only
1982
1982
  initContainer: new AsyncWaterfallHook('initContainer')
1983
1983
  });
1984
- this.version = "0.2.2";
1984
+ this.version = "0.2.3";
1985
1985
  this.moduleCache = new Map();
1986
1986
  this.loaderHook = new PluginSystem({
1987
1987
  // FIXME: may not be suitable , not open to the public yet
@@ -1989,7 +1989,7 @@ class FederationHost {
1989
1989
  createScript: new SyncHook(),
1990
1990
  createLink: new SyncHook(),
1991
1991
  // only work for manifest , so not open to the public yet
1992
- fetch: new AsyncHook('fetch')
1992
+ fetch: new AsyncHook()
1993
1993
  });
1994
1994
  // TODO: Validate the details of the options
1995
1995
  // Initialize options with default values
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
package/dist/share.cjs.js CHANGED
@@ -190,7 +190,7 @@ function getGlobalFederationConstructor() {
190
190
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
191
191
  if (isDebug) {
192
192
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
193
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.2.2";
193
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.2.3";
194
194
  }
195
195
  }
196
196
  // eslint-disable-next-line @typescript-eslint/ban-types
package/dist/share.esm.js CHANGED
@@ -188,7 +188,7 @@ function getGlobalFederationConstructor() {
188
188
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
189
189
  if (isDebug) {
190
190
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
191
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.2.2";
191
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.2.3";
192
192
  }
193
193
  }
194
194
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { FederationHost } from './core';
3
2
  import { RemoteEntryExports, GlobalShareScopeMap, Remote, Optional } from './type';
4
3
  import { GlobalModuleInfo, ModuleInfo } from '@module-federation/sdk';
@@ -29,8 +28,8 @@ export declare function getInfoWithoutType<T extends object>(target: T, key: key
29
28
  key: string;
30
29
  };
31
30
  export declare const getGlobalSnapshot: () => GlobalModuleInfo;
32
- export declare const getTargetSnapshotInfoByModuleInfo: (moduleInfo: Optional<Remote, 'alias'>, snapshot: GlobalModuleInfo) => GlobalModuleInfo[string] | undefined;
33
- export declare const getGlobalSnapshotInfoByModuleInfo: (moduleInfo: Optional<Remote, 'alias'>) => GlobalModuleInfo[string] | undefined;
31
+ export declare const getTargetSnapshotInfoByModuleInfo: (moduleInfo: Optional<Remote, "alias">, snapshot: GlobalModuleInfo) => GlobalModuleInfo[string] | undefined;
32
+ export declare const getGlobalSnapshotInfoByModuleInfo: (moduleInfo: Optional<Remote, "alias">) => GlobalModuleInfo[string] | undefined;
34
33
  export declare const setGlobalSnapshotInfoByModuleInfo: (remoteInfo: Remote, moduleDetailInfo: GlobalModuleInfo[string]) => GlobalModuleInfo;
35
34
  export declare const addGlobalSnapshot: (moduleInfos: GlobalModuleInfo) => (() => void);
36
35
  export declare const getRemoteEntryExports: (name: string, globalName: string | undefined) => {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { resetFederationGlobalInfo, getGlobalFederationInstance, setGlobalFederationInstance, getGlobalFederationConstructor, setGlobalFederationConstructor, getInfoWithoutType, getGlobalSnapshot, getTargetSnapshotInfoByModuleInfo, getGlobalSnapshotInfoByModuleInfo, setGlobalSnapshotInfoByModuleInfo, addGlobalSnapshot, getRemoteEntryExports, registerGlobalPlugins, getGlobalHostPlugins, getPreloaded, setPreloaded, Global } from './global';
3
2
  import { getRegisteredShare, getGlobalShareScope } from './utils/share';
4
3
  interface IShareUtils {
@@ -22,10 +22,10 @@ export declare class SnapshotHandler {
22
22
  loadRemoteSnapshot: AsyncWaterfallHook<{
23
23
  options: Options;
24
24
  moduleInfo: Remote;
25
- manifestJson?: Manifest<import("@module-federation/sdk").BasicStatsMetaData, import("@module-federation/sdk").ManifestRemoteCommonInfo> | undefined;
26
- manifestUrl?: string | undefined;
25
+ manifestJson?: Manifest;
26
+ manifestUrl?: string;
27
27
  remoteSnapshot: ModuleInfo;
28
- from: 'global' | 'manifest';
28
+ from: "global" | "manifest";
29
29
  }>;
30
30
  }>;
31
31
  loaderHook: FederationHost['loaderHook'];
@@ -48,8 +48,8 @@ export declare class RemoteHandler {
48
48
  id: string;
49
49
  error: unknown;
50
50
  options?: any;
51
- from: 'build' | 'runtime';
52
- lifecycle: 'onLoad' | 'beforeRequest';
51
+ from: "build" | "runtime";
52
+ lifecycle: "onLoad" | "beforeRequest";
53
53
  origin: FederationHost;
54
54
  }], unknown>;
55
55
  beforePreloadRemote: AsyncHook<[{
@@ -10,8 +10,8 @@ export declare class SharedHandler {
10
10
  afterResolve: AsyncWaterfallHook<LoadRemoteMatch>;
11
11
  beforeLoadShare: AsyncWaterfallHook<{
12
12
  pkgName: string;
13
- shareInfo?: Shared | undefined;
14
- shared: Options['shared'];
13
+ shareInfo?: Shared;
14
+ shared: Options["shared"];
15
15
  origin: FederationHost;
16
16
  }>;
17
17
  loadShare: AsyncHook<[FederationHost, string, ShareInfos], false | void | Promise<false | void>>;
@@ -28,7 +28,7 @@ export declare class SharedHandler {
28
28
  options: Options;
29
29
  origin: FederationHost;
30
30
  scopeName: string;
31
- hostShareScopeMap?: ShareScopeMap | undefined;
31
+ hostShareScopeMap?: ShareScopeMap;
32
32
  }>;
33
33
  }>;
34
34
  constructor(host: FederationHost);
@@ -9,7 +9,7 @@ export declare function formatShareConfigs(globalOptions: Options, userOptions:
9
9
  shareInfos: ShareInfos;
10
10
  };
11
11
  export declare function versionLt(a: string, b: string): boolean;
12
- export declare const findVersion: (shareVersionMap: ShareScopeMap[string][string], cb?: ((prev: string, cur: string) => boolean) | undefined) => string;
12
+ export declare const findVersion: (shareVersionMap: ShareScopeMap[string][string], cb?: (prev: string, cur: string) => boolean) => string;
13
13
  export declare const isLoaded: (shared: Shared) => boolean;
14
14
  export declare function getRegisteredShare(localShareScopeMap: ShareScopeMap, pkgName: string, shareInfo: Shared, resolveShare: SyncWaterfallHook<{
15
15
  shareScopeMap: ShareScopeMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -45,6 +45,6 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.2.2"
48
+ "@module-federation/sdk": "0.2.3"
49
49
  }
50
50
  }