The main store app (host) dispatches DOM events. Cart is a separate application (remote) that has an event interface that can listen for events from host or other remotes.
Goal: demonstrate a schema validation mechanism for remote module events. Remotes accept no props and instead rely entirely on window DOM events to ensure decoupling.
- Typescript support for remote modules
- Simple zod parsing of remote module events
- Lightweight events client with type safety from client -> host & host -> client with the EventClient.
- FederatedTypesPlugin with support for fetching types from remote cdn.
- Remote checkout
@ahowardtech/checkout
app published to npm and available on unpkg cdn.
This works best when using two terminal windows.
# REMOTE
cd checkout
# install dependencies
yarn install
# run storybook
yarn storybook
# build and run local server hosting federated modules
yarn build && yarn federate
# HOST
cd host-app
# install dependencies
yarn install
# run app pointing to local server hosting remote federated modules
yarn dev:local
## run app pointing to unpkg cdn hosting remote federation modules
yarn dev