@module-federation/runtime 0.0.0-next-20241114041727 → 0.0.0-next-20241114065146
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/embedded.cjs.js +0 -3
- package/dist/embedded.esm.mjs +0 -3
- package/dist/index.cjs.js +16 -31
- package/dist/index.esm.mjs +17 -32
- package/dist/share.cjs.js +1 -16
- package/dist/share.esm.mjs +2 -16
- package/dist/src/core.d.ts +0 -6
- package/dist/src/embedded.d.ts +0 -6
- package/dist/src/plugins/snapshot/SnapshotHandler.d.ts +0 -5
- package/dist/src/type/config.d.ts +1 -1
- package/dist/src/type/plugin.d.ts +1 -5
- package/dist/src/utils/plugin.d.ts +1 -1
- package/dist/src/utils/tool.d.ts +0 -1
- package/package.json +3 -3
package/dist/embedded.cjs.js
CHANGED
package/dist/embedded.esm.mjs
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -333,9 +333,7 @@ let Module = class Module {
|
|
|
333
333
|
moduleFactory = await remoteEntryExports.get(expose);
|
|
334
334
|
}
|
|
335
335
|
share.assert(moduleFactory, `${share.getFMId(this.remoteInfo)} remote don't export ${expose}.`);
|
|
336
|
-
|
|
337
|
-
const symbolName = share.processModuleAlias(this.remoteInfo.name, expose);
|
|
338
|
-
const wrapModuleFactory = this.wraperFactory(moduleFactory, symbolName);
|
|
336
|
+
const wrapModuleFactory = this.wraperFactory(moduleFactory, id);
|
|
339
337
|
if (!loadFactory) {
|
|
340
338
|
return wrapModuleFactory;
|
|
341
339
|
}
|
|
@@ -1073,8 +1071,6 @@ class SnapshotHandler {
|
|
|
1073
1071
|
remoteSnapshot,
|
|
1074
1072
|
globalSnapshot
|
|
1075
1073
|
});
|
|
1076
|
-
let mSnapshot;
|
|
1077
|
-
let gSnapshot;
|
|
1078
1074
|
// global snapshot includes manifest or module info includes manifest
|
|
1079
1075
|
if (globalRemoteSnapshot) {
|
|
1080
1076
|
if (sdk.isManifestProvider(globalRemoteSnapshot)) {
|
|
@@ -1086,8 +1082,10 @@ class SnapshotHandler {
|
|
|
1086
1082
|
// Therefore, set the snapshot key to the global address of the actual request
|
|
1087
1083
|
entry: remoteEntry
|
|
1088
1084
|
}), moduleSnapshot);
|
|
1089
|
-
|
|
1090
|
-
|
|
1085
|
+
return {
|
|
1086
|
+
remoteSnapshot: moduleSnapshot,
|
|
1087
|
+
globalSnapshot: globalSnapshotRes
|
|
1088
|
+
};
|
|
1091
1089
|
} else {
|
|
1092
1090
|
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1093
1091
|
options: this.HostInstance.options,
|
|
@@ -1095,8 +1093,10 @@ class SnapshotHandler {
|
|
|
1095
1093
|
remoteSnapshot: globalRemoteSnapshot,
|
|
1096
1094
|
from: 'global'
|
|
1097
1095
|
});
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
return {
|
|
1097
|
+
remoteSnapshot: remoteSnapshotRes,
|
|
1098
|
+
globalSnapshot: globalSnapshotRes
|
|
1099
|
+
};
|
|
1100
1100
|
}
|
|
1101
1101
|
} else {
|
|
1102
1102
|
if (share.isRemoteInfoWithEntry(moduleInfo)) {
|
|
@@ -1110,8 +1110,10 @@ class SnapshotHandler {
|
|
|
1110
1110
|
remoteSnapshot: moduleSnapshot,
|
|
1111
1111
|
from: 'global'
|
|
1112
1112
|
});
|
|
1113
|
-
|
|
1114
|
-
|
|
1113
|
+
return {
|
|
1114
|
+
remoteSnapshot: remoteSnapshotRes,
|
|
1115
|
+
globalSnapshot: globalSnapshotRes
|
|
1116
|
+
};
|
|
1115
1117
|
} else {
|
|
1116
1118
|
share.error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_007, errorCodes.runtimeDescMap, {
|
|
1117
1119
|
hostName: moduleInfo.name,
|
|
@@ -1120,15 +1122,6 @@ class SnapshotHandler {
|
|
|
1120
1122
|
}));
|
|
1121
1123
|
}
|
|
1122
1124
|
}
|
|
1123
|
-
await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1124
|
-
options,
|
|
1125
|
-
moduleInfo,
|
|
1126
|
-
remoteSnapshot: mSnapshot
|
|
1127
|
-
});
|
|
1128
|
-
return {
|
|
1129
|
-
remoteSnapshot: mSnapshot,
|
|
1130
|
-
globalSnapshot: gSnapshot
|
|
1131
|
-
};
|
|
1132
1125
|
}
|
|
1133
1126
|
getGlobalRemoteInfo(moduleInfo) {
|
|
1134
1127
|
return getGlobalRemoteInfo(moduleInfo, this.HostInstance);
|
|
@@ -1182,8 +1175,7 @@ class SnapshotHandler {
|
|
|
1182
1175
|
this.hooks = new PluginSystem({
|
|
1183
1176
|
beforeLoadRemoteSnapshot: new AsyncHook('beforeLoadRemoteSnapshot'),
|
|
1184
1177
|
loadSnapshot: new AsyncWaterfallHook('loadGlobalSnapshot'),
|
|
1185
|
-
loadRemoteSnapshot: new AsyncWaterfallHook('loadRemoteSnapshot')
|
|
1186
|
-
afterLoadSnapshot: new AsyncWaterfallHook('afterLoadSnapshot')
|
|
1178
|
+
loadRemoteSnapshot: new AsyncWaterfallHook('loadRemoteSnapshot')
|
|
1187
1179
|
});
|
|
1188
1180
|
this.manifestLoading = share.Global.__FEDERATION__.__MANIFEST_LOADING__;
|
|
1189
1181
|
this.HostInstance = HostInstance;
|
|
@@ -1984,8 +1976,7 @@ class FederationHost {
|
|
|
1984
1976
|
this.remoteHandler.hooks,
|
|
1985
1977
|
this.sharedHandler.hooks,
|
|
1986
1978
|
this.snapshotHandler.hooks,
|
|
1987
|
-
this.loaderHook
|
|
1988
|
-
this.bridgeHook
|
|
1979
|
+
this.loaderHook
|
|
1989
1980
|
]);
|
|
1990
1981
|
// Merge plugin
|
|
1991
1982
|
this.options.plugins = this.options.plugins.reduce((res, plugin)=>{
|
|
@@ -2008,7 +1999,7 @@ class FederationHost {
|
|
|
2008
1999
|
// maybe will change, temporarily for internal use only
|
|
2009
2000
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
2010
2001
|
});
|
|
2011
|
-
this.version = "0.7.
|
|
2002
|
+
this.version = "0.7.2";
|
|
2012
2003
|
this.moduleCache = new Map();
|
|
2013
2004
|
this.loaderHook = new PluginSystem({
|
|
2014
2005
|
// FIXME: may not be suitable , not open to the public yet
|
|
@@ -2019,12 +2010,6 @@ class FederationHost {
|
|
|
2019
2010
|
fetch: new AsyncHook(),
|
|
2020
2011
|
getModuleFactory: new AsyncHook()
|
|
2021
2012
|
});
|
|
2022
|
-
this.bridgeHook = new PluginSystem({
|
|
2023
|
-
beforeBridgeRender: new SyncHook(),
|
|
2024
|
-
afterBridgeRender: new SyncHook(),
|
|
2025
|
-
beforeBridgeDestroy: new SyncHook(),
|
|
2026
|
-
afterBridgeDestroy: new SyncHook()
|
|
2027
|
-
});
|
|
2028
2013
|
// TODO: Validate the details of the options
|
|
2029
2014
|
// Initialize options with default values
|
|
2030
2015
|
const defaultOptions = {
|
package/dist/index.esm.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as _extends, _ as _object_without_properties_loose } from './polyfills.esm.mjs';
|
|
2
2
|
import { isBrowserEnv, loadScriptNode, composeKeyWithSeparator, loadScript, safeToString, createLink, createScript, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1 } from '@module-federation/sdk';
|
|
3
3
|
export { loadScript, loadScriptNode } from '@module-federation/sdk';
|
|
4
|
-
import { o as getGlobalHostPlugins, t as globalLoading, D as DEFAULT_REMOTE_TYPE, u as DEFAULT_SCOPE, l as getRemoteEntryExports, v as assert, w as error, x as getFMId, y as
|
|
4
|
+
import { o as getGlobalHostPlugins, t as globalLoading, D as DEFAULT_REMOTE_TYPE, u as DEFAULT_SCOPE, l as getRemoteEntryExports, v as assert, w as error, x as getFMId, y as isObject, z as warn, A as isPlainObject, B as isRemoteInfoWithEntry, C as isPureRemoteEntry, E as getRemoteEntryInfoFromSnapshot, e as getInfoWithoutType, p as getPreloaded, q as setPreloaded, g as getRegisteredShare, F as arrayOptions, i as getGlobalSnapshotInfoByModuleInfo, k as addGlobalSnapshot, j as setGlobalSnapshotInfoByModuleInfo, G as Global, f as getGlobalSnapshot, H as formatShareConfigs, I as getTargetSharedOptions, a as getGlobalShareScope, J as addUniqueItem, K as CurrentGlobal, L as logger, M as getBuilderId, d as setGlobalFederationConstructor, b as getGlobalFederationInstance, c as getGlobalFederationConstructor, s as setGlobalFederationInstance } from './share.esm.mjs';
|
|
5
5
|
export { m as registerGlobalPlugins } from './share.esm.mjs';
|
|
6
6
|
import { getShortErrorMsg, RUNTIME_001, runtimeDescMap, RUNTIME_002, RUNTIME_007, RUNTIME_003, RUNTIME_005, RUNTIME_006, RUNTIME_004 } from '@module-federation/error-codes';
|
|
7
7
|
|
|
@@ -333,9 +333,7 @@ let Module = class Module {
|
|
|
333
333
|
moduleFactory = await remoteEntryExports.get(expose);
|
|
334
334
|
}
|
|
335
335
|
assert(moduleFactory, `${getFMId(this.remoteInfo)} remote don't export ${expose}.`);
|
|
336
|
-
|
|
337
|
-
const symbolName = processModuleAlias(this.remoteInfo.name, expose);
|
|
338
|
-
const wrapModuleFactory = this.wraperFactory(moduleFactory, symbolName);
|
|
336
|
+
const wrapModuleFactory = this.wraperFactory(moduleFactory, id);
|
|
339
337
|
if (!loadFactory) {
|
|
340
338
|
return wrapModuleFactory;
|
|
341
339
|
}
|
|
@@ -1073,8 +1071,6 @@ class SnapshotHandler {
|
|
|
1073
1071
|
remoteSnapshot,
|
|
1074
1072
|
globalSnapshot
|
|
1075
1073
|
});
|
|
1076
|
-
let mSnapshot;
|
|
1077
|
-
let gSnapshot;
|
|
1078
1074
|
// global snapshot includes manifest or module info includes manifest
|
|
1079
1075
|
if (globalRemoteSnapshot) {
|
|
1080
1076
|
if (isManifestProvider(globalRemoteSnapshot)) {
|
|
@@ -1086,8 +1082,10 @@ class SnapshotHandler {
|
|
|
1086
1082
|
// Therefore, set the snapshot key to the global address of the actual request
|
|
1087
1083
|
entry: remoteEntry
|
|
1088
1084
|
}), moduleSnapshot);
|
|
1089
|
-
|
|
1090
|
-
|
|
1085
|
+
return {
|
|
1086
|
+
remoteSnapshot: moduleSnapshot,
|
|
1087
|
+
globalSnapshot: globalSnapshotRes
|
|
1088
|
+
};
|
|
1091
1089
|
} else {
|
|
1092
1090
|
const { remoteSnapshot: remoteSnapshotRes } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1093
1091
|
options: this.HostInstance.options,
|
|
@@ -1095,8 +1093,10 @@ class SnapshotHandler {
|
|
|
1095
1093
|
remoteSnapshot: globalRemoteSnapshot,
|
|
1096
1094
|
from: 'global'
|
|
1097
1095
|
});
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
return {
|
|
1097
|
+
remoteSnapshot: remoteSnapshotRes,
|
|
1098
|
+
globalSnapshot: globalSnapshotRes
|
|
1099
|
+
};
|
|
1100
1100
|
}
|
|
1101
1101
|
} else {
|
|
1102
1102
|
if (isRemoteInfoWithEntry(moduleInfo)) {
|
|
@@ -1110,8 +1110,10 @@ class SnapshotHandler {
|
|
|
1110
1110
|
remoteSnapshot: moduleSnapshot,
|
|
1111
1111
|
from: 'global'
|
|
1112
1112
|
});
|
|
1113
|
-
|
|
1114
|
-
|
|
1113
|
+
return {
|
|
1114
|
+
remoteSnapshot: remoteSnapshotRes,
|
|
1115
|
+
globalSnapshot: globalSnapshotRes
|
|
1116
|
+
};
|
|
1115
1117
|
} else {
|
|
1116
1118
|
error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
|
|
1117
1119
|
hostName: moduleInfo.name,
|
|
@@ -1120,15 +1122,6 @@ class SnapshotHandler {
|
|
|
1120
1122
|
}));
|
|
1121
1123
|
}
|
|
1122
1124
|
}
|
|
1123
|
-
await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1124
|
-
options,
|
|
1125
|
-
moduleInfo,
|
|
1126
|
-
remoteSnapshot: mSnapshot
|
|
1127
|
-
});
|
|
1128
|
-
return {
|
|
1129
|
-
remoteSnapshot: mSnapshot,
|
|
1130
|
-
globalSnapshot: gSnapshot
|
|
1131
|
-
};
|
|
1132
1125
|
}
|
|
1133
1126
|
getGlobalRemoteInfo(moduleInfo) {
|
|
1134
1127
|
return getGlobalRemoteInfo(moduleInfo, this.HostInstance);
|
|
@@ -1182,8 +1175,7 @@ class SnapshotHandler {
|
|
|
1182
1175
|
this.hooks = new PluginSystem({
|
|
1183
1176
|
beforeLoadRemoteSnapshot: new AsyncHook('beforeLoadRemoteSnapshot'),
|
|
1184
1177
|
loadSnapshot: new AsyncWaterfallHook('loadGlobalSnapshot'),
|
|
1185
|
-
loadRemoteSnapshot: new AsyncWaterfallHook('loadRemoteSnapshot')
|
|
1186
|
-
afterLoadSnapshot: new AsyncWaterfallHook('afterLoadSnapshot')
|
|
1178
|
+
loadRemoteSnapshot: new AsyncWaterfallHook('loadRemoteSnapshot')
|
|
1187
1179
|
});
|
|
1188
1180
|
this.manifestLoading = Global.__FEDERATION__.__MANIFEST_LOADING__;
|
|
1189
1181
|
this.HostInstance = HostInstance;
|
|
@@ -1984,8 +1976,7 @@ class FederationHost {
|
|
|
1984
1976
|
this.remoteHandler.hooks,
|
|
1985
1977
|
this.sharedHandler.hooks,
|
|
1986
1978
|
this.snapshotHandler.hooks,
|
|
1987
|
-
this.loaderHook
|
|
1988
|
-
this.bridgeHook
|
|
1979
|
+
this.loaderHook
|
|
1989
1980
|
]);
|
|
1990
1981
|
// Merge plugin
|
|
1991
1982
|
this.options.plugins = this.options.plugins.reduce((res, plugin)=>{
|
|
@@ -2008,7 +1999,7 @@ class FederationHost {
|
|
|
2008
1999
|
// maybe will change, temporarily for internal use only
|
|
2009
2000
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
2010
2001
|
});
|
|
2011
|
-
this.version = "0.7.
|
|
2002
|
+
this.version = "0.7.2";
|
|
2012
2003
|
this.moduleCache = new Map();
|
|
2013
2004
|
this.loaderHook = new PluginSystem({
|
|
2014
2005
|
// FIXME: may not be suitable , not open to the public yet
|
|
@@ -2019,12 +2010,6 @@ class FederationHost {
|
|
|
2019
2010
|
fetch: new AsyncHook(),
|
|
2020
2011
|
getModuleFactory: new AsyncHook()
|
|
2021
2012
|
});
|
|
2022
|
-
this.bridgeHook = new PluginSystem({
|
|
2023
|
-
beforeBridgeRender: new SyncHook(),
|
|
2024
|
-
afterBridgeRender: new SyncHook(),
|
|
2025
|
-
beforeBridgeDestroy: new SyncHook(),
|
|
2026
|
-
afterBridgeDestroy: new SyncHook()
|
|
2027
|
-
});
|
|
2028
2013
|
// TODO: Validate the details of the options
|
|
2029
2014
|
// Initialize options with default values
|
|
2030
2015
|
const defaultOptions = {
|
package/dist/share.cjs.js
CHANGED
|
@@ -89,20 +89,6 @@ function getRemoteEntryInfoFromSnapshot(snapshot) {
|
|
|
89
89
|
}
|
|
90
90
|
return defaultRemoteEntryInfo;
|
|
91
91
|
}
|
|
92
|
-
const processModuleAlias = (name, subPath)=>{
|
|
93
|
-
// @host/ ./button -> @host/button
|
|
94
|
-
let moduleName;
|
|
95
|
-
if (name.endsWith('/')) {
|
|
96
|
-
moduleName = name.slice(0, -1);
|
|
97
|
-
} else {
|
|
98
|
-
moduleName = name;
|
|
99
|
-
}
|
|
100
|
-
if (subPath.startsWith('.')) {
|
|
101
|
-
subPath = subPath.slice(1);
|
|
102
|
-
}
|
|
103
|
-
moduleName = moduleName + subPath;
|
|
104
|
-
return moduleName;
|
|
105
|
-
};
|
|
106
92
|
|
|
107
93
|
const CurrentGlobal = typeof globalThis === 'object' ? globalThis : window;
|
|
108
94
|
const nativeGlobal = (()=>{
|
|
@@ -197,7 +183,7 @@ function getGlobalFederationConstructor() {
|
|
|
197
183
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = sdk.isDebugMode()) {
|
|
198
184
|
if (isDebug) {
|
|
199
185
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
200
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.
|
|
186
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.2";
|
|
201
187
|
}
|
|
202
188
|
}
|
|
203
189
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -927,7 +913,6 @@ exports.isPureRemoteEntry = isPureRemoteEntry;
|
|
|
927
913
|
exports.isRemoteInfoWithEntry = isRemoteInfoWithEntry;
|
|
928
914
|
exports.logger = logger;
|
|
929
915
|
exports.nativeGlobal = nativeGlobal;
|
|
930
|
-
exports.processModuleAlias = processModuleAlias;
|
|
931
916
|
exports.registerGlobalPlugins = registerGlobalPlugins;
|
|
932
917
|
exports.resetFederationGlobalInfo = resetFederationGlobalInfo;
|
|
933
918
|
exports.setGlobalFederationConstructor = setGlobalFederationConstructor;
|
package/dist/share.esm.mjs
CHANGED
|
@@ -87,20 +87,6 @@ function getRemoteEntryInfoFromSnapshot(snapshot) {
|
|
|
87
87
|
}
|
|
88
88
|
return defaultRemoteEntryInfo;
|
|
89
89
|
}
|
|
90
|
-
const processModuleAlias = (name, subPath)=>{
|
|
91
|
-
// @host/ ./button -> @host/button
|
|
92
|
-
let moduleName;
|
|
93
|
-
if (name.endsWith('/')) {
|
|
94
|
-
moduleName = name.slice(0, -1);
|
|
95
|
-
} else {
|
|
96
|
-
moduleName = name;
|
|
97
|
-
}
|
|
98
|
-
if (subPath.startsWith('.')) {
|
|
99
|
-
subPath = subPath.slice(1);
|
|
100
|
-
}
|
|
101
|
-
moduleName = moduleName + subPath;
|
|
102
|
-
return moduleName;
|
|
103
|
-
};
|
|
104
90
|
|
|
105
91
|
const CurrentGlobal = typeof globalThis === 'object' ? globalThis : window;
|
|
106
92
|
const nativeGlobal = (()=>{
|
|
@@ -195,7 +181,7 @@ function getGlobalFederationConstructor() {
|
|
|
195
181
|
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
|
|
196
182
|
if (isDebug) {
|
|
197
183
|
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
198
|
-
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.
|
|
184
|
+
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.2";
|
|
199
185
|
}
|
|
200
186
|
}
|
|
201
187
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -893,4 +879,4 @@ function getTargetSharedOptions(options) {
|
|
|
893
879
|
return Object.assign({}, resolver(shareInfos[pkgName]), extraOptions == null ? void 0 : extraOptions.customShareInfo);
|
|
894
880
|
}
|
|
895
881
|
|
|
896
|
-
export {
|
|
882
|
+
export { isPlainObject as A, isRemoteInfoWithEntry as B, isPureRemoteEntry as C, DEFAULT_REMOTE_TYPE as D, getRemoteEntryInfoFromSnapshot as E, arrayOptions as F, Global as G, formatShareConfigs as H, getTargetSharedOptions as I, addUniqueItem as J, CurrentGlobal as K, logger as L, getBuilderId as M, getGlobalShareScope as a, getGlobalFederationInstance as b, getGlobalFederationConstructor as c, setGlobalFederationConstructor as d, getInfoWithoutType as e, getGlobalSnapshot as f, getRegisteredShare as g, getTargetSnapshotInfoByModuleInfo as h, getGlobalSnapshotInfoByModuleInfo as i, setGlobalSnapshotInfoByModuleInfo as j, addGlobalSnapshot as k, getRemoteEntryExports as l, registerGlobalPlugins as m, nativeGlobal as n, getGlobalHostPlugins as o, getPreloaded as p, setPreloaded as q, resetFederationGlobalInfo as r, setGlobalFederationInstance as s, globalLoading as t, DEFAULT_SCOPE as u, assert as v, error as w, getFMId as x, isObject as y, warn as z };
|
package/dist/src/core.d.ts
CHANGED
|
@@ -66,12 +66,6 @@ export declare class FederationHost {
|
|
|
66
66
|
moduleInfo: RemoteInfo;
|
|
67
67
|
}], Promise<(() => Promise<Module>) | undefined>>;
|
|
68
68
|
}>;
|
|
69
|
-
bridgeHook: PluginSystem<{
|
|
70
|
-
beforeBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
71
|
-
afterBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
72
|
-
beforeBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
73
|
-
afterBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
74
|
-
}>;
|
|
75
69
|
constructor(userOptions: UserOptions);
|
|
76
70
|
initOptions(userOptions: UserOptions): Options;
|
|
77
71
|
loadShare<T>(pkgName: string, extraOptions?: {
|
package/dist/src/embedded.d.ts
CHANGED
|
@@ -78,12 +78,6 @@ export declare class FederationHost implements IndexModule.FederationHost {
|
|
|
78
78
|
moduleInfo: import("./type").RemoteInfo;
|
|
79
79
|
}], Promise<(() => Promise<IndexModule.Module>) | undefined>>;
|
|
80
80
|
}>;
|
|
81
|
-
get bridgeHook(): import("./utils/hooks").PluginSystem<{
|
|
82
|
-
beforeBridgeRender: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
83
|
-
afterBridgeRender: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
84
|
-
beforeBridgeDestroy: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
85
|
-
afterBridgeDestroy: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
86
|
-
}>;
|
|
87
81
|
initOptions(...args: Parameters<IndexModule.FederationHost['initOptions']>): import("./type").Options;
|
|
88
82
|
loadShare<T>(...args: Parameters<IndexModule.FederationHost['loadShare']>): Promise<false | (() => T | undefined)>;
|
|
89
83
|
loadShareSync<T>(...args: Parameters<IndexModule.FederationHost['loadShareSync']>): () => T | never;
|
|
@@ -32,11 +32,6 @@ export declare class SnapshotHandler {
|
|
|
32
32
|
remoteSnapshot: ModuleInfo;
|
|
33
33
|
from: "global" | "manifest";
|
|
34
34
|
}>;
|
|
35
|
-
afterLoadSnapshot: AsyncWaterfallHook<{
|
|
36
|
-
options: Options;
|
|
37
|
-
moduleInfo: Remote;
|
|
38
|
-
remoteSnapshot: ModuleInfo;
|
|
39
|
-
}>;
|
|
40
35
|
}>;
|
|
41
36
|
loaderHook: FederationHost['loaderHook'];
|
|
42
37
|
manifestLoading: Record<string, Promise<ModuleInfo>>;
|
|
@@ -4,7 +4,7 @@ export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
|
4
4
|
export type PartialOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
5
5
|
[P in K]-?: T[P];
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
interface RemoteInfoCommon {
|
|
8
8
|
alias?: string;
|
|
9
9
|
shareScope?: string;
|
|
10
10
|
type?: RemoteEntryType;
|
|
@@ -15,10 +15,6 @@ type ModuleLifeCycle = Module['host']['loaderHook']['lifecycle'];
|
|
|
15
15
|
type ModuleLifeCycleCyclePartial = Partial<{
|
|
16
16
|
[k in keyof ModuleLifeCycle]: Parameters<ModuleLifeCycle[k]['on']>[0];
|
|
17
17
|
}>;
|
|
18
|
-
type ModuleBridgeLifeCycle = Module['host']['bridgeHook']['lifecycle'];
|
|
19
|
-
type ModuleBridgeLifeCycleCyclePartial = Partial<{
|
|
20
|
-
[k in keyof ModuleBridgeLifeCycle]: Parameters<ModuleBridgeLifeCycle[k]['on']>[0];
|
|
21
|
-
}>;
|
|
22
18
|
type SharedLifeCycle = SharedHandler['hooks']['lifecycle'];
|
|
23
19
|
type SharedLifeCycleCyclePartial = Partial<{
|
|
24
20
|
[k in keyof SharedLifeCycle]: Parameters<SharedLifeCycle[k]['on']>[0];
|
|
@@ -27,7 +23,7 @@ type RemoteLifeCycle = RemoteHandler['hooks']['lifecycle'];
|
|
|
27
23
|
type RemoteLifeCycleCyclePartial = Partial<{
|
|
28
24
|
[k in keyof RemoteLifeCycle]: Parameters<RemoteLifeCycle[k]['on']>[0];
|
|
29
25
|
}>;
|
|
30
|
-
export type FederationRuntimePlugin = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial &
|
|
26
|
+
export type FederationRuntimePlugin = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial & {
|
|
31
27
|
name: string;
|
|
32
28
|
version?: string;
|
|
33
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FederationHost } from '../core';
|
|
2
2
|
import { UserOptions } from '../type';
|
|
3
3
|
import { Module } from '../module';
|
|
4
|
-
export declare function registerPlugins(plugins: UserOptions['plugins'], hookInstances: Array<FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | FederationHost['sharedHandler']['hooks'] | FederationHost['remoteHandler']['hooks'] | Module['host']['loaderHook']
|
|
4
|
+
export declare function registerPlugins(plugins: UserOptions['plugins'], hookInstances: Array<FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | FederationHost['sharedHandler']['hooks'] | FederationHost['remoteHandler']['hooks'] | Module['host']['loaderHook']>): import("../type").FederationRuntimePlugin[] | undefined;
|
package/dist/src/utils/tool.d.ts
CHANGED
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-20241114065146",
|
|
4
4
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.mjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
54
|
-
"@module-federation/error-codes": "0.0.0-next-
|
|
53
|
+
"@module-federation/sdk": "0.0.0-next-20241114065146",
|
|
54
|
+
"@module-federation/error-codes": "0.0.0-next-20241114065146"
|
|
55
55
|
}
|
|
56
56
|
}
|