@module-federation/webpack-bundler-runtime 2.4.0 → 2.5.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.
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.cjs","names":[],"sources":["../../../../error-codes/dist/error-codes.mjs"],"sourcesContent":["//#region src/error-codes.ts\nconst RUNTIME_001 = \"RUNTIME-001\";\nconst RUNTIME_002 = \"RUNTIME-002\";\nconst RUNTIME_003 = \"RUNTIME-003\";\nconst RUNTIME_004 = \"RUNTIME-004\";\nconst RUNTIME_005 = \"RUNTIME-005\";\nconst RUNTIME_006 = \"RUNTIME-006\";\nconst RUNTIME_007 = \"RUNTIME-007\";\nconst RUNTIME_008 = \"RUNTIME-008\";\nconst RUNTIME_009 = \"RUNTIME-009\";\nconst RUNTIME_010 = \"RUNTIME-010\";\nconst RUNTIME_011 = \"RUNTIME-011\";\nconst RUNTIME_012 = \"RUNTIME-012\";\nconst TYPE_001 = \"TYPE-001\";\nconst BUILD_001 = \"BUILD-001\";\nconst BUILD_002 = \"BUILD-002\";\n\n//#endregion\nexport { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, TYPE_001 };\n//# sourceMappingURL=error-codes.mjs.map"],"mappings":";;AAYA,MAAM,cAAc"}
1
+ {"version":3,"file":"error-codes.cjs","names":[],"sources":["../../../../error-codes/dist/error-codes.mjs"],"sourcesContent":["//#region src/error-codes.ts\nconst RUNTIME_001 = \"RUNTIME-001\";\nconst RUNTIME_002 = \"RUNTIME-002\";\nconst RUNTIME_003 = \"RUNTIME-003\";\nconst RUNTIME_004 = \"RUNTIME-004\";\nconst RUNTIME_005 = \"RUNTIME-005\";\nconst RUNTIME_006 = \"RUNTIME-006\";\nconst RUNTIME_007 = \"RUNTIME-007\";\nconst RUNTIME_008 = \"RUNTIME-008\";\nconst RUNTIME_009 = \"RUNTIME-009\";\nconst RUNTIME_010 = \"RUNTIME-010\";\nconst RUNTIME_011 = \"RUNTIME-011\";\nconst RUNTIME_012 = \"RUNTIME-012\";\nconst RUNTIME_013 = \"RUNTIME-013\";\nconst RUNTIME_014 = \"RUNTIME-014\";\nconst RUNTIME_015 = \"RUNTIME-015\";\nconst TYPE_001 = \"TYPE-001\";\nconst BUILD_001 = \"BUILD-001\";\nconst BUILD_002 = \"BUILD-002\";\n\n//#endregion\nexport { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 };\n//# sourceMappingURL=error-codes.mjs.map"],"mappings":";;AAYA,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.js","names":[],"sources":["../../../../error-codes/dist/error-codes.mjs"],"sourcesContent":["//#region src/error-codes.ts\nconst RUNTIME_001 = \"RUNTIME-001\";\nconst RUNTIME_002 = \"RUNTIME-002\";\nconst RUNTIME_003 = \"RUNTIME-003\";\nconst RUNTIME_004 = \"RUNTIME-004\";\nconst RUNTIME_005 = \"RUNTIME-005\";\nconst RUNTIME_006 = \"RUNTIME-006\";\nconst RUNTIME_007 = \"RUNTIME-007\";\nconst RUNTIME_008 = \"RUNTIME-008\";\nconst RUNTIME_009 = \"RUNTIME-009\";\nconst RUNTIME_010 = \"RUNTIME-010\";\nconst RUNTIME_011 = \"RUNTIME-011\";\nconst RUNTIME_012 = \"RUNTIME-012\";\nconst TYPE_001 = \"TYPE-001\";\nconst BUILD_001 = \"BUILD-001\";\nconst BUILD_002 = \"BUILD-002\";\n\n//#endregion\nexport { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, TYPE_001 };\n//# sourceMappingURL=error-codes.mjs.map"],"mappings":";AAYA,MAAM,cAAc"}
1
+ {"version":3,"file":"error-codes.js","names":[],"sources":["../../../../error-codes/dist/error-codes.mjs"],"sourcesContent":["//#region src/error-codes.ts\nconst RUNTIME_001 = \"RUNTIME-001\";\nconst RUNTIME_002 = \"RUNTIME-002\";\nconst RUNTIME_003 = \"RUNTIME-003\";\nconst RUNTIME_004 = \"RUNTIME-004\";\nconst RUNTIME_005 = \"RUNTIME-005\";\nconst RUNTIME_006 = \"RUNTIME-006\";\nconst RUNTIME_007 = \"RUNTIME-007\";\nconst RUNTIME_008 = \"RUNTIME-008\";\nconst RUNTIME_009 = \"RUNTIME-009\";\nconst RUNTIME_010 = \"RUNTIME-010\";\nconst RUNTIME_011 = \"RUNTIME-011\";\nconst RUNTIME_012 = \"RUNTIME-012\";\nconst RUNTIME_013 = \"RUNTIME-013\";\nconst RUNTIME_014 = \"RUNTIME-014\";\nconst RUNTIME_015 = \"RUNTIME-015\";\nconst TYPE_001 = \"TYPE-001\";\nconst BUILD_001 = \"BUILD-001\";\nconst BUILD_002 = \"BUILD-002\";\n\n//#endregion\nexport { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 };\n//# sourceMappingURL=error-codes.mjs.map"],"mappings":";AAYA,MAAM,cAAc"}
@@ -4,13 +4,13 @@ import { SyncWaterfallHook } from "./utils/hooks/syncWaterfallHook.js";
4
4
  import { AsyncWaterfallHook } from "./utils/hooks/asyncWaterfallHooks.js";
