@module-federation/webpack-bundler-runtime 2.0.1 → 2.1.0
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/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/attachShareScopeMap.cjs +11 -0
- package/dist/attachShareScopeMap.cjs.map +1 -0
- package/dist/attachShareScopeMap.d.ts +7 -0
- package/dist/attachShareScopeMap.js +10 -0
- package/dist/attachShareScopeMap.js.map +1 -0
- package/dist/constant.cjs +8 -0
- package/dist/constant.cjs.map +1 -0
- package/dist/constant.d.ts +5 -1
- package/dist/constant.js +6 -0
- package/dist/constant.js.map +1 -0
- package/dist/consumes.cjs +55 -0
- package/dist/consumes.cjs.map +1 -0
- package/dist/consumes.js +55 -0
- package/dist/consumes.js.map +1 -0
- package/dist/getSharedFallbackGetter.cjs +27 -0
- package/dist/getSharedFallbackGetter.cjs.map +1 -0
- package/dist/getSharedFallbackGetter.js +26 -0
- package/dist/getSharedFallbackGetter.js.map +1 -0
- package/dist/getUsedExports.cjs +11 -0
- package/dist/getUsedExports.cjs.map +1 -0
- package/dist/getUsedExports.js +10 -0
- package/dist/getUsedExports.js.map +1 -0
- package/dist/index.cjs +50 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +48 -2
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/init.cjs +82 -0
- package/dist/init.cjs.map +1 -0
- package/dist/init.js +80 -0
- package/dist/init.js.map +1 -0
- package/dist/initContainerEntry.cjs +43 -0
- package/dist/initContainerEntry.cjs.map +1 -0
- package/dist/initContainerEntry.d.ts +7 -0
- package/dist/initContainerEntry.js +42 -0
- package/dist/initContainerEntry.js.map +1 -0
- package/dist/initializeSharing.cjs +61 -0
- package/dist/initializeSharing.cjs.map +1 -0
- package/dist/initializeSharing.d.ts +13 -0
- package/dist/initializeSharing.js +61 -0
- package/dist/initializeSharing.js.map +1 -0
- package/dist/installInitialConsumes.cjs +63 -0
- package/dist/installInitialConsumes.cjs.map +1 -0
- package/dist/installInitialConsumes.js +63 -0
- package/dist/installInitialConsumes.js.map +1 -0
- package/dist/remotes.cjs +74 -0
- package/dist/remotes.cjs.map +1 -0
- package/dist/remotes.js +73 -0
- package/dist/remotes.js.map +1 -0
- package/dist/runtime-core/dist/core.d.ts +132 -0
- package/dist/runtime-core/dist/global.d.ts +25 -0
- package/dist/runtime-core/dist/helpers.d.ts +4 -0
- package/dist/runtime-core/dist/index.d.ts +15 -0
- package/dist/runtime-core/dist/module/index.d.ts +33 -0
- package/dist/runtime-core/dist/plugins/snapshot/SnapshotHandler.d.ts +68 -0
- package/dist/runtime-core/dist/remote/index.d.ts +121 -0
- package/dist/runtime-core/dist/shared/index.d.ts +85 -0
- package/dist/runtime-core/dist/type/config.d.ts +117 -0
- package/dist/runtime-core/dist/type/index.d.ts +3 -0
- package/dist/runtime-core/dist/type/plugin.d.ts +28 -0
- package/dist/runtime-core/dist/type/preload.d.ts +32 -0
- package/dist/runtime-core/dist/types.d.ts +4 -0
- package/dist/runtime-core/dist/utils/env.d.ts +1 -0
- package/dist/runtime-core/dist/utils/hooks/asyncHook.d.ts +11 -0
- package/dist/runtime-core/dist/utils/hooks/asyncWaterfallHooks.d.ts +13 -0
- package/dist/runtime-core/dist/utils/hooks/pluginSystem.d.ts +20 -0
- package/dist/runtime-core/dist/utils/hooks/syncHook.d.ts +17 -0
- package/dist/runtime-core/dist/utils/hooks/syncWaterfallHook.d.ts +12 -0
- package/dist/runtime-core/dist/utils/index.d.ts +2 -0
- package/dist/runtime-core/dist/utils/load.d.ts +16 -0
- package/dist/runtime-core/dist/utils/logger.d.ts +1 -0
- package/dist/runtime-core/dist/utils/manifest.d.ts +2 -0
- package/dist/runtime-core/dist/utils/plugin.d.ts +2 -0
- package/dist/runtime-core/dist/utils/preload.d.ts +4 -0
- package/dist/runtime-core/dist/utils/share.d.ts +3 -0
- package/dist/runtime-core/dist/utils/tool.d.ts +1 -0
- package/dist/sdk/dist/types/plugins/ModuleFederationPlugin.d.ts +13 -0
- package/dist/types.d.ts +201 -0
- package/dist/updateOptions.cjs +112 -0
- package/dist/updateOptions.cjs.map +1 -0
- package/dist/updateOptions.js +110 -0
- package/dist/updateOptions.js.map +1 -0
- package/package.json +9 -9
- package/dist/constant.cjs.cjs +0 -6
- package/dist/constant.cjs.cjs.map +0 -1
- package/dist/constant.cjs.d.ts +0 -1
- package/dist/constant.esm.js +0 -4
- package/dist/constant.esm.js.map +0 -1
- package/dist/index.cjs.cjs +0 -793
- package/dist/index.cjs.cjs.map +0 -1
- package/dist/index.cjs.d.ts +0 -2
- package/dist/index.esm.js +0 -772
- package/dist/index.esm.js.map +0 -1
- package/dist/src/attachShareScopeMap.d.ts +0 -2
- package/dist/src/constant.d.ts +0 -1
- package/dist/src/consumes.d.ts +0 -2
- package/dist/src/getSharedFallbackGetter.d.ts +0 -2
- package/dist/src/getUsedExports.d.ts +0 -2
- package/dist/src/index.d.ts +0 -39
- package/dist/src/init.d.ts +0 -4
- package/dist/src/initContainerEntry.d.ts +0 -2
- package/dist/src/initializeSharing.d.ts +0 -2
- package/dist/src/installInitialConsumes.d.ts +0 -2
- package/dist/src/remotes.d.ts +0 -2
- package/dist/src/types.d.ts +0 -194
- package/dist/src/updateOptions.d.ts +0 -3
package/dist/remotes.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { attachShareScopeMap } from "./attachShareScopeMap.js";
|
|
2
|
+
import { FEDERATION_SUPPORTED_TYPES } from "./constant.js";
|
|
3
|
+
import { updateRemoteOptions } from "./updateOptions.js";
|
|
4
|
+
import { ENCODE_NAME_PREFIX, decodeName } from "@module-federation/sdk";
|
|
5
|
+
|
|
6
|
+
//#region src/remotes.ts
|
|
7
|
+
function remotes(options) {
|
|
8
|
+
updateRemoteOptions(options);
|
|
9
|
+
const { chunkId, promises, webpackRequire, chunkMapping, idToExternalAndNameMapping, idToRemoteMap } = options;
|
|
10
|
+
attachShareScopeMap(webpackRequire);
|
|
11
|
+
if (webpackRequire.o(chunkMapping, chunkId)) chunkMapping[chunkId].forEach((id) => {
|
|
12
|
+
let getScope = webpackRequire.R;
|
|
13
|
+
if (!getScope) getScope = [];
|
|
14
|
+
const data = idToExternalAndNameMapping[id];
|
|
15
|
+
const remoteInfos = idToRemoteMap[id] || [];
|
|
16
|
+
if (getScope.indexOf(data) >= 0) return;
|
|
17
|
+
getScope.push(data);
|
|
18
|
+
if (data.p) return promises.push(data.p);
|
|
19
|
+
const onError = (error) => {
|
|
20
|
+
if (!error) error = /* @__PURE__ */ new Error("Container missing");
|
|
21
|
+
if (typeof error.message === "string") error.message += `\nwhile loading "${data[1]}" from ${data[2]}`;
|
|
22
|
+
webpackRequire.m[id] = () => {
|
|
23
|
+
throw error;
|
|
24
|
+
};
|
|
25
|
+
data.p = 0;
|
|
26
|
+
};
|
|
27
|
+
const handleFunction = (fn, arg1, arg2, d, next, first) => {
|
|
28
|
+
try {
|
|
29
|
+
const promise = fn(arg1, arg2);
|
|
30
|
+
if (promise && promise.then) {
|
|
31
|
+
const p = promise.then((result) => next(result, d), onError);
|
|
32
|
+
if (first) promises.push(data.p = p);
|
|
33
|
+
else return p;
|
|
34
|
+
} else return next(promise, d, first);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
onError(error);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const onExternal = (external, _, first) => external ? handleFunction(webpackRequire.I, data[0], 0, external, onInitialized, first) : onError();
|
|
40
|
+
var onInitialized = (_, external, first) => handleFunction(external.get, data[1], getScope, 0, onFactory, first);
|
|
41
|
+
var onFactory = (factory) => {
|
|
42
|
+
data.p = 1;
|
|
43
|
+
webpackRequire.m[id] = (module) => {
|
|
44
|
+
module.exports = factory();
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const onRemoteLoaded = () => {
|
|
48
|
+
try {
|
|
49
|
+
const remoteModuleName = decodeName(remoteInfos[0].name, ENCODE_NAME_PREFIX) + data[1].slice(1);
|
|
50
|
+
const instance = webpackRequire.federation.instance;
|
|
51
|
+
const loadRemote = () => webpackRequire.federation.instance.loadRemote(remoteModuleName, {
|
|
52
|
+
loadFactory: false,
|
|
53
|
+
from: "build"
|
|
54
|
+
});
|
|
55
|
+
if (instance.options.shareStrategy === "version-first") {
|
|
56
|
+
const shareScopes = Array.isArray(data[0]) ? data[0] : [data[0]];
|
|
57
|
+
return Promise.all(shareScopes.map((shareScope) => instance.sharedHandler.initializeSharing(shareScope))).then(() => {
|
|
58
|
+
return loadRemote();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return loadRemote();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
onError(error);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
if (remoteInfos.length === 1 && FEDERATION_SUPPORTED_TYPES.includes(remoteInfos[0].externalType) && remoteInfos[0].name) handleFunction(onRemoteLoaded, data[2], 0, 0, onFactory, 1);
|
|
67
|
+
else handleFunction(webpackRequire, data[2], 0, 0, onExternal, 1);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { remotes };
|
|
73
|
+
//# sourceMappingURL=remotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remotes.js","names":[],"sources":["../src/remotes.ts"],"sourcesContent":["import { attachShareScopeMap } from './attachShareScopeMap';\nimport type { RemoteEntryExports } from './types';\nimport { RemotesOptions } from './types';\nimport { FEDERATION_SUPPORTED_TYPES } from './constant';\nimport { decodeName, ENCODE_NAME_PREFIX } from '@module-federation/sdk';\nimport { updateRemoteOptions } from './updateOptions';\n\nexport function remotes(options: RemotesOptions) {\n updateRemoteOptions(options);\n\n const {\n chunkId,\n promises,\n webpackRequire,\n chunkMapping,\n idToExternalAndNameMapping,\n idToRemoteMap,\n } = options;\n attachShareScopeMap(webpackRequire);\n\n if (webpackRequire.o(chunkMapping, chunkId)) {\n chunkMapping[chunkId].forEach((id) => {\n let getScope = webpackRequire.R;\n if (!getScope) {\n getScope = [];\n }\n const data = idToExternalAndNameMapping[id];\n const remoteInfos = idToRemoteMap[id] || [];\n // @ts-ignore seems not work\n if (getScope.indexOf(data) >= 0) {\n return;\n }\n // @ts-ignore seems not work\n getScope.push(data);\n if (data.p) {\n return promises.push(data.p as Promise<any>);\n }\n const onError = (error?: Error) => {\n if (!error) {\n error = new Error('Container missing');\n }\n if (typeof error.message === 'string') {\n error.message += `\\nwhile loading \"${data[1]}\" from ${data[2]}`;\n }\n webpackRequire.m[id] = () => {\n throw error;\n };\n data.p = 0;\n };\n const handleFunction = (\n fn: (...args: any[]) => any,\n arg1: any,\n arg2: any,\n d: any,\n next: (...args: any[]) => any,\n first: 1 | 0,\n ) => {\n try {\n const promise = fn(arg1, arg2);\n if (promise && promise.then) {\n const p = promise.then((result: any) => next(result, d), onError);\n if (first) {\n promises.push((data.p = p));\n } else {\n return p;\n }\n } else {\n return next(promise, d, first);\n }\n } catch (error) {\n onError(error as Error);\n }\n };\n const onExternal = (\n external: (...args: any[]) => any,\n _: any,\n first: 1 | 0,\n ) =>\n external\n ? handleFunction(\n webpackRequire.I,\n data[0],\n 0,\n external,\n onInitialized,\n first,\n )\n : onError();\n\n // eslint-disable-next-line no-var\n var onInitialized = (\n _: any,\n external: RemoteEntryExports,\n first: 1 | 0,\n ) => handleFunction(external.get, data[1], getScope, 0, onFactory, first);\n // eslint-disable-next-line no-var\n var onFactory = (factory: () => any) => {\n data.p = 1;\n webpackRequire.m[id] = (module) => {\n module.exports = factory();\n };\n };\n const onRemoteLoaded = () => {\n try {\n const remoteName = decodeName(\n remoteInfos[0].name,\n ENCODE_NAME_PREFIX,\n );\n\n const remoteModuleName = remoteName + data[1].slice(1);\n const instance = webpackRequire.federation.instance!;\n const loadRemote = () =>\n webpackRequire.federation.instance!.loadRemote(remoteModuleName, {\n loadFactory: false,\n from: 'build',\n });\n\n if (instance.options.shareStrategy === 'version-first') {\n const shareScopes = Array.isArray(data[0]) ? data[0] : [data[0]];\n\n return Promise.all(\n shareScopes.map((shareScope) =>\n instance.sharedHandler.initializeSharing(shareScope),\n ),\n ).then(() => {\n return loadRemote();\n });\n }\n\n return loadRemote();\n } catch (error) {\n onError(error as Error);\n }\n };\n\n const useRuntimeLoad =\n remoteInfos.length === 1 &&\n FEDERATION_SUPPORTED_TYPES.includes(remoteInfos[0].externalType) &&\n remoteInfos[0].name;\n\n if (useRuntimeLoad) {\n handleFunction(onRemoteLoaded, data[2], 0, 0, onFactory, 1);\n } else {\n handleFunction(webpackRequire, data[2], 0, 0, onExternal, 1);\n }\n });\n }\n}\n"],"mappings":";;;;;;AAOA,SAAgB,QAAQ,SAAyB;AAC/C,qBAAoB,QAAQ;CAE5B,MAAM,EACJ,SACA,UACA,gBACA,cACA,4BACA,kBACE;AACJ,qBAAoB,eAAe;AAEnC,KAAI,eAAe,EAAE,cAAc,QAAQ,CACzC,cAAa,SAAS,SAAS,OAAO;EACpC,IAAI,WAAW,eAAe;AAC9B,MAAI,CAAC,SACH,YAAW,EAAE;EAEf,MAAM,OAAO,2BAA2B;EACxC,MAAM,cAAc,cAAc,OAAO,EAAE;AAE3C,MAAI,SAAS,QAAQ,KAAK,IAAI,EAC5B;AAGF,WAAS,KAAK,KAAK;AACnB,MAAI,KAAK,EACP,QAAO,SAAS,KAAK,KAAK,EAAkB;EAE9C,MAAM,WAAW,UAAkB;AACjC,OAAI,CAAC,MACH,yBAAQ,IAAI,MAAM,oBAAoB;AAExC,OAAI,OAAO,MAAM,YAAY,SAC3B,OAAM,WAAW,oBAAoB,KAAK,GAAG,SAAS,KAAK;AAE7D,kBAAe,EAAE,YAAY;AAC3B,UAAM;;AAER,QAAK,IAAI;;EAEX,MAAM,kBACJ,IACA,MACA,MACA,GACA,MACA,UACG;AACH,OAAI;IACF,MAAM,UAAU,GAAG,MAAM,KAAK;AAC9B,QAAI,WAAW,QAAQ,MAAM;KAC3B,MAAM,IAAI,QAAQ,MAAM,WAAgB,KAAK,QAAQ,EAAE,EAAE,QAAQ;AACjE,SAAI,MACF,UAAS,KAAM,KAAK,IAAI,EAAG;SAE3B,QAAO;UAGT,QAAO,KAAK,SAAS,GAAG,MAAM;YAEzB,OAAO;AACd,YAAQ,MAAe;;;EAG3B,MAAM,cACJ,UACA,GACA,UAEA,WACI,eACE,eAAe,GACf,KAAK,IACL,GACA,UACA,eACA,MACD,GACD,SAAS;EAGf,IAAI,iBACF,GACA,UACA,UACG,eAAe,SAAS,KAAK,KAAK,IAAI,UAAU,GAAG,WAAW,MAAM;EAEzE,IAAI,aAAa,YAAuB;AACtC,QAAK,IAAI;AACT,kBAAe,EAAE,OAAO,WAAW;AACjC,WAAO,UAAU,SAAS;;;EAG9B,MAAM,uBAAuB;AAC3B,OAAI;IAMF,MAAM,mBALa,WACjB,YAAY,GAAG,MACf,mBACD,GAEqC,KAAK,GAAG,MAAM,EAAE;IACtD,MAAM,WAAW,eAAe,WAAW;IAC3C,MAAM,mBACJ,eAAe,WAAW,SAAU,WAAW,kBAAkB;KAC/D,aAAa;KACb,MAAM;KACP,CAAC;AAEJ,QAAI,SAAS,QAAQ,kBAAkB,iBAAiB;KACtD,MAAM,cAAc,MAAM,QAAQ,KAAK,GAAG,GAAG,KAAK,KAAK,CAAC,KAAK,GAAG;AAEhE,YAAO,QAAQ,IACb,YAAY,KAAK,eACf,SAAS,cAAc,kBAAkB,WAAW,CACrD,CACF,CAAC,WAAW;AACX,aAAO,YAAY;OACnB;;AAGJ,WAAO,YAAY;YACZ,OAAO;AACd,YAAQ,MAAe;;;AAS3B,MAJE,YAAY,WAAW,KACvB,2BAA2B,SAAS,YAAY,GAAG,aAAa,IAChE,YAAY,GAAG,KAGf,gBAAe,gBAAgB,KAAK,IAAI,GAAG,GAAG,WAAW,EAAE;MAE3D,gBAAe,gBAAgB,KAAK,IAAI,GAAG,GAAG,YAAY,EAAE;GAE9D"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { SyncHook } from "./utils/hooks/syncHook.js";
|
|
2
|
+
import { AsyncHook } from "./utils/hooks/asyncHook.js";
|
|
3
|
+
import { SyncWaterfallHook } from "./utils/hooks/syncWaterfallHook.js";
|
|
4
|
+
import { AsyncWaterfallHook } from "./utils/hooks/asyncWaterfallHooks.js";
|
|
5
|
+
import { PluginSystem } from "./utils/hooks/pluginSystem.js";
|
|
6
|
+
import { CallFrom, InitScope, Options, Remote, RemoteEntryExports, RemoteEntryInitOptions, RemoteInfo, ShareInfos, ShareScopeMap, Shared, UserOptions } from "./type/config.js";
|
|
7
|
+
import { PreloadRemoteArgs } from "./type/preload.js";
|
|
8
|
+
import "./type/index.js";
|
|
9
|
+
import { RemoteHandler } from "./remote/index.js";
|
|
10
|
+
import { SharedHandler } from "./shared/index.js";
|
|
11
|
+
import { SnapshotHandler } from "./plugins/snapshot/SnapshotHandler.js";
|
|
12
|
+
import { getRemoteEntry } from "./utils/load.js";
|
|
13
|
+
import "./utils/index.js";
|
|
14
|
+
import { Module$1 } from "./module/index.js";
|
|
15
|
+
import { CreateScriptHookReturn, GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
|
|
16
|
+
|
|
17
|
+
//#region ../runtime-core/dist/core.d.ts
|
|
18
|
+
//#region src/core.d.ts
|
|
19
|
+
declare class ModuleFederation {
|
|
20
|
+
options: Options;
|
|
21
|
+
hooks: PluginSystem<{
|
|
22
|
+
beforeInit: SyncWaterfallHook<{
|
|
23
|
+
userOptions: UserOptions;
|
|
24
|
+
options: Options;
|
|
25
|
+
origin: ModuleFederation;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated shareInfo will be removed soon, please use userOptions directly!
|
|
28
|
+
*/
|
|
29
|
+
shareInfo: ShareInfos;
|
|
30
|
+
}>;
|
|
31
|
+
init: SyncHook<[{
|
|
32
|
+
options: Options;
|
|
33
|
+
origin: ModuleFederation;
|
|
34
|
+
}], void>;
|
|
35
|
+
beforeInitContainer: AsyncWaterfallHook<{
|
|
36
|
+
shareScope: ShareScopeMap[string];
|
|
37
|
+
initScope: InitScope;
|
|
38
|
+
remoteEntryInitOptions: RemoteEntryInitOptions;
|
|
39
|
+
remoteInfo: RemoteInfo;
|
|
40
|
+
origin: ModuleFederation;
|
|
41
|
+
}>;
|
|
42
|
+
initContainer: AsyncWaterfallHook<{
|
|
43
|
+
shareScope: ShareScopeMap[string];
|
|
44
|
+
initScope: InitScope;
|
|
45
|
+
remoteEntryInitOptions: RemoteEntryInitOptions;
|
|
46
|
+
remoteInfo: RemoteInfo;
|
|
47
|
+
remoteEntryExports: RemoteEntryExports;
|
|
48
|
+
origin: ModuleFederation;
|
|
49
|
+
id?: string;
|
|
50
|
+
remoteSnapshot?: ModuleInfo;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
version: string;
|
|
54
|
+
name: string;
|
|
55
|
+
moduleCache: Map<string, Module$1>;
|
|
56
|
+
snapshotHandler: SnapshotHandler;
|
|
57
|
+
sharedHandler: SharedHandler;
|
|
58
|
+
remoteHandler: RemoteHandler;
|
|
59
|
+
shareScopeMap: ShareScopeMap;
|
|
60
|
+
loaderHook: PluginSystem<{
|
|
61
|
+
getModuleInfo: SyncHook<[{
|
|
62
|
+
target: Record<string, any>;
|
|
63
|
+
key: any;
|
|
64
|
+
}], void | {
|
|
65
|
+
value: any | undefined;
|
|
66
|
+
key: string;
|
|
67
|
+
}>;
|
|
68
|
+
createScript: SyncHook<[{
|
|
69
|
+
url: string;
|
|
70
|
+
attrs?: Record<string, any>;
|
|
71
|
+
}], CreateScriptHookReturn>;
|
|
72
|
+
createLink: SyncHook<[{
|
|
73
|
+
url: string;
|
|
74
|
+
attrs?: Record<string, any>;
|
|
75
|
+
}], void | HTMLLinkElement>;
|
|
76
|
+
fetch: AsyncHook<[string, RequestInit], false | void | Promise<Response>>;
|
|
77
|
+
loadEntryError: AsyncHook<[{
|
|
78
|
+
getRemoteEntry: typeof getRemoteEntry;
|
|
79
|
+
origin: ModuleFederation;
|
|
80
|
+
remoteInfo: RemoteInfo;
|
|
81
|
+
remoteEntryExports?: RemoteEntryExports | undefined;
|
|
82
|
+
globalLoading: Record<string, Promise<void | RemoteEntryExports> | undefined>;
|
|
83
|
+
uniqueKey: string;
|
|
84
|
+
}], Promise<Promise<RemoteEntryExports | undefined> | undefined>>;
|
|
85
|
+
getModuleFactory: AsyncHook<[{
|
|
86
|
+
remoteEntryExports: RemoteEntryExports;
|
|
87
|
+
expose: string;
|
|
88
|
+
moduleInfo: RemoteInfo;
|
|
89
|
+
}], Promise<(() => Promise<Module$1>) | undefined>>;
|
|
90
|
+
}>;
|
|
91
|
+
bridgeHook: PluginSystem<{
|
|
92
|
+
beforeBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
93
|
+
afterBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
94
|
+
beforeBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
95
|
+
afterBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>;
|
|
96
|
+
}>;
|
|
97
|
+
moduleInfo?: GlobalModuleInfo[string];
|
|
98
|
+
constructor(userOptions: UserOptions);
|
|
99
|
+
initOptions(userOptions: UserOptions): Options;
|
|
100
|
+
loadShare<T>(pkgName: string, extraOptions?: {
|
|
101
|
+
customShareInfo?: Partial<Shared>;
|
|
102
|
+
resolver?: (sharedOptions: ShareInfos[string]) => Shared;
|
|
103
|
+
}): Promise<false | (() => T | undefined)>;
|
|
104
|
+
loadShareSync<T>(pkgName: string, extraOptions?: {
|
|
105
|
+
customShareInfo?: Partial<Shared>;
|
|
106
|
+
from?: 'build' | 'runtime';
|
|
107
|
+
resolver?: (sharedOptions: ShareInfos[string]) => Shared;
|
|
108
|
+
}): () => T | never;
|
|
109
|
+
initializeSharing(shareScopeName?: string, extraOptions?: {
|
|
110
|
+
initScope?: InitScope;
|
|
111
|
+
from?: CallFrom;
|
|
112
|
+
strategy?: Shared['strategy'];
|
|
113
|
+
}): Array<Promise<void>>;
|
|
114
|
+
initRawContainer(name: string, url: string, container: RemoteEntryExports): Module$1;
|
|
115
|
+
loadRemote<T>(id: string, options?: {
|
|
116
|
+
loadFactory?: boolean;
|
|
117
|
+
from: CallFrom;
|
|
118
|
+
}): Promise<T | null>;
|
|
119
|
+
preloadRemote(preloadOptions: Array<PreloadRemoteArgs>): Promise<void>;
|
|
120
|
+
initShareScopeMap(scopeName: string, shareScope: ShareScopeMap[string], extraOptions?: {
|
|
121
|
+
hostShareScopeMap?: ShareScopeMap;
|
|
122
|
+
}): void;
|
|
123
|
+
formatOptions(globalOptions: Options, userOptions: UserOptions): Options;
|
|
124
|
+
registerPlugins(plugins: UserOptions['plugins']): void;
|
|
125
|
+
registerRemotes(remotes: Remote[], options?: {
|
|
126
|
+
force?: boolean;
|
|
127
|
+
}): void;
|
|
128
|
+
registerShared(shared: UserOptions['shared']): void;
|
|
129
|
+
} //#endregion
|
|
130
|
+
//#endregion
|
|
131
|
+
export { ModuleFederation };
|
|
132
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GlobalShareScopeMap, RemoteEntryExports } from "./type/config.js";
|
|
2
|
+
import "./type/index.js";
|
|
3
|
+
import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
|
|
4
|
+
import { ModuleFederation } from "./core.js";
|
|
5
|
+
import { GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
|
|
6
|
+
|
|
7
|
+
//#region ../runtime-core/dist/global.d.ts
|
|
8
|
+
//#region src/global.d.ts
|
|
9
|
+
interface Federation {
|
|
10
|
+
__GLOBAL_PLUGIN__: Array<ModuleFederationRuntimePlugin>;
|
|
11
|
+
__DEBUG_CONSTRUCTOR_VERSION__?: string;
|
|
12
|
+
moduleInfo: GlobalModuleInfo;
|
|
13
|
+
__DEBUG_CONSTRUCTOR__?: typeof ModuleFederation;
|
|
14
|
+
__INSTANCES__: Array<ModuleFederation>;
|
|
15
|
+
__SHARE__: GlobalShareScopeMap;
|
|
16
|
+
__MANIFEST_LOADING__: Record<string, Promise<ModuleInfo>>;
|
|
17
|
+
__PRELOADED_MAP__: Map<string, boolean>;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
var __FEDERATION__: Federation, __VMOK__: Federation, __GLOBAL_LOADING_REMOTE_ENTRY__: Record<string, undefined | Promise<RemoteEntryExports | void>>;
|
|
21
|
+
}
|
|
22
|
+
declare const getGlobalSnapshot: () => GlobalModuleInfo;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Federation, getGlobalSnapshot };
|
|
25
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UserOptions } from "./type/config.js";
|
|
2
|
+
import "./type/index.js";
|
|
3
|
+
import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
|
|
4
|
+
import { Federation, getGlobalSnapshot } from "./global.js";
|
|
5
|
+
import { getRemoteEntry } from "./utils/load.js";
|
|
6
|
+
import "./utils/index.js";
|
|
7
|
+
import { ModuleFederation } from "./core.js";
|
|
8
|
+
import { Module$1 } from "./module/index.js";
|
|
9
|
+
import "./utils/tool.js";
|
|
10
|
+
import "./utils/manifest.js";
|
|
11
|
+
import "./utils/logger.js";
|
|
12
|
+
import "./utils/preload.js";
|
|
13
|
+
import "./utils/share.js";
|
|
14
|
+
import "./helpers.js";
|
|
15
|
+
import "@module-federation/sdk";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InitScope, RemoteEntryExports, RemoteInfo } from "../type/config.js";
|
|
2
|
+
import "../type/index.js";
|
|
3
|
+
import { ModuleFederation } from "../core.js";
|
|
4
|
+
import { ModuleInfo } from "@module-federation/sdk";
|
|
5
|
+
|
|
6
|
+
//#region ../runtime-core/dist/module/index.d.ts
|
|
7
|
+
//#region src/module/index.d.ts
|
|
8
|
+
type ModuleOptions = ConstructorParameters<typeof Module$1>[0];
|
|
9
|
+
declare class Module$1 {
|
|
10
|
+
remoteInfo: RemoteInfo;
|
|
11
|
+
inited: boolean;
|
|
12
|
+
initing: boolean;
|
|
13
|
+
initPromise?: Promise<void>;
|
|
14
|
+
remoteEntryExports?: RemoteEntryExports;
|
|
15
|
+
lib: RemoteEntryExports | undefined;
|
|
16
|
+
host: ModuleFederation;
|
|
17
|
+
constructor({
|
|
18
|
+
remoteInfo,
|
|
19
|
+
host
|
|
20
|
+
}: {
|
|
21
|
+
remoteInfo: RemoteInfo;
|
|
22
|
+
host: ModuleFederation;
|
|
23
|
+
});
|
|
24
|
+
getEntry(): Promise<RemoteEntryExports>;
|
|
25
|
+
init(id?: string, remoteSnapshot?: ModuleInfo, rawInitScope?: InitScope): Promise<RemoteEntryExports>;
|
|
26
|
+
get(id: string, expose: string, options?: {
|
|
27
|
+
loadFactory?: boolean;
|
|
28
|
+
}, remoteSnapshot?: ModuleInfo): Promise<any>;
|
|
29
|
+
private wraperFactory;
|
|
30
|
+
} //#endregion
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Module$1, ModuleOptions };
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AsyncHook } from "../../utils/hooks/asyncHook.js";
|
|
2
|
+
import { AsyncWaterfallHook } from "../../utils/hooks/asyncWaterfallHooks.js";
|
|
3
|
+
import { PluginSystem } from "../../utils/hooks/pluginSystem.js";
|
|
4
|
+
import { Options, Remote } from "../../type/config.js";
|
|
5
|
+
import "../../type/index.js";
|
|
6
|
+
import { getGlobalSnapshot } from "../../global.js";
|
|
7
|
+
import { ModuleFederation } from "../../core.js";
|
|
8
|
+
import { GlobalModuleInfo, Manifest, ModuleInfo } from "@module-federation/sdk";
|
|
9
|
+
|
|
10
|
+
//#region ../runtime-core/dist/plugins/snapshot/SnapshotHandler.d.ts
|
|
11
|
+
//#region src/plugins/snapshot/SnapshotHandler.d.ts
|
|
12
|
+
declare class SnapshotHandler {
|
|
13
|
+
loadingHostSnapshot: Promise<GlobalModuleInfo | void> | null;
|
|
14
|
+
HostInstance: ModuleFederation;
|
|
15
|
+
manifestCache: Map<string, Manifest>;
|
|
16
|
+
hooks: PluginSystem<{
|
|
17
|
+
beforeLoadRemoteSnapshot: AsyncHook<[{
|
|
18
|
+
options: Options;
|
|
19
|
+
moduleInfo: Remote;
|
|
20
|
+
}], void>;
|
|
21
|
+
loadSnapshot: AsyncWaterfallHook<{
|
|
22
|
+
options: Options;
|
|
23
|
+
moduleInfo: Remote;
|
|
24
|
+
hostGlobalSnapshot: GlobalModuleInfo[string] | undefined;
|
|
25
|
+
globalSnapshot: ReturnType<typeof getGlobalSnapshot>;
|
|
26
|
+
remoteSnapshot?: GlobalModuleInfo[string] | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
loadRemoteSnapshot: AsyncWaterfallHook<{
|
|
29
|
+
options: Options;
|
|
30
|
+
moduleInfo: Remote;
|
|
31
|
+
manifestJson?: Manifest;
|
|
32
|
+
manifestUrl?: string;
|
|
33
|
+
remoteSnapshot: ModuleInfo;
|
|
34
|
+
from: "global" | "manifest";
|
|
35
|
+
}>;
|
|
36
|
+
afterLoadSnapshot: AsyncWaterfallHook<{
|
|
37
|
+
id?: string;
|
|
38
|
+
host: ModuleFederation;
|
|
39
|
+
options: Options;
|
|
40
|
+
moduleInfo: Remote;
|
|
41
|
+
remoteSnapshot: ModuleInfo;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
44
|
+
loaderHook: ModuleFederation['loaderHook'];
|
|
45
|
+
manifestLoading: Record<string, Promise<ModuleInfo>>;
|
|
46
|
+
constructor(HostInstance: ModuleFederation);
|
|
47
|
+
loadRemoteSnapshotInfo({
|
|
48
|
+
moduleInfo,
|
|
49
|
+
id,
|
|
50
|
+
expose
|
|
51
|
+
}: {
|
|
52
|
+
moduleInfo: Remote;
|
|
53
|
+
id?: string;
|
|
54
|
+
expose?: string;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
remoteSnapshot: ModuleInfo;
|
|
57
|
+
globalSnapshot: GlobalModuleInfo;
|
|
58
|
+
}> | never;
|
|
59
|
+
getGlobalRemoteInfo(moduleInfo: Remote): {
|
|
60
|
+
hostGlobalSnapshot: ModuleInfo | undefined;
|
|
61
|
+
globalSnapshot: ReturnType<typeof getGlobalSnapshot>;
|
|
62
|
+
remoteSnapshot: GlobalModuleInfo[string] | undefined;
|
|
63
|
+
};
|
|
64
|
+
private getManifestJson;
|
|
65
|
+
} //#endregion
|
|
66
|
+
//#endregion
|
|
67
|
+
export { SnapshotHandler };
|
|
68
|
+
//# sourceMappingURL=SnapshotHandler.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { SyncHook } from "../utils/hooks/syncHook.js";
|
|
2
|
+
import { AsyncHook } from "../utils/hooks/asyncHook.js";
|
|
3
|
+
import { SyncWaterfallHook } from "../utils/hooks/syncWaterfallHook.js";
|
|
4
|
+
import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
|
|
5
|
+
import { PluginSystem } from "../utils/hooks/pluginSystem.js";
|
|
6
|
+
import { CallFrom, Options, Remote, RemoteEntryExports, RemoteInfo, UserOptions } from "../type/config.js";
|
|
7
|
+
import { PreloadAssets, PreloadOptions, PreloadRemoteArgs } from "../type/preload.js";
|
|
8
|
+
import "../type/index.js";
|
|
9
|
+
import { ModuleFederation } from "../core.js";
|
|
10
|
+
import { Module$1, ModuleOptions } from "../module/index.js";
|
|
11
|
+
import { GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
|
|
12
|
+
|
|
13
|
+
//#region ../runtime-core/dist/remote/index.d.ts
|
|
14
|
+
//#region src/remote/index.d.ts
|
|
15
|
+
interface LoadRemoteMatch {
|
|
16
|
+
id: string;
|
|
17
|
+
pkgNameOrAlias: string;
|
|
18
|
+
expose: string;
|
|
19
|
+
remote: Remote;
|
|
20
|
+
options: Options;
|
|
21
|
+
origin: ModuleFederation;
|
|
22
|
+
remoteInfo: RemoteInfo;
|
|
23
|
+
remoteSnapshot?: ModuleInfo;
|
|
24
|
+
}
|
|
25
|
+
declare class RemoteHandler {
|
|
26
|
+
host: ModuleFederation;
|
|
27
|
+
idToRemoteMap: Record<string, {
|
|
28
|
+
name: string;
|
|
29
|
+
expose: string;
|
|
30
|
+
}>;
|
|
31
|
+
hooks: PluginSystem<{
|
|
32
|
+
beforeRegisterRemote: SyncWaterfallHook<{
|
|
33
|
+
remote: Remote;
|
|
34
|
+
origin: ModuleFederation;
|
|
35
|
+
}>;
|
|
36
|
+
registerRemote: SyncWaterfallHook<{
|
|
37
|
+
remote: Remote;
|
|
38
|
+
origin: ModuleFederation;
|
|
39
|
+
}>;
|
|
40
|
+
beforeRequest: AsyncWaterfallHook<{
|
|
41
|
+
id: string;
|
|
42
|
+
options: Options;
|
|
43
|
+
origin: ModuleFederation;
|
|
44
|
+
}>;
|
|
45
|
+
onLoad: AsyncHook<[{
|
|
46
|
+
id: string;
|
|
47
|
+
expose: string;
|
|
48
|
+
pkgNameOrAlias: string;
|
|
49
|
+
remote: Remote;
|
|
50
|
+
options: ModuleOptions;
|
|
51
|
+
origin: ModuleFederation;
|
|
52
|
+
exposeModule: any;
|
|
53
|
+
exposeModuleFactory: any;
|
|
54
|
+
moduleInstance: Module$1;
|
|
55
|
+
}], void>;
|
|
56
|
+
handlePreloadModule: SyncHook<[{
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
remote: Remote;
|
|
60
|
+
remoteSnapshot: ModuleInfo;
|
|
61
|
+
preloadConfig: PreloadRemoteArgs;
|
|
62
|
+
origin: ModuleFederation;
|
|
63
|
+
}], void>;
|
|
64
|
+
errorLoadRemote: AsyncHook<[{
|
|
65
|
+
id: string;
|
|
66
|
+
error: unknown;
|
|
67
|
+
options?: any;
|
|
68
|
+
from: CallFrom;
|
|
69
|
+
lifecycle: "beforeRequest" | "beforeLoadShare" | "afterResolve" | "onLoad";
|
|
70
|
+
origin: ModuleFederation;
|
|
71
|
+
}], unknown>;
|
|
72
|
+
beforePreloadRemote: AsyncHook<[{
|
|
73
|
+
preloadOps: Array<PreloadRemoteArgs>;
|
|
74
|
+
options: Options;
|
|
75
|
+
origin: ModuleFederation;
|
|
76
|
+
}], false | void | Promise<false | void>>;
|
|
77
|
+
generatePreloadAssets: AsyncHook<[{
|
|
78
|
+
origin: ModuleFederation;
|
|
79
|
+
preloadOptions: PreloadOptions[number];
|
|
80
|
+
remote: Remote;
|
|
81
|
+
remoteInfo: RemoteInfo;
|
|
82
|
+
remoteSnapshot: ModuleInfo;
|
|
83
|
+
globalSnapshot: GlobalModuleInfo;
|
|
84
|
+
}], Promise<PreloadAssets>>;
|
|
85
|
+
afterPreloadRemote: AsyncHook<{
|
|
86
|
+
preloadOps: Array<PreloadRemoteArgs>;
|
|
87
|
+
options: Options;
|
|
88
|
+
origin: ModuleFederation;
|
|
89
|
+
}, false | void | Promise<false | void>>;
|
|
90
|
+
loadEntry: AsyncHook<[{
|
|
91
|
+
loaderHook: ModuleFederation["loaderHook"];
|
|
92
|
+
remoteInfo: RemoteInfo;
|
|
93
|
+
remoteEntryExports?: RemoteEntryExports;
|
|
94
|
+
}], Promise<RemoteEntryExports>>;
|
|
95
|
+
}>;
|
|
96
|
+
constructor(host: ModuleFederation);
|
|
97
|
+
formatAndRegisterRemote(globalOptions: Options, userOptions: UserOptions): Remote[];
|
|
98
|
+
setIdToRemoteMap(id: string, remoteMatchInfo: LoadRemoteMatch): void;
|
|
99
|
+
loadRemote<T>(id: string, options?: {
|
|
100
|
+
loadFactory?: boolean;
|
|
101
|
+
from: CallFrom;
|
|
102
|
+
}): Promise<T | null>;
|
|
103
|
+
preloadRemote(preloadOptions: Array<PreloadRemoteArgs>): Promise<void>;
|
|
104
|
+
registerRemotes(remotes: Remote[], options?: {
|
|
105
|
+
force?: boolean;
|
|
106
|
+
}): void;
|
|
107
|
+
getRemoteModuleAndOptions(options: {
|
|
108
|
+
id: string;
|
|
109
|
+
}): Promise<{
|
|
110
|
+
module: Module$1;
|
|
111
|
+
moduleOptions: ModuleOptions;
|
|
112
|
+
remoteMatchInfo: LoadRemoteMatch;
|
|
113
|
+
}>;
|
|
114
|
+
registerRemote(remote: Remote, targetRemotes: Remote[], options?: {
|
|
115
|
+
force?: boolean;
|
|
116
|
+
}): void;
|
|
117
|
+
private removeRemote;
|
|
118
|
+
} //#endregion
|
|
119
|
+
//#endregion
|
|
120
|
+
export { LoadRemoteMatch, RemoteHandler };
|
|
121
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { AsyncHook } from "../utils/hooks/asyncHook.js";
|
|
2
|
+
import { SyncWaterfallHook } from "../utils/hooks/syncWaterfallHook.js";
|
|
3
|
+
import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
|
|
4
|
+
import { PluginSystem } from "../utils/hooks/pluginSystem.js";
|
|
5
|
+
import { CallFrom, InitScope, InitTokens, Options, ShareInfos, ShareScopeMap, ShareStrategy, Shared, UserOptions } from "../type/config.js";
|
|
6
|
+
import "../type/index.js";
|
|
7
|
+
import { LoadRemoteMatch } from "../remote/index.js";
|
|
8
|
+
import { Federation } from "../global.js";
|
|
9
|
+
import { ModuleFederation } from "../core.js";
|
|
10
|
+
|
|
11
|
+
//#region ../runtime-core/dist/shared/index.d.ts
|
|
12
|
+
//#region src/shared/index.d.ts
|
|
13
|
+
declare class SharedHandler {
|
|
14
|
+
host: ModuleFederation;
|
|
15
|
+
shareScopeMap: ShareScopeMap;
|
|
16
|
+
hooks: PluginSystem<{
|
|
17
|
+
beforeRegisterShare: SyncWaterfallHook<{
|
|
18
|
+
pkgName: string;
|
|
19
|
+
shared: Shared;
|
|
20
|
+
origin: ModuleFederation;
|
|
21
|
+
}>;
|
|
22
|
+
afterResolve: AsyncWaterfallHook<LoadRemoteMatch>;
|
|
23
|
+
beforeLoadShare: AsyncWaterfallHook<{
|
|
24
|
+
pkgName: string;
|
|
25
|
+
shareInfo?: Shared;
|
|
26
|
+
shared: Options["shared"];
|
|
27
|
+
origin: ModuleFederation;
|
|
28
|
+
}>;
|
|
29
|
+
loadShare: AsyncHook<[ModuleFederation, string, ShareInfos], false | void | Promise<false | void>>;
|
|
30
|
+
resolveShare: SyncWaterfallHook<{
|
|
31
|
+
shareScopeMap: ShareScopeMap;
|
|
32
|
+
scope: string;
|
|
33
|
+
pkgName: string;
|
|
34
|
+
version: string;
|
|
35
|
+
shareInfo: Shared;
|
|
36
|
+
GlobalFederation: Federation;
|
|
37
|
+
resolver: () => {
|
|
38
|
+
shared: Shared;
|
|
39
|
+
useTreesShaking: boolean;
|
|
40
|
+
} | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
initContainerShareScopeMap: SyncWaterfallHook<{
|
|
43
|
+
shareScope: ShareScopeMap[string];
|
|
44
|
+
options: Options;
|
|
45
|
+
origin: ModuleFederation;
|
|
46
|
+
scopeName: string;
|
|
47
|
+
hostShareScopeMap?: ShareScopeMap;
|
|
48
|
+
}>;
|
|
49
|
+
}>;
|
|
50
|
+
initTokens: InitTokens;
|
|
51
|
+
constructor(host: ModuleFederation);
|
|
52
|
+
registerShared(globalOptions: Options, userOptions: UserOptions): {
|
|
53
|
+
newShareInfos: ShareInfos;
|
|
54
|
+
allShareInfos: {
|
|
55
|
+
[pkgName: string]: Shared[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
loadShare<T>(pkgName: string, extraOptions?: {
|
|
59
|
+
customShareInfo?: Partial<Shared>;
|
|
60
|
+
resolver?: (sharedOptions: ShareInfos[string]) => Shared;
|
|
61
|
+
}): Promise<false | (() => T | undefined)>;
|
|
62
|
+
/**
|
|
63
|
+
* This function initializes the sharing sequence (executed only once per share scope).
|
|
64
|
+
* It accepts one argument, the name of the share scope.
|
|
65
|
+
* If the share scope does not exist, it creates one.
|
|
66
|
+
*/
|
|
67
|
+
initializeSharing(shareScopeName?: string, extraOptions?: {
|
|
68
|
+
initScope?: InitScope;
|
|
69
|
+
from?: CallFrom;
|
|
70
|
+
strategy?: ShareStrategy;
|
|
71
|
+
}): Array<Promise<void>>;
|
|
72
|
+
loadShareSync<T>(pkgName: string, extraOptions?: {
|
|
73
|
+
from?: 'build' | 'runtime';
|
|
74
|
+
customShareInfo?: Partial<Shared>;
|
|
75
|
+
resolver?: (sharedOptions: ShareInfos[string]) => Shared;
|
|
76
|
+
}): () => T | never;
|
|
77
|
+
initShareScopeMap(scopeName: string, shareScope: ShareScopeMap[string], extraOptions?: {
|
|
78
|
+
hostShareScopeMap?: ShareScopeMap;
|
|
79
|
+
}): void;
|
|
80
|
+
private setShared;
|
|
81
|
+
private _setGlobalShareScopeMap;
|
|
82
|
+
} //#endregion
|
|
83
|
+
//#endregion
|
|
84
|
+
export { SharedHandler };
|
|
85
|
+
//# sourceMappingURL=index.d.ts.map
|