Skip to content

Commit

Permalink
fix(runtime): correct type structure for preload remote hook (#2515)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed May 21, 2024
1 parent d1d9809 commit 103cd07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-items-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/runtime': patch
---

fix types for beforePreloadRemote args hook
16 changes: 10 additions & 6 deletions packages/runtime/src/remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ export class RemoteHandler {
],
void | unknown
>('errorLoadRemote'),
beforePreloadRemote: new AsyncHook<{
preloadOps: Array<PreloadRemoteArgs>;
options: Options;
origin: FederationHost;
}>(),
beforePreloadRemote: new AsyncHook<
[
{
preloadOps: Array<PreloadRemoteArgs>;
options: Options;
origin: FederationHost;
},
]
>('beforePreloadRemote'),
generatePreloadAssets: new AsyncHook<
[
{
Expand Down Expand Up @@ -195,7 +199,7 @@ export class RemoteHandler {
const { host } = this;

await this.hooks.lifecycle.beforePreloadRemote.emit({
preloadOptions,
preloadOps: preloadOptions,
options: host.options,
origin: host,
});
Expand Down

0 comments on commit 103cd07

Please sign in to comment.