5
5
  import { PluginSystem } from "./utils/hooks/pluginSystem.js";
6
6
  import { CallFrom, InitScope, Options, Remote, RemoteEntryExports, RemoteEntryInitOptions, RemoteInfo, ShareInfos, ShareScopeMap, Shared, UserOptions } from "./type/config.js";
7
- import { PreloadRemoteArgs } from "./type/preload.js";
7
+ import { PreloadRemoteArgs, ResourceLoadContext } from "./type/preload.js";
8
8
  import { RemoteHandler } from "./remote/index.js";
9
9
  import { SharedHandler } from "./shared/index.js";
10
10
  import { SnapshotHandler } from "./plugins/snapshot/SnapshotHandler.js";
11
11
  import { getRemoteEntry } from "./utils/load.js";
12
- import { Module$1 } from "./module/index.js";
13
- import { CreateScriptHookReturn, GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
12
+ import { Module$1, RemoteModuleFactory } from "./module/index.js";
13
+ import { CreateLinkHookReturnDom, CreateScriptHookReturn, GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
14
14
 
15
15
  //#region ../runtime-core/dist/core.d.ts
16
16
  //#region src/core.d.ts
@@ -72,6 +72,7 @@ declare class ModuleFederation {
72
72
  * (e.g. preloadRemote / loading remoteEntry).
73
73
  */
74
74
  remoteInfo?: RemoteInfo;
75
+ resourceContext?: ResourceLoadContext;
75
76
  }], CreateScriptHookReturn>;
76
77
  createLink: SyncHook<[{
77
78
  url: string;
@@ -82,8 +83,9 @@ declare class ModuleFederation {
82
83
  * (e.g. preloadRemote / loading remoteEntry).
83
84
  */
84
85
  remoteInfo?: RemoteInfo;
85
- }], void | HTMLLinkElement>;
86
- fetch: AsyncHook<[string, RequestInit, (RemoteInfo | undefined)?], false | void | Promise<Response>>;
86
+ resourceContext?: ResourceLoadContext;
87
+ }], CreateLinkHookReturnDom>;
88
+ fetch: AsyncHook<[string, RequestInit, (RemoteInfo | undefined)?, (ResourceLoadContext | undefined)?], false | void | Promise<Response>>;
87
89
  loadEntryError: AsyncHook<[{
88
90
  getRemoteEntry: typeof getRemoteEntry;
89
91
  origin: ModuleFederation;
@@ -92,11 +94,65 @@ declare class ModuleFederation {
92
94
  globalLoading: Record<string, Promise<void | RemoteEntryExports> | undefined>;
93
95
  uniqueKey: string;
94
96
  }], Promise<Promise<RemoteEntryExports | undefined> | undefined>>;
97
+ afterLoadEntry: AsyncHook<[{
98
+ origin: ModuleFederation;
99
+ remoteInfo: RemoteInfo;
100
+ remoteEntryExports?: false | void | RemoteEntryExports | undefined;
101
+ error?: unknown;
102
+ recovered?: boolean;
103
+ }], void>;
104
+ beforeInitRemote: AsyncHook<[{
105
+ id?: string;
106
+ remoteInfo: RemoteInfo;
107
+ remoteSnapshot?: ModuleInfo;
108
+ origin: ModuleFederation;
109
+ }], void>;
110
+ afterInitRemote: AsyncHook<[{
111
+ id?: string;
112
+ remoteInfo: RemoteInfo;
113
+ remoteSnapshot?: ModuleInfo;
114
+ remoteEntryExports?: RemoteEntryExports;
115
+ error?: unknown;
116
+ cached?: boolean;
117
+ origin: ModuleFederation;
118
+ }], void>;
119
+ beforeGetExpose: AsyncHook<[{
120
+ id: string;
121
+ expose: string;
122
+ moduleInfo: RemoteInfo;
123
+ remoteEntryExports: RemoteEntryExports;
124
+ origin: ModuleFederation;
125
+ }], void>;
126
+ afterGetExpose: AsyncHook<[{
127
+ id: string;
128
+ expose: string;
129
+ moduleInfo: RemoteInfo;
130
+ remoteEntryExports: RemoteEntryExports;
131
+ moduleFactory?: RemoteModuleFactory;
132
+ error?: unknown;
133
+ origin: ModuleFederation;
134
+ }], void>;
135
+ beforeExecuteFactory: AsyncHook<[{
136
+ id: string;
137
+ expose: string;
138
+ moduleInfo: RemoteInfo;
139
+ loadFactory: boolean;
140
+ origin: ModuleFederation;
141
+ }], void>;
142
+ afterExecuteFactory: AsyncHook<[{
143
+ id: string;
144
+ expose: string;
145
+ moduleInfo: RemoteInfo;
146
+ loadFactory: boolean;
147
+ exposeModule?: unknown;
148
+ error?: unknown;
149
+ origin: ModuleFederation;
150
+ }], void>;
95
151
  getModuleFactory: AsyncHook<[{
96
152
  remoteEntryExports: RemoteEntryExports;
97
153
  expose: string;
98
154
  moduleInfo: RemoteInfo;
99
- }], Promise<(() => Promise<Module$1>) | undefined>>;
155
+ }], RemoteModuleFactory | Promise<RemoteModuleFactory | undefined> | undefined>;
100
156
  }>;
