@module-federation/runtime 0.0.0-next-20240102063242 → 0.0.0-next-20240103032717

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,7 +29,6 @@ export interface SharedConfig {
29
29
  singleton?: boolean;
30
30
  requiredVersion: false | string;
31
31
  eager?: boolean;
32
- strictVersion?: boolean;
33
32
  }
34
33
  type SharedBaseArgs = {
35
34
  version: string;
@@ -58,16 +57,13 @@ export type Shared = {
58
57
  eager?: boolean;
59
58
  strategy: 'version-first' | 'loaded-first';
60
59
  };
61
- export type ShareScopeMap = {
60
+ export type GlobalShareScope = {
62
61
  [scope: string]: {
63
62
  [pkgName: string]: {
64
63
  [sharedVersion: string]: Shared;
65
64
  };
66
65
  };
67
66
  };
68
- export type GlobalShareScopeMap = {
69
- [instanceName: string]: ShareScopeMap;
70
- };
71
67
  export type ShareInfos = {
72
68
  [pkgName: string]: Shared;
73
69
  };
@@ -91,8 +87,9 @@ export type LoadModuleOptions = {
91
87
  export type RemoteEntryInitOptions = {
92
88
  version: string;
93
89
  };
90
+ export type InitScope = Array<Record<string, never>>;
94
91
  export type RemoteEntryExports = {
95
92
  get: (id: string) => () => Promise<Module>;
96
- init: (shareScope: ShareScopeMap[string], initScope?: Array<Record<string, any>>, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
93
+ init: (shareScope: GlobalShareScope[string], initScope?: InitScope, remoteEntryInitOPtions?: RemoteEntryInitOptions) => void;
97
94
  };
98
95
  export {};
@@ -9,7 +9,7 @@ type SnapshotLifeCycle = SnapshotHandler['hooks']['lifecycle'];
9
9
  type SnapshotLifeCycleCyclePartial = Partial<{
10
10
  [k in keyof SnapshotLifeCycle]: Parameters<SnapshotLifeCycle[k]['on']>[0];
11
11
  }>;
12
- type ModuleLifeCycle = Module['loaderHook']['lifecycle'];
12
+ type ModuleLifeCycle = Module['host']['loaderHook']['lifecycle'];
13
13
  type ModuleLifeCycleCyclePartial = Partial<{
14
14
  [k in keyof ModuleLifeCycle]: Parameters<ModuleLifeCycle[k]['on']>[0];
15
15
  }>;
@@ -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'] | Module['loaderHook']>): void;
4
+ export declare function registerPlugins(plugins: UserOptions['plugins'], hookInstances: Array<FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | Module['host']['loaderHook']>): void;
@@ -1,16 +1,7 @@
1
- import { Federation } from '../global';
2
- import { GlobalShareScopeMap, Shared, ShareArgs, ShareInfos, ShareScopeMap } from '../type';
3
- import { SyncWaterfallHook } from './hooks';
1
+ import { GlobalShareScope, Shared, ShareArgs, ShareInfos } from '../type';
4
2
  export declare function formatShare(shareArgs: ShareArgs, from: string): Shared;
5
3
  export declare function formatShareConfigs(shareArgs: {
6
4
  [pkgName: string]: ShareArgs;
7
5
  }, from: string): ShareInfos;
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;
6
+ export declare function getGlobalShare(pkgName: string, shareInfo: ShareInfos[keyof ShareInfos]): Shared | void;
7
+ export declare function getGlobalShareScope(): GlobalShareScope;
@@ -0,0 +1 @@
1
+ export * from "./src/type/index";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.0.0-next-20240102063242",
3
+ "version": "0.0.0-next-20240103032717",
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
- "types": [
43
- "./dist/types.cjs.d.ts"
42
+ "type": [
43
+ "./dist/type.cjs.d.ts"
44
44
  ]
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.0.0-next-20240102063242"
48
+ "@module-federation/sdk": "0.0.0-next-20240103032717"
49
49
  }
50
50
  }
@@ -1 +0,0 @@
1
- export * from "./src/types";
File without changes
File without changes