-
Notifications
You must be signed in to change notification settings - Fork 22
feat(web-workers): Add web-worker support #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; | ||
|
|
There was a problem hiding this comment.
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.
89e76b2 to
4b5068d
Compare
4b5068d to
fb84d96
Compare
fb84d96 to
118e9ac
Compare
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.
118e9ac to
12e01f0
Compare
This adds new
WorkerPoolandWorkerClientclasses which are analagous with theframe-routerandClientclasses, respectively. The client classes have been refactored to share a common base implementation (MfeClient). TheWorkerPoolclass uses a baseHostManagerclass, 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-cliordocs, I recommend running:npm run build && npm run doc && npm run start-client-exampleAnd then opening the ifc-cli dev server to see the new worker feature and docs (via the icons in the top right).