101
157
  bridgeHook: PluginSystem<{
102
158
  beforeBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>;
@@ -5,6 +5,7 @@ import { ModuleInfo } from "@module-federation/sdk";
5
5
  //#region ../runtime-core/dist/module/index.d.ts
6
6
  //#region src/module/index.d.ts
7
7
  type ModuleOptions = ConstructorParameters<typeof Module$1>[0];
8
+ type RemoteModuleFactory = () => unknown | Promise<unknown>;
8
9
  declare class Module$1 {
9
10
  remoteInfo: RemoteInfo;
10
11
  inited: boolean;
@@ -20,13 +21,13 @@ declare class Module$1 {
20
21
  remoteInfo: RemoteInfo;
21
22
  host: ModuleFederation;
22
23
  });
23
- getEntry(): Promise<RemoteEntryExports>;
24
- init(id?: string, remoteSnapshot?: ModuleInfo, rawInitScope?: InitScope): Promise<RemoteEntryExports>;
24
+ getEntry(expose?: string): Promise<RemoteEntryExports>;
25
+ init(id?: string, remoteSnapshot?: ModuleInfo, rawInitScope?: InitScope, expose?: string): Promise<RemoteEntryExports>;
25
26
  get(id: string, expose: string, options?: {
26
27
  loadFactory?: boolean;
27
- }, remoteSnapshot?: ModuleInfo): Promise<any>;
28
+ }, remoteSnapshot?: ModuleInfo): Promise<unknown>;
28
29
  private wraperFactory;
29
30
  } //#endregion
30
31
  //#endregion
31
- export { Module$1, ModuleOptions };
32
+ export { Module$1, ModuleOptions, RemoteModuleFactory };
32
33
  //# sourceMappingURL=index.d.ts.map
@@ -2,6 +2,7 @@ import { AsyncHook } from "../../utils/hooks/asyncHook.js";
2
2
  import { AsyncWaterfallHook } from "../../utils/hooks/asyncWaterfallHooks.js";
3
3
  import { PluginSystem } from "../../utils/hooks/pluginSystem.js";
4
4
  import { Options, Remote } from "../../type/config.js";
5
+ import { ResourceLoadInitiator } from "../../type/preload.js";
5
6
  import { getGlobalSnapshot } from "../../global.js";
