Skip to content

Conversation

@MattCheely
Copy link
Collaborator

@MattCheely MattCheely commented Jan 5, 2026

This adds new WorkerPool and WorkerClient classes which are analagous with the frame-router and Client classes, respectively. The client classes have been refactored to share a common base implementation (MfeClient). The WorkerPool class uses a base HostManager class, which will be incorporated into the host side of iframe handling in a future update.

Getting the worker classes well documented involved some other overall tweaks to doc comments in various places, and moving a few types around.

When reviewing the changes to iframe-coordinator-cli or docs, I recommend running:

npm run build && npm run doc && npm run start-client-example

And then opening the ifc-cli dev server to see the new worker feature and docs (via the icons in the top right).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new base class for managing the host side of client<->host messaging. It is used for web workers, but is not yet used for the iframe host, as I want to be very cautious on stability on that side. I will add updating frame-router to make use of this to the roadmap for the next major release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously just Client in client.ts (It is still exported as Client from client.ts for compatibility)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously where all of the iframe client logic was implemented, but it is now a proxy for exports of the different client related types and classes, like host.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file mainly servers to clearly group the various message types in the project documentation. IMO this is much clearer than grouping them under host and client, since they are used by both sides in different contexts.

* message is received.
*/
export type EnvDataHandler = (envData: EnvData) => void;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved into MfeClient.ts to improve documentation.

@MattCheely MattCheely changed the title chore(web-workers): Add web-worker support feat(web-workers): Add web-worker support Jan 5, 2026
This adds new `WorkerPool` and `WorkerClient` classes which are analagous
with the `frame-router` and `Client` classes, respectively. The client
classes have been refactored to share a common base implementation. The
`WorkerPool` class uses a base `HostManager` class, which will be
incorporated into the host side of iframe handling in a future update.
@MattCheely MattCheely merged commit 45b3ef6 into main Jan 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants