@module-federation/runtime 0.0.0-next-20240524225331 → 0.0.0-next-20240528083134
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/helpers.esm.js +1 -1
- package/dist/index.cjs.js +24 -11
- package/dist/index.esm.js +29 -17
- package/dist/share.cjs.js +23 -0
- package/dist/share.esm.js +23 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/plugins/snapshot/SnapshotHandler.d.ts +5 -1
- package/dist/src/remote/index.d.ts +4 -0
- package/dist/src/utils/tool.d.ts +6 -1
- package/package.json +2 -2
package/dist/helpers.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q 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, n as getInfoWithoutType, x as getGlobalSnapshot, M as getTargetSnapshotInfoByModuleInfo, t as getGlobalSnapshotInfoByModuleInfo, v as setGlobalSnapshotInfoByModuleInfo, u as addGlobalSnapshot, c as getRemoteEntryExports, J as registerGlobalPlugins, g as getGlobalHostPlugins, o as getPreloaded, p as setPreloaded } from './share.esm.js';
|
|
2
2
|
|
|
3
3
|
const ShareUtils = {
|
|
4
4
|
getRegisteredShare,
|
package/dist/index.cjs.js
CHANGED
|
@@ -142,7 +142,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
142
142
|
`);
|
|
143
143
|
return entryExports;
|
|
144
144
|
}).catch((e)=>{
|
|
145
|
-
|
|
145
|
+
throw e;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
return sdk.loadScript(entry, {
|
|
@@ -158,7 +158,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
158
158
|
`);
|
|
159
159
|
return entryExports;
|
|
160
160
|
}).catch((e)=>{
|
|
161
|
-
|
|
161
|
+
throw e;
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
@@ -638,13 +638,16 @@ function _extends$4() {
|
|
|
638
638
|
return _extends$4.apply(this, arguments);
|
|
639
639
|
}
|
|
640
640
|
function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
const remoteEntryInfo = share.getRemoteEntryInfoFromSnapshot(remoteSnapshot);
|
|
642
|
+
if (!remoteEntryInfo.url) {
|
|
643
|
+
share.error(`The attribute remoteEntry of ${remoteInfo.name} must not be undefined.`);
|
|
643
644
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
645
|
+
let entryUrl = sdk.getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
|
|
646
|
+
if (!share.isBrowserEnv() && !entryUrl.startsWith('http')) {
|
|
647
|
+
entryUrl = `https:${entryUrl}`;
|
|
648
|
+
}
|
|
649
|
+
remoteInfo.type = remoteEntryInfo.type;
|
|
650
|
+
remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
|
|
648
651
|
remoteInfo.entry = entryUrl;
|
|
649
652
|
remoteInfo.version = remoteSnapshot.version;
|
|
650
653
|
remoteInfo.buildVersion = remoteSnapshot.buildVersion;
|
|
@@ -769,7 +772,7 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
|
|
|
769
772
|
return;
|
|
770
773
|
}
|
|
771
774
|
}
|
|
772
|
-
const remoteEntryUrl = sdk.getResourceUrl(moduleInfoSnapshot,
|
|
775
|
+
const remoteEntryUrl = sdk.getResourceUrl(moduleInfoSnapshot, share.getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
|
|
773
776
|
if (remoteEntryUrl) {
|
|
774
777
|
entryAssets.push({
|
|
775
778
|
name: remoteInfo.name,
|
|
@@ -975,12 +978,13 @@ class SnapshotHandler {
|
|
|
975
978
|
// global snapshot includes manifest or module info includes manifest
|
|
976
979
|
if (globalRemoteSnapshot) {
|
|
977
980
|
if (sdk.isManifestProvider(globalRemoteSnapshot)) {
|
|
978
|
-
const
|
|
981
|
+
const remoteEntry = share.isBrowserEnv() ? globalRemoteSnapshot.remoteEntry : globalRemoteSnapshot.ssrRemoteEntry || globalRemoteSnapshot.remoteEntry || '';
|
|
982
|
+
const moduleSnapshot = await this.getManifestJson(remoteEntry, moduleInfo, {});
|
|
979
983
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
980
984
|
const globalSnapshotRes = share.setGlobalSnapshotInfoByModuleInfo(_extends$3({}, moduleInfo, {
|
|
981
985
|
// The global remote may be overridden
|
|
982
986
|
// Therefore, set the snapshot key to the global address of the actual request
|
|
983
|
-
entry:
|
|
987
|
+
entry: remoteEntry
|
|
984
988
|
}), moduleSnapshot);
|
|
985
989
|
return {
|
|
986
990
|
remoteSnapshot: moduleSnapshot,
|
|
@@ -1512,6 +1516,10 @@ class RemoteHandler {
|
|
|
1512
1516
|
moduleInstance: module,
|
|
1513
1517
|
origin: host
|
|
1514
1518
|
});
|
|
1519
|
+
this.idToRemoteMap[id] = {
|
|
1520
|
+
name: remote.name,
|
|
1521
|
+
expose
|
|
1522
|
+
};
|
|
1515
1523
|
if (typeof moduleWrapper === 'function') {
|
|
1516
1524
|
return moduleWrapper;
|
|
1517
1525
|
}
|
|
@@ -1758,6 +1766,7 @@ class RemoteHandler {
|
|
|
1758
1766
|
afterPreloadRemote: new AsyncHook()
|
|
1759
1767
|
});
|
|
1760
1768
|
this.host = host;
|
|
1769
|
+
this.idToRemoteMap = {};
|
|
1761
1770
|
}
|
|
1762
1771
|
}
|
|
1763
1772
|
|
|
@@ -1969,6 +1978,9 @@ function registerPlugins(...args) {
|
|
|
1969
1978
|
// eslint-disable-next-line prefer-spread
|
|
1970
1979
|
return FederationInstance.registerPlugins.apply(FederationInstance, args);
|
|
1971
1980
|
}
|
|
1981
|
+
function getInstance() {
|
|
1982
|
+
return FederationInstance;
|
|
1983
|
+
}
|
|
1972
1984
|
// Inject for debug
|
|
1973
1985
|
share.setGlobalFederationConstructor(FederationHost);
|
|
1974
1986
|
|
|
@@ -1982,6 +1994,7 @@ Object.defineProperty(exports, 'loadScriptNode', {
|
|
|
1982
1994
|
get: function () { return sdk.loadScriptNode; }
|
|
1983
1995
|
});
|
|
1984
1996
|
exports.FederationHost = FederationHost;
|
|
1997
|
+
exports.getInstance = getInstance;
|
|
1985
1998
|
exports.getRemoteEntry = getRemoteEntry;
|
|
1986
1999
|
exports.getRemoteInfo = getRemoteInfo;
|
|
1987
2000
|
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
|
|
2
|
-
export {
|
|
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 isBrowserEnv, n as getInfoWithoutType, o as getPreloaded, p as setPreloaded, q as getRegisteredShare, r as arrayOptions, t as getGlobalSnapshotInfoByModuleInfo, u as addGlobalSnapshot, 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
|
|
@@ -140,7 +140,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
140
140
|
`);
|
|
141
141
|
return entryExports;
|
|
142
142
|
}).catch((e)=>{
|
|
143
|
-
|
|
143
|
+
throw e;
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
return loadScript(entry, {
|
|
@@ -156,7 +156,7 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
|
|
|
156
156
|
`);
|
|
157
157
|
return entryExports;
|
|
158
158
|
}).catch((e)=>{
|
|
159
|
-
|
|
159
|
+
throw e;
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
function getRemoteEntryUniqueKey(remoteInfo) {
|
|
@@ -636,13 +636,16 @@ function _extends$4() {
|
|
|
636
636
|
return _extends$4.apply(this, arguments);
|
|
637
637
|
}
|
|
638
638
|
function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
639
|
-
|
|
640
|
-
|
|
639
|
+
const remoteEntryInfo = getRemoteEntryInfoFromSnapshot(remoteSnapshot);
|
|
640
|
+
if (!remoteEntryInfo.url) {
|
|
641
|
+
error(`The attribute remoteEntry of ${remoteInfo.name} must not be undefined.`);
|
|
641
642
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
643
|
+
let entryUrl = getResourceUrl(remoteSnapshot, remoteEntryInfo.url);
|
|
644
|
+
if (!isBrowserEnv() && !entryUrl.startsWith('http')) {
|
|
645
|
+
entryUrl = `https:${entryUrl}`;
|
|
646
|
+
}
|
|
647
|
+
remoteInfo.type = remoteEntryInfo.type;
|
|
648
|
+
remoteInfo.entryGlobalName = remoteEntryInfo.globalName;
|
|
646
649
|
remoteInfo.entry = entryUrl;
|
|
647
650
|
remoteInfo.version = remoteSnapshot.version;
|
|
648
651
|
remoteInfo.buildVersion = remoteSnapshot.buildVersion;
|
|
@@ -767,7 +770,7 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
|
|
|
767
770
|
return;
|
|
768
771
|
}
|
|
769
772
|
}
|
|
770
|
-
const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot,
|
|
773
|
+
const remoteEntryUrl = getResourceUrl(moduleInfoSnapshot, getRemoteEntryInfoFromSnapshot(moduleInfoSnapshot).url);
|
|
771
774
|
if (remoteEntryUrl) {
|
|
772
775
|
entryAssets.push({
|
|
773
776
|
name: remoteInfo.name,
|
|
@@ -973,12 +976,13 @@ class SnapshotHandler {
|
|
|
973
976
|
// global snapshot includes manifest or module info includes manifest
|
|
974
977
|
if (globalRemoteSnapshot) {
|
|
975
978
|
if (isManifestProvider(globalRemoteSnapshot)) {
|
|
976
|
-
const
|
|
979
|
+
const remoteEntry = isBrowserEnv() ? globalRemoteSnapshot.remoteEntry : globalRemoteSnapshot.ssrRemoteEntry || globalRemoteSnapshot.remoteEntry || '';
|
|
980
|
+
const moduleSnapshot = await this.getManifestJson(remoteEntry, moduleInfo, {});
|
|
977
981
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
978
982
|
const globalSnapshotRes = setGlobalSnapshotInfoByModuleInfo(_extends$3({}, moduleInfo, {
|
|
979
983
|
// The global remote may be overridden
|
|
980
984
|
// Therefore, set the snapshot key to the global address of the actual request
|
|
981
|
-
entry:
|
|
985
|
+
entry: remoteEntry
|
|
982
986
|
}), moduleSnapshot);
|
|
983
987
|
return {
|
|
984
988
|
remoteSnapshot: moduleSnapshot,
|
|
@@ -1510,6 +1514,10 @@ class RemoteHandler {
|
|
|
1510
1514
|
moduleInstance: module,
|
|
1511
1515
|
origin: host
|
|
1512
1516
|
});
|
|
1517
|
+
this.idToRemoteMap[id] = {
|
|
1518
|
+
name: remote.name,
|
|
1519
|
+
expose
|
|
1520
|
+
};
|
|
1513
1521
|
if (typeof moduleWrapper === 'function') {
|
|
1514
1522
|
return moduleWrapper;
|
|
1515
1523
|
}
|
|
@@ -1638,7 +1646,7 @@ class RemoteHandler {
|
|
|
1638
1646
|
}
|
|
1639
1647
|
// Set the remote entry to a complete path
|
|
1640
1648
|
if ('entry' in remote) {
|
|
1641
|
-
if (isBrowserEnv() && !remote.entry.startsWith('http')) {
|
|
1649
|
+
if (isBrowserEnv$1() && !remote.entry.startsWith('http')) {
|
|
1642
1650
|
remote.entry = new URL(remote.entry, window.location.origin).href;
|
|
1643
1651
|
}
|
|
1644
1652
|
}
|
|
@@ -1756,6 +1764,7 @@ class RemoteHandler {
|
|
|
1756
1764
|
afterPreloadRemote: new AsyncHook()
|
|
1757
1765
|
});
|
|
1758
1766
|
this.host = host;
|
|
1767
|
+
this.idToRemoteMap = {};
|
|
1759
1768
|
}
|
|
1760
1769
|
}
|
|
1761
1770
|
|
|
@@ -1899,7 +1908,7 @@ class FederationHost {
|
|
|
1899
1908
|
],
|
|
1900
1909
|
remotes: [],
|
|
1901
1910
|
shared: {},
|
|
1902
|
-
inBrowser: isBrowserEnv
|
|
1911
|
+
inBrowser: isBrowserEnv()
|
|
1903
1912
|
};
|
|
1904
1913
|
this.name = userOptions.name;
|
|
1905
1914
|
this.options = defaultOptions;
|
|
@@ -1967,7 +1976,10 @@ function registerPlugins(...args) {
|
|
|
1967
1976
|
// eslint-disable-next-line prefer-spread
|
|
1968
1977
|
return FederationInstance.registerPlugins.apply(FederationInstance, args);
|
|
1969
1978
|
}
|
|
1979
|
+
function getInstance() {
|
|
1980
|
+
return FederationInstance;
|
|
1981
|
+
}
|
|
1970
1982
|
// Inject for debug
|
|
1971
1983
|
setGlobalFederationConstructor(FederationHost);
|
|
1972
1984
|
|
|
1973
|
-
export { FederationHost, getRemoteEntry, getRemoteInfo, init, loadRemote, loadShare, loadShareSync, preloadRemote, registerPlugins, registerRemotes };
|
|
1985
|
+
export { FederationHost, getInstance, getRemoteEntry, getRemoteInfo, init, loadRemote, loadShare, loadShareSync, preloadRemote, registerPlugins, registerRemotes };
|
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) {
|
|
@@ -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) {
|
|
@@ -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 {
|
|
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, isBrowserEnv as m, getInfoWithoutType as n, getPreloaded as o, setPreloaded as p, getRegisteredShare as q, arrayOptions as r, safeToString as s, getGlobalSnapshotInfoByModuleInfo as t, addGlobalSnapshot as u, setGlobalSnapshotInfoByModuleInfo as v, warn as w, getGlobalSnapshot as x, formatShareConfigs as y, getTargetSharedOptions as z };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,10 @@ export interface LoadRemoteMatch {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class RemoteHandler {
|
|
17
17
|
host: FederationHost;
|
|
18
|
+
idToRemoteMap: Record<string, {
|
|
19
|
+
name: string;
|
|
20
|
+
expose: string;
|
|
21
|
+
}>;
|
|
18
22
|
hooks: PluginSystem<{
|
|
19
23
|
beforeRequest: AsyncWaterfallHook<{
|
|
20
24
|
id: string;
|
package/dist/src/utils/tool.d.ts
CHANGED
|
@@ -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-
|
|
3
|
+
"version": "0.0.0-next-20240528083134",
|
|
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-
|
|
48
|
+
"@module-federation/sdk": "0.0.0-next-20240528083134"
|
|
49
49
|
}
|
|
50
50
|
}
|