6
7
  import { ModuleFederation } from "../../core.js";
7
8
  import { GlobalModuleInfo, Manifest, ModuleInfo } from "@module-federation/sdk";
@@ -16,6 +17,7 @@ declare class SnapshotHandler {
16
17
  beforeLoadRemoteSnapshot: AsyncHook<[{
17
18
  options: Options;
18
19
  moduleInfo: Remote;
20
+ origin: ModuleFederation;
19
21
  }], void>;
20
22
  loadSnapshot: AsyncWaterfallHook<{
21
23
  options: Options;
@@ -46,11 +48,11 @@ declare class SnapshotHandler {
46
48
  loadRemoteSnapshotInfo({
47
49
  moduleInfo,
48
50
  id,
49
- expose
51
+ initiator
50
52
  }: {
51
53
  moduleInfo: Remote;
52
54
  id?: string;
53
- expose?: string;
55
+ initiator?: ResourceLoadInitiator;
54
56
  }): Promise<{
55
57
  remoteSnapshot: ModuleInfo;
56
58
  globalSnapshot: GlobalModuleInfo;
@@ -61,6 +63,7 @@ declare class SnapshotHandler {
61
63
  remoteSnapshot: GlobalModuleInfo[string] | undefined;
62
64
  };
63
65
  private getManifestJson;
66
+ private loadManifestSnapshot;
64
67
  } //#endregion
65
68
  //#endregion
66
69
  export { SnapshotHandler };
@@ -4,7 +4,7 @@ import { SyncWaterfallHook } from "../utils/hooks/syncWaterfallHook.js";
4
4
  import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
5
5
  import { PluginSystem } from "../utils/hooks/pluginSystem.js";
6
6
  import { CallFrom, Options, Remote, RemoteEntryExports, RemoteInfo, UserOptions } from "../type/config.js";
7
- import { PreloadAssets, PreloadOptions, PreloadRemoteArgs } from "../type/preload.js";
7
+ import { PreloadAssets, PreloadOptions, PreloadRemoteArgs, PreloadRemoteResult } from "../type/preload.js";
8
8
  import { ModuleFederation } from "../core.js";
9
9
  import { Module$1, ModuleOptions } from "../module/index.js";
10
10
  import { GlobalModuleInfo, ModuleInfo } from "@module-federation/sdk";
@@ -41,6 +41,15 @@ declare class RemoteHandler {
41
41
  options: Options;
42
42
  origin: ModuleFederation;
43
43
  }>;
44
+ afterMatchRemote: AsyncHook<[{
45
+ id: string;
46
+ options: Options;
47
+ remote?: Remote;
48
+ expose?: string;
49
+ remoteInfo?: RemoteInfo;
50
+ error?: unknown;
51
+ origin: ModuleFederation;
52
+ }], void>;
44
53
  onLoad: AsyncHook<[{
45
54
  id: string;
46
55
  expose: string;
@@ -51,6 +60,18 @@ declare class RemoteHandler {
51
60
  exposeModule: any;
52
61
  exposeModuleFactory: any;
53
62
  moduleInstance: Module$1;
63
+ }], unknown>;
64
+ afterLoadRemote: AsyncHook<[{
65
+ id: string;
66
+ expose?: string;
67
+ remote?: RemoteInfo;
68
+ options?: {
69
+ loadFactory?: boolean;
70
+ from?: CallFrom;
71
+ };
72
+ error?: unknown;
73
+ recovered?: boolean;
74
+ origin: ModuleFederation;
54
75
  }], void>;
55
76
  handlePreloadModule: SyncHook<[{
56
77
  id: string;
@@ -66,6 +87,8 @@ declare class RemoteHandler {
66
87
  options?: any;
67
88
  from: CallFrom;
68
89
  lifecycle: "beforeRequest" | "beforeLoadShare" | "afterResolve" | "onLoad";
90
+ remote?: RemoteInfo;
91
+ expose?: string;
69
92
  origin: ModuleFederation;
70
93
  }], unknown>;
71
94
  beforePreloadRemote: AsyncHook<[{
@@ -81,16 +104,19 @@ declare class RemoteHandler {
81
104
  remoteSnapshot: ModuleInfo;
82
105
  globalSnapshot: GlobalModuleInfo;
83
106
  }], Promise<PreloadAssets>>;
84
- afterPreloadRemote: AsyncHook<{
107
+ afterPreloadRemote: AsyncHook<[{
85
108
  preloadOps: Array<PreloadRemoteArgs>;
86
109
  options: Options;
87
110
  origin: ModuleFederation;
88
- }, false | void | Promise<false | void>>;
111
+ results: PreloadRemoteResult[];
112
+ error?: unknown;
113
+ }], false | void | Promise<false | void>>;
89
114
  loadEntry: AsyncHook<[{
115
+ origin: ModuleFederation;
90
116
  loaderHook: ModuleFederation["loaderHook"];
91
117
  remoteInfo: RemoteInfo;
92
118
  remoteEntryExports?: RemoteEntryExports;
93
- }], Promise<RemoteEntryExports>>;
119
+ }], void | RemoteEntryExports | Promise<void | RemoteEntryExports>>;
94
120
  }>;
95
121
  constructor(host: ModuleFederation);
96
122
  formatAndRegisterRemote(globalOptions: Options, userOptions: UserOptions): Remote[];
@@ -1,3 +1,4 @@
1
+ import { SyncHook } from "../utils/hooks/syncHook.js";
1
2
  import { AsyncHook } from "../utils/hooks/asyncHook.js";
2
3
  import { SyncWaterfallHook } from "../utils/hooks/syncWaterfallHook.js";
3
4
  import { AsyncWaterfallHook } from "../utils/hooks/asyncWaterfallHooks.js";
@@ -26,6 +27,25 @@ declare class SharedHandler {
26
27
  origin: ModuleFederation;
27
28
  }>;
28
29
  loadShare: AsyncHook<[ModuleFederation, string, ShareInfos], false | void | Promise<false | void>>;
30
+ afterLoadShare: SyncHook<[{
31
+ pkgName: string;
32
+ shareInfo?: Partial<Shared>;
33
+ selectedShared?: Partial<Shared>;
34
+ shared: Options["shared"];
35
+ shareScopeMap: ShareScopeMap;
36
+ lifecycle: "loadShare" | "loadShareSync";
37
+ origin: ModuleFederation;
38
+ }], void>;
39
+ errorLoadShare: SyncHook<[{
40
+ pkgName: string;
41
+ shareInfo?: Partial<Shared>;
42
+ shared: Options["shared"];
43
+ shareScopeMap: ShareScopeMap;
44
+ lifecycle: "loadShare" | "loadShareSync";
45
+ origin: ModuleFederation;
46
+ error?: unknown;
47
+ recovered?: boolean;
48
+ }], void>;
29
49
  resolveShare: SyncWaterfallHook<{
30
50
  shareScopeMap: ShareScopeMap;
31
51
  scope: string;
@@ -48,6 +68,8 @@ declare class SharedHandler {
48
68
  }>;
49
69
  initTokens: InitTokens;
50
70
  constructor(host: ModuleFederation);
71
+ private emitAfterLoadShare;
72
+ private emitErrorLoadShare;
51
73
  registerShared(globalOptions: Options, userOptions: UserOptions): {
52
74
  newShareInfos: ShareInfos;
53
75
  allShareInfos: {
@@ -16,6 +16,30 @@ type PreloadOptions = Array<{
16
16
  remote: Remote;
17
17
  preloadConfig: PreloadConfig;
18
18
  }>;
19
+ type ResourceLoadInitiator = 'loadRemote' | 'preloadRemote';
20
+ type ResourceLoadType = 'manifest' | 'remoteEntry' | 'js' | 'css';
21
+ interface ResourceLoadContext {
22
+ initiator: ResourceLoadInitiator;
23
+ id: string;
24
+ resourceType: ResourceLoadType;
25
+ url?: string;
26
+ }
27
+ type PreloadAssetStatus = 'success' | 'error' | 'timeout' | 'cached';
28
+ interface PreloadAssetResult {
29
+ url: string;
30
+ status: PreloadAssetStatus;
31
+ resourceType: ResourceLoadType;
32
+ initiator: ResourceLoadInitiator;
33
+ id: string;
34
+ error?: unknown;
35
+ }
36
+ interface PreloadRemoteResult {
37
+ remote: Remote;
38
+ remoteInfo: RemoteInfo;
39
+ preloadConfig: PreloadConfig;
40
+ id: string;
41
+ results: PreloadAssetResult[];
42
+ }
19
43
  type EntryAssets = {
20
44
  name: string;
21
45
  url: string;
@@ -27,5 +51,5 @@ interface PreloadAssets {
27
51
  entryAssets: Array<EntryAssets>;
28
52
  } //#endregion
29
53
  //#endregion
30
- export { EntryAssets, PreloadAssets, PreloadConfig, PreloadOptions, PreloadRemoteArgs, depsPreloadArg };
54
+ export { EntryAssets, PreloadAssetResult, PreloadAssetStatus, PreloadAssets, PreloadConfig, PreloadOptions, PreloadRemoteArgs, PreloadRemoteResult, ResourceLoadContext, ResourceLoadInitiator, ResourceLoadType, depsPreloadArg };
31
55
  //# sourceMappingURL=preload.d.ts.map
@@ -1,3 +1,3 @@
1
1
  import { CallFrom, GlobalShareScopeMap, InitScope, InitTokens, Optional, Options, Remote, RemoteEntryExports, RemoteEntryInitOptions, RemoteInfo, RemoteInfoCommon, ShareArgs, ShareInfos, ShareScopeMap, ShareStrategy, Shared, SharedConfig, SharedGetter, TreeShakingArgs, UserOptions } from "./type/config.js";
2
- import { EntryAssets, PreloadAssets, PreloadConfig, PreloadOptions, PreloadRemoteArgs, depsPreloadArg } from "./type/preload.js";
2
+ import { EntryAssets, PreloadAssetResult, PreloadAssetStatus, PreloadAssets, PreloadConfig, PreloadOptions, PreloadRemoteArgs, PreloadRemoteResult, ResourceLoadContext, ResourceLoadInitiator, ResourceLoadType, depsPreloadArg } from "./type/preload.js";
3
3
  import { ModuleFederationRuntimePlugin } from "./type/plugin.js";
@@ -2,8 +2,8 @@ import { SyncHook } from "./syncHook.js";
2
2
 
3
3
  //#region ../runtime-core/dist/utils/hooks/asyncWaterfallHooks.d.ts
4
4
  //#region src/utils/hooks/asyncWaterfallHooks.d.ts
5
- type CallbackReturnType<T> = T | Promise<T>;
6
- declare class AsyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], CallbackReturnType<T>> {
5
+ type CallbackReturnType<T> = T | void | Promise<T | void>;
6
+ declare class AsyncWaterfallHook<T extends object> extends SyncHook<[T], CallbackReturnType<T>> {
7
7
  onerror: (errMsg: string | Error | unknown) => void;
8
8
  constructor(type: string);
9
9
  emit(data: T): Promise<T>;
@@ -2,7 +2,7 @@ import { SyncHook } from "./syncHook.js";
2
2
 
3
3
  //#region ../runtime-core/dist/utils/hooks/syncWaterfallHook.d.ts
4
4
  //#region src/utils/hooks/syncWaterfallHook.d.ts
5
- declare class SyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], T> {
5
+ declare class SyncWaterfallHook<T extends Record<string, any>> extends SyncHook<[T], T | void> {
6
6
  onerror: (errMsg: string | Error | unknown) => void;
7
7
  constructor(type: string);
8
8
  emit(data: T): T;
@@ -1,4 +1,5 @@
1
1
  import { RemoteEntryExports, RemoteInfo } from "../type/config.js";
2
+ import { ResourceLoadContext } from "../type/preload.js";
2
3
  import { ModuleFederation } from "../core.js";
3
4
 
4
5
  //#region ../runtime-core/dist/utils/load.d.ts
@@ -9,6 +10,7 @@ declare function getRemoteEntry(params: {
9
10
  remoteEntryExports?: RemoteEntryExports | undefined;
10
11
  getEntryUrl?: (url: string) => string;
11
12
  _inErrorHandling?: boolean;
13
+ resourceContext?: ResourceLoadContext;
12
14
  }): Promise<RemoteEntryExports | false | void>;
13
15
  //#endregion
14
16
  export { getRemoteEntry };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "@module-federation/webpack-bundler-runtime",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Module Federation Runtime for webpack",
@@ -26,9 +26,9 @@
26
26
  "module": "./dist/index.js",
27
27
  "types": "./dist/index.d.ts",
28
28
  "dependencies": {
29
- "@module-federation/runtime": "2.4.0",
30
- "@module-federation/sdk": "2.4.0",
31
- "@module-federation/error-codes": "2.4.0"
29
+ "@module-federation/runtime": "2.5.0",
30
+ "@module-federation/error-codes": "2.5.0",
31
+ "@module-federation/sdk": "2.5.0"
32
32
  },
33
33
  "exports": {
34
34
  ".": {