@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.
@@ -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 GlobalShareScope = {
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: GlobalShareScope[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
98
+ init: (shareScope: ShareScopeMap[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
94
99
  };
95
100
  export {};
@@ -1,7 +1,16 @@
1
- import { GlobalShareScope, Shared, ShareArgs, ShareInfos } from '../type';
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 getGlobalShare(pkgName: string, shareInfo: ShareInfos[keyof ShareInfos]): Shared | void;
7
- export declare function getGlobalShareScope(): GlobalShareScope;
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.7",
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
- "type": [
43
- "./dist/type.cjs.d.ts"
42
+ "types": [
43
+ "./dist/types.cjs.d.ts"
44
44
  ]
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.0.7"
48
+ "@module-federation/sdk": "0.0.9"
49
49
  }
50
50
  }
@@ -1 +0,0 @@
1
- export * from "./src/type/index";
File without changes
File without changes