@module-federation/runtime 0.0.0-next-20240514062402 → 0.0.0-next-20240515062211

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.
@@ -1,4 +1,4 @@
1
- import { o as getRegisteredShare, y as getGlobalShareScope, G as Global, J as nativeGlobal, K as resetFederationGlobalInfo, E as getGlobalFederationInstance, H as setGlobalFederationInstance, F as getGlobalFederationConstructor, C as setGlobalFederationConstructor, l as getInfoWithoutType, u as getGlobalSnapshot, L as getTargetSnapshotInfoByModuleInfo, q as getGlobalSnapshotInfoByModuleInfo, t as setGlobalSnapshotInfoByModuleInfo, r as addGlobalSnapshot, c as getRemoteEntryExports, I as registerGlobalPlugins, g as getGlobalHostPlugins, m as getPreloaded, n as setPreloaded } from './share.esm.js';
1
+ import { p as getRegisteredShare, A as getGlobalShareScope, G as Global, K as nativeGlobal, L as resetFederationGlobalInfo, F as getGlobalFederationInstance, I as setGlobalFederationInstance, H as getGlobalFederationConstructor, E as setGlobalFederationConstructor, m as getInfoWithoutType, x as getGlobalSnapshot, M as getTargetSnapshotInfoByModuleInfo, r as getGlobalSnapshotInfoByModuleInfo, v as setGlobalSnapshotInfoByModuleInfo, t as addGlobalSnapshot, c as getRemoteEntryExports, J as registerGlobalPlugins, g as getGlobalHostPlugins, n as getPreloaded, o as setPreloaded } from './share.esm.js';
2
2
 
3
3
  const ShareUtils = {
4
4
  getRegisteredShare,
package/dist/index.cjs.js CHANGED
@@ -618,13 +618,13 @@ function _extends$4() {
618
618
  return _extends$4.apply(this, arguments);
619
619
  }
620
620
  function assignRemoteInfo(remoteInfo, remoteSnapshot) {
621
- if (!('remoteEntry' in remoteSnapshot) || !remoteSnapshot.remoteEntry) {
622
- share.error(`The attribute remoteEntry of ${name} must not be undefined.`);
621
+ const remoteEntryInfo = share.getRemoteEntryInfoFromSnapshot(remoteSnapshot);
622
+ if (!remoteEntryInfo.url) {
623
+ share.error(`The attribute remoteEntry of ${remoteInfo.name} must not be undefined.`);
623
624
  }
624
- const { remoteEntry } = remoteSnapshot;
625
- const entryUrl = sdk.getResourceUrl(remoteSnapshot, remoteEntry);
626
- remoteInfo.type = remoteSnapshot.remoteEntryType;
627
- remoteInfo.entryGlobalName = remoteSnapshot.globalName;
625
+ const entryUrl = sdk.getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
626
+ remoteInfo.type = remoteEntryInfo.type;
627
+ remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
628
628
  remoteInfo.entry = entryUrl;
629
629
  remoteInfo.version = remoteSnapshot.version;
630
630
  remoteInfo.buildVersion = remoteSnapshot.buildVersion;
@@ -749,7 +749,7 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
749
749
  return;
750
750
  }
751
751
  }
752
- const remoteEntryUrl = sdk.getResourceUrl(moduleInfoSnapshot, 'remoteEntry' in moduleInfoSnapshot ? moduleInfoSnapshot.remoteEntry : '');
752
+ const remoteEntryUrl = sdk.getResourceUrl(moduleInfoSnapshot, share.getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
753
753
  if (remoteEntryUrl) {
754
754
  entryAssets.push({
755
755
  name: remoteInfo.name,
@@ -955,12 +955,13 @@ class SnapshotHandler {
955
955
  // global snapshot includes manifest or module info includes manifest
956
956
  if (globalRemoteSnapshot) {
957
957
  if (sdk.isManifestProvider(globalRemoteSnapshot)) {
958
- const moduleSnapshot = await this.getManifestJson(globalRemoteSnapshot.remoteEntry, moduleInfo, {});
958
+ const remoteEntry = share.isBrowserEnv() ? globalRemoteSnapshot.remoteEntry : globalRemoteSnapshot.ssrRemoteEntry || '';
959
+ const moduleSnapshot = await this.getManifestJson(remoteEntry, moduleInfo, {});
959
960
  // eslint-disable-next-line @typescript-eslint/no-shadow
960
961
  const globalSnapshotRes = share.setGlobalSnapshotInfoByModuleInfo(_extends$3({}, moduleInfo, {
961
962
  // The global remote may be overridden
962
963
  // Therefore, set the snapshot key to the global address of the actual request
963
- entry: globalRemoteSnapshot.remoteEntry
964
+ entry: remoteEntry
964
965
  }), moduleSnapshot);
965
966
  return {
966
967
  remoteSnapshot: moduleSnapshot,
@@ -1492,6 +1493,7 @@ class RemoteHandler {
1492
1493
  moduleInstance: module,
1493
1494
  origin: host
1494
1495
  });
1496
+ this.idToModuleNameMap[id] = remote.name;
1495
1497
  if (typeof moduleWrapper === 'function') {
1496
1498
  return moduleWrapper;
1497
1499
  }
@@ -1738,6 +1740,7 @@ class RemoteHandler {
1738
1740
  afterPreloadRemote: new AsyncHook()
1739
1741
  });
1740
1742
  this.host = host;
1743
+ this.idToModuleNameMap = {};
1741
1744
  }
1742
1745
  }
1743
1746
 
@@ -1860,7 +1863,7 @@ class FederationHost {
1860
1863
  // maybe will change, temporarily for internal use only
1861
1864
  initContainer: new AsyncWaterfallHook('initContainer')
1862
1865
  });
1863
- this.version = "0.1.12";
1866
+ this.version = "0.1.13";
1864
1867
  this.moduleCache = new Map();
1865
1868
  this.loaderHook = new PluginSystem({
1866
1869
  // FIXME: may not be suitable , not open to the public yet
@@ -1949,6 +1952,9 @@ function registerPlugins(...args) {
1949
1952
  // eslint-disable-next-line prefer-spread
1950
1953
  return FederationInstance.registerPlugins.apply(FederationInstance, args);
1951
1954
  }
1955
+ function getInstance() {
1956
+ return FederationInstance;
1957
+ }
1952
1958
  // Inject for debug
1953
1959
  share.setGlobalFederationConstructor(FederationHost);
1954
1960
 
@@ -1962,6 +1968,7 @@ Object.defineProperty(exports, 'loadScriptNode', {
1962
1968
  get: function () { return sdk.loadScriptNode; }
1963
1969
  });
1964
1970
  exports.FederationHost = FederationHost;
1971
+ exports.getInstance = getInstance;
1965
1972
  exports.getRemoteEntry = getRemoteEntry;
1966
1973
  exports.getRemoteInfo = getRemoteInfo;
1967
1974
  exports.init = init;
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- import { g as getGlobalHostPlugins, a as globalLoading, D as DEFAULT_REMOTE_TYPE, b as DEFAULT_SCOPE, c as getRemoteEntryExports, d as assert, s as safeToString, e as getFMId, i as isObject, f as error, w as warn, h as isPlainObject, j as isRemoteInfoWithEntry, k as isPureRemoteEntry, l as getInfoWithoutType, m as getPreloaded, n as setPreloaded, o as getRegisteredShare, p as arrayOptions, q as getGlobalSnapshotInfoByModuleInfo, r as addGlobalSnapshot, t as setGlobalSnapshotInfoByModuleInfo, u as getGlobalSnapshot, G as Global, v as formatShareConfigs, x as getTargetSharedOptions, y as getGlobalShareScope, z as addUniqueItem, A as getBuilderId, B as isBrowserEnv$1, C as setGlobalFederationConstructor, E as getGlobalFederationInstance, F as getGlobalFederationConstructor, H as setGlobalFederationInstance } from './share.esm.js';
2
- export { I as registerGlobalPlugins } from './share.esm.js';
3
- import { loadScriptNode, loadScript, composeKeyWithSeparator, createLink, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1, isBrowserEnv } from '@module-federation/sdk';
1
+ import { g as getGlobalHostPlugins, a as globalLoading, D as DEFAULT_REMOTE_TYPE, b as DEFAULT_SCOPE, c as getRemoteEntryExports, d as assert, s as safeToString, e as getFMId, i as isObject, f as error, w as warn, h as isPlainObject, j as isRemoteInfoWithEntry, k as isPureRemoteEntry, l as getRemoteEntryInfoFromSnapshot, m as getInfoWithoutType, n as getPreloaded, o as setPreloaded, p as getRegisteredShare, q as arrayOptions, r as getGlobalSnapshotInfoByModuleInfo, t as addGlobalSnapshot, u as isBrowserEnv, v as setGlobalSnapshotInfoByModuleInfo, x as getGlobalSnapshot, G as Global, y as formatShareConfigs, z as getTargetSharedOptions, A as getGlobalShareScope, B as addUniqueItem, C as getBuilderId, E as setGlobalFederationConstructor, F as getGlobalFederationInstance, H as getGlobalFederationConstructor, I as setGlobalFederationInstance } from './share.esm.js';
2
+ export { J as registerGlobalPlugins } from './share.esm.js';
3
+ import { loadScriptNode, loadScript, composeKeyWithSeparator, createLink, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1, isBrowserEnv as isBrowserEnv$1 } from '@module-federation/sdk';
4
4
  export { loadScript, loadScriptNode } from '@module-federation/sdk';
5
5
 
6
6
  // Function to match a remote with its name and expose
@@ -616,13 +616,13 @@ function _extends$4() {
616
616
  return _extends$4.apply(this, arguments);
617
617
  }
618
618
  function assignRemoteInfo(remoteInfo, remoteSnapshot) {
619
- if (!('remoteEntry' in remoteSnapshot) || !remoteSnapshot.remoteEntry) {
620
- error(`The attribute remoteEntry of ${name} must not be undefined.`);
619
+ const remoteEntryInfo = getRemoteEntryInfoFromSnapshot(remoteSnapshot);
620
+ if (!remoteEntryInfo.url) {
621
+ error(`The attribute remoteEntry of ${remoteInfo.name} must not be undefined.`);
621
622
  }
622
- const { remoteEntry } = remoteSnapshot;
623
- const entryUrl = getResourceUrl(remoteSnapshot, remoteEntry);
624
- remoteInfo.type = remoteSnapshot.remoteEntryType;
625
- remoteInfo.entryGlobalName = remoteSnapshot.globalName;
623
+ const entryUrl = getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
624
+ remoteInfo.type = remoteEntryInfo.type;
625
+ remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
626
626
  remoteInfo.entry = entryUrl;
627
627
  remoteInfo.version = remoteSnapshot.version;
628
628
  remoteInfo.buildVersion = remoteSnapshot.buildVersion;
@@ -747,7 +747,7 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
747
747
  return;
748
748
  }
749
749
  }
750
- const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot, 'remoteEntry' in moduleInfoSnapshot ? moduleInfoSnapshot.remoteEntry : '');
750
+ const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot, getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
751
751
  if (remoteEntryUrl) {
752
752
  entryAssets.push({
753
753
  name: remoteInfo.name,
@@ -953,12 +953,13 @@ class SnapshotHandler {
953
953
  // global snapshot includes manifest or module info includes manifest
954
954
  if (globalRemoteSnapshot) {
955
955
  if (isManifestProvider(globalRemoteSnapshot)) {
956
- const moduleSnapshot = await this.getManifestJson(globalRemoteSnapshot.remoteEntry, moduleInfo, {});
956
+ const remoteEntry = isBrowserEnv() ? globalRemoteSnapshot.remoteEntry : globalRemoteSnapshot.ssrRemoteEntry || '';
957
+ const moduleSnapshot = await this.getManifestJson(remoteEntry, moduleInfo, {});
957
958
  // eslint-disable-next-line @typescript-eslint/no-shadow
958
959
  const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo(_extends$3({}, moduleInfo, {
959
960
  // The global remote may be overridden
960
961
  // Therefore, set the snapshot key to the global address of the actual request
961
- entry: globalRemoteSnapshot.remoteEntry
962
+ entry: remoteEntry
962
963
  }), moduleSnapshot);
963
964
  return {
964
965
  remoteSnapshot: moduleSnapshot,
@@ -1490,6 +1491,7 @@ class RemoteHandler {
1490
1491
  moduleInstance: module,
1491
1492
  origin: host
1492
1493
  });
1494
+ this.idToModuleNameMap[id] = remote.name;
1493
1495
  if (typeof moduleWrapper === 'function') {
1494
1496
  return moduleWrapper;
1495
1497
  }
@@ -1618,7 +1620,7 @@ class RemoteHandler {
1618
1620
  }
1619
1621
  // Set the remote entry to a complete path
1620
1622
  if ('entry' in remote) {
1621
- if (isBrowserEnv() && !remote.entry.startsWith('http')) {
1623
+ if (isBrowserEnv$1() && !remote.entry.startsWith('http')) {
1622
1624
  remote.entry = new URL(remote.entry, window.location.origin).href;
1623
1625
  }
1624
1626
  }
@@ -1736,6 +1738,7 @@ class RemoteHandler {
1736
1738
  afterPreloadRemote: new AsyncHook()
1737
1739
  });
1738
1740
  this.host = host;
1741
+ this.idToModuleNameMap = {};
1739
1742
  }
1740
1743
  }
1741
1744
 
@@ -1858,7 +1861,7 @@ class FederationHost {
1858
1861
  // maybe will change, temporarily for internal use only
1859
1862
  initContainer: new AsyncWaterfallHook('initContainer')
1860
1863
  });
1861
- this.version = "0.1.12";
1864
+ this.version = "0.1.13";
1862
1865
  this.moduleCache = new Map();
1863
1866
  this.loaderHook = new PluginSystem({
1864
1867
  // FIXME: may not be suitable , not open to the public yet
@@ -1879,7 +1882,7 @@ class FederationHost {
1879
1882
  ],
1880
1883
  remotes: [],
1881
1884
  shared: {},
1882
- inBrowser: isBrowserEnv$1()
1885
+ inBrowser: isBrowserEnv()
1883
1886
  };
1884
1887
  this.name = userOptions.name;
1885
1888
  this.options = defaultOptions;
@@ -1947,7 +1950,10 @@ function registerPlugins(...args) {
1947
1950
  // eslint-disable-next-line prefer-spread
1948
1951
  return FederationInstance.registerPlugins.apply(FederationInstance, args);
1949
1952
  }
1953
+ function getInstance() {
1954
+ return FederationInstance;
1955
+ }
1950
1956
  // Inject for debug
1951
1957
  setGlobalFederationConstructor(FederationHost);
1952
1958
 
1953
- export { FederationHost, getRemoteEntry, getRemoteInfo, init, loadRemote, loadShare, loadShareSync, preloadRemote, registerPlugins, registerRemotes };
1959
+ export { FederationHost, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadShare, loadShareSync, preloadRemote, registerPlugins, registerRemotes };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
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
@@ -76,6 +76,28 @@ function arrayOptions(options) {
76
76
  options
77
77
  ];
78
78
  }
79
+ function getRemoteEntryInfoFromSnapshot(snapshot) {
80
+ const defaultRemoteEntryInfo = {
81
+ url: '',
82
+ type: 'global',
83
+ globalName: ''
84
+ };
85
+ if (isBrowserEnv()) {
86
+ return 'remoteEntry' in snapshot ? {
87
+ url: snapshot.remoteEntry,
88
+ type: snapshot.remoteEntryType,
89
+ globalName: snapshot.globalName
90
+ } : defaultRemoteEntryInfo;
91
+ }
92
+ if ('ssrRemoteEntry' in snapshot) {
93
+ return {
94
+ url: snapshot.ssrRemoteEntry || defaultRemoteEntryInfo.url,
95
+ type: snapshot.ssrRemoteEntryType || defaultRemoteEntryInfo.type,
96
+ globalName: snapshot.globalName
97
+ };
98
+ }
99
+ return defaultRemoteEntryInfo;
100
+ }
79
101
 
80
102
  function _extends$1() {
81
103
  _extends$1 = Object.assign || function(target) {
@@ -190,7 +212,7 @@ function getGlobalFederationConstructor() {
190
212
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
191
213
  if (isDebug) {
192
214
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
193
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.12";
215
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.13";
194
216
  }
195
217
  }
196
218
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -893,6 +915,7 @@ exports.getInfoWithoutType = getInfoWithoutType;
893
915
  exports.getPreloaded = getPreloaded;
894
916
  exports.getRegisteredShare = getRegisteredShare;
895
917
  exports.getRemoteEntryExports = getRemoteEntryExports;
918
+ exports.getRemoteEntryInfoFromSnapshot = getRemoteEntryInfoFromSnapshot;
896
919
  exports.getTargetSharedOptions = getTargetSharedOptions;
897
920
  exports.getTargetSnapshotInfoByModuleInfo = getTargetSnapshotInfoByModuleInfo;
898
921
  exports.globalLoading = globalLoading;
package/dist/share.esm.js CHANGED
@@ -74,6 +74,28 @@ function arrayOptions(options) {
74
74
  options
75
75
  ];
76
76
  }
77
+ function getRemoteEntryInfoFromSnapshot(snapshot) {
78
+ const defaultRemoteEntryInfo = {
79
+ url: '',
80
+ type: 'global',
81
+ globalName: ''
82
+ };
83
+ if (isBrowserEnv()) {
84
+ return 'remoteEntry' in snapshot ? {
85
+ url: snapshot.remoteEntry,
86
+ type: snapshot.remoteEntryType,
87
+ globalName: snapshot.globalName
88
+ } : defaultRemoteEntryInfo;
89
+ }
90
+ if ('ssrRemoteEntry' in snapshot) {
91
+ return {
92
+ url: snapshot.ssrRemoteEntry || defaultRemoteEntryInfo.url,
93
+ type: snapshot.ssrRemoteEntryType || defaultRemoteEntryInfo.type,
94
+ globalName: snapshot.globalName
95
+ };
96
+ }
97
+ return defaultRemoteEntryInfo;
98
+ }
77
99
 
78
100
  function _extends$1() {
79
101
  _extends$1 = Object.assign || function(target) {
@@ -188,7 +210,7 @@ function getGlobalFederationConstructor() {
188
210
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
189
211
  if (isDebug) {
190
212
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
191
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.12";
213
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.13";
192
214
  }
193
215
  }
194
216
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -870,4 +892,4 @@ function getTargetSharedOptions(options) {
870
892
  return Object.assign({}, resolver(shareInfos[pkgName]), extraOptions == null ? void 0 : extraOptions.customShareInfo);
871
893
  }
872
894
 
873
- export { getBuilderId as A, isBrowserEnv as B, setGlobalFederationConstructor as C, DEFAULT_REMOTE_TYPE as D, getGlobalFederationInstance as E, getGlobalFederationConstructor as F, Global as G, setGlobalFederationInstance as H, registerGlobalPlugins as I, nativeGlobal as J, resetFederationGlobalInfo as K, getTargetSnapshotInfoByModuleInfo as L, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, getInfoWithoutType as l, getPreloaded as m, setPreloaded as n, getRegisteredShare as o, arrayOptions as p, getGlobalSnapshotInfoByModuleInfo as q, addGlobalSnapshot as r, safeToString as s, setGlobalSnapshotInfoByModuleInfo as t, getGlobalSnapshot as u, formatShareConfigs as v, warn as w, getTargetSharedOptions as x, getGlobalShareScope as y, addUniqueItem as z };
895
+ export { getGlobalShareScope as A, addUniqueItem as B, getBuilderId as C, DEFAULT_REMOTE_TYPE as D, setGlobalFederationConstructor as E, getGlobalFederationInstance as F, Global as G, getGlobalFederationConstructor as H, setGlobalFederationInstance as I, registerGlobalPlugins as J, nativeGlobal as K, resetFederationGlobalInfo as L, getTargetSnapshotInfoByModuleInfo as M, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, getRemoteEntryInfoFromSnapshot as l, getInfoWithoutType as m, getPreloaded as n, setPreloaded as o, getRegisteredShare as p, arrayOptions as q, getGlobalSnapshotInfoByModuleInfo as r, safeToString as s, addGlobalSnapshot as t, isBrowserEnv as u, setGlobalSnapshotInfoByModuleInfo as v, warn as w, getGlobalSnapshot as x, formatShareConfigs as y, getTargetSharedOptions as z };
@@ -13,3 +13,4 @@ export declare function loadShareSync<T>(...args: Parameters<FederationHost['loa
13
13
  export declare function preloadRemote(...args: Parameters<FederationHost['preloadRemote']>): ReturnType<FederationHost['preloadRemote']>;
14
14
  export declare function registerRemotes(...args: Parameters<FederationHost['registerRemotes']>): ReturnType<FederationHost['registerRemotes']>;
15
15
  export declare function registerPlugins(...args: Parameters<FederationHost['registerPlugins']>): ReturnType<FederationHost['registerRemotes']>;
16
+ export declare function getInstance(): FederationHost | null;
@@ -39,6 +39,10 @@ export declare class SnapshotHandler {
39
39
  remoteSnapshot: ModuleInfo;
40
40
  globalSnapshot: GlobalModuleInfo;
41
41
  }> | never;
42
- private getGlobalRemoteInfo;
42
+ getGlobalRemoteInfo(moduleInfo: Remote): {
43
+ hostGlobalSnapshot: ModuleInfo | undefined;
44
+ globalSnapshot: ReturnType<typeof getGlobalSnapshot>;
45
+ remoteSnapshot: GlobalModuleInfo[string] | undefined;
46
+ };
43
47
  private getManifestJson;
44
48
  }
@@ -15,6 +15,7 @@ export interface LoadRemoteMatch {
15
15
  }
16
16
  export declare class RemoteHandler {
17
17
  host: FederationHost;
18
+ idToModuleNameMap: Record<string, string>;
18
19
  hooks: PluginSystem<{
19
20
  beforeRequest: AsyncWaterfallHook<{
20
21
  id: string;
@@ -1,4 +1,4 @@
1
- import type { RemoteWithEntry } from '@module-federation/sdk';
1
+ import type { RemoteWithEntry, ModuleInfo, RemoteEntryType } from '@module-federation/sdk';
2
2
  import { Remote, RemoteInfoOptionalVersion } from '../type';
3
3
  export declare function addUniqueItem(arr: Array<string>, item: string): Array<string>;
4
4
  export declare function getFMId(remoteInfo: RemoteInfoOptionalVersion | RemoteWithEntry): string;
@@ -11,3 +11,8 @@ export declare const objectToString: () => string;
11
11
  export declare function isPlainObject(val: any): val is object;
12
12
  export declare function isStaticResourcesEqual(url1: string, url2: string): boolean;
13
13
  export declare function arrayOptions<T>(options: T | Array<T>): Array<T>;
14
+ export declare function getRemoteEntryInfoFromSnapshot(snapshot: ModuleInfo): {
15
+ url: string;
16
+ type: RemoteEntryType;
17
+ globalName: string;
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.0.0-next-20240514062402",
3
+ "version": "0.0.0-next-20240515062211",
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.0.0-next-20240514062402"
48
+ "@module-federation/sdk": "0.0.0-next-20240515062211"
49
49
  }
50
50
  }