@module-federation/runtime 0.0.7 → 0.0.9
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/README.md +513 -124
- package/dist/helpers.cjs.js +1 -1
- package/dist/helpers.esm.js +2 -2
- package/dist/index.cjs.js +189 -78
- package/dist/index.esm.js +188 -80
- package/dist/package.json +3 -3
- package/dist/share.cjs.js +92 -59
- package/dist/share.esm.js +92 -59
- package/dist/src/core.d.ts +26 -9
- package/dist/src/global.d.ts +2 -3
- package/dist/src/helpers.d.ts +2 -2
- package/dist/src/index.d.ts +3 -1
- package/dist/src/type/config.d.ts +7 -2
- package/dist/src/utils/share.d.ts +12 -3
- package/dist/types.cjs.d.ts +1 -0
- package/package.json +4 -4
- package/dist/type.cjs.d.ts +0 -1
- /package/dist/{type.cjs.js → types.cjs.js} +0 -0
- /package/dist/{type.esm.js → types.esm.js} +0 -0
|
@@ -29,6 +29,7 @@ export interface SharedConfig {
|
|
|
29
29
|
singleton?: boolean;
|
|
30
30
|
requiredVersion: false | string;
|
|
31
31
|
eager?: boolean;
|
|
32
|
+
strictVersion?: boolean;
|
|
32
33
|
}
|
|
33
34
|
type SharedBaseArgs = {
|
|
34
35
|
version: string;
|
|
@@ -57,13 +58,16 @@ export type Shared = {
|
|
|
57
58
|
eager?: boolean;
|
|
58
59
|
strategy: 'version-first' | 'loaded-first';
|
|
59
60
|
};
|
|
60
|
-
export type
|
|
61
|
+
export type ShareScopeMap = {
|
|
61
62
|
[scope: string]: {
|
|
62
63
|
[pkgName: string]: {
|
|
63
64
|
[sharedVersion: string]: Shared;
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
67
|
};
|
|
68
|
+
export type GlobalShareScopeMap = {
|
|
69
|
+
[instanceName: string]: ShareScopeMap;
|
|
70
|
+
};
|
|
67
71
|
export type ShareInfos = {
|
|
68
72
|
[pkgName: string]: Shared;
|
|
69
73
|
};
|
|
@@ -86,10 +90,11 @@ export type LoadModuleOptions = {
|
|
|
86
90
|
};
|
|
87
91
|
export type RemoteEntryInitOptions = {
|
|
88
92
|
version: string;
|
|
93
|
+
hostId: string;
|
|
89
94
|
};
|
|
90
95
|
export type InitScope = Array<Record<string, never>>;
|
|
91
96
|
export type RemoteEntryExports = {
|
|
92
97
|
get: (id: string) => () => Promise<Module>;
|
|
93
|
-
init: (shareScope:
|
|
98
|
+
init: (shareScope: ShareScopeMap[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
|
|
94
99
|
};
|
|
95
100
|
export {};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Federation } from '../global';
|
|
2
|
+
import { GlobalShareScopeMap, Shared, ShareArgs, ShareInfos, ShareScopeMap } from '../type';
|
|
3
|
+
import { SyncWaterfallHook } from './hooks';
|
|
2
4
|
export declare function formatShare(shareArgs: ShareArgs, from: string): Shared;
|
|
3
5
|
export declare function formatShareConfigs(shareArgs: {
|
|
4
6
|
[pkgName: string]: ShareArgs;
|
|
5
7
|
}, from: string): ShareInfos;
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
8
|
+
export declare function getRegisteredShare(localShareScopeMap: ShareScopeMap, pkgName: string, shareInfo: ShareInfos[keyof ShareInfos], resolveShare: SyncWaterfallHook<{
|
|
9
|
+
shareScopeMap: ShareScopeMap;
|
|
10
|
+
scope: string;
|
|
11
|
+
pkgName: string;
|
|
12
|
+
version: string;
|
|
13
|
+
GlobalFederation: Federation;
|
|
14
|
+
resolver: () => Shared | undefined;
|
|
15
|
+
}>): Shared | void;
|
|
16
|
+
export declare function getGlobalShareScope(): GlobalShareScopeMap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/types";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/runtime",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"helpers": [
|
|
40
40
|
"./dist/helpers.cjs.d.ts"
|
|
41
41
|
],
|
|
42
|
-
"
|
|
43
|
-
"./dist/
|
|
42
|
+
"types": [
|
|
43
|
+
"./dist/types.cjs.d.ts"
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@module-federation/sdk": "0.0.
|
|
48
|
+
"@module-federation/sdk": "0.0.9"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/dist/type.cjs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/type/index";
|
|
File without changes
|
|
File without changes
|