An open API service indexing awesome lists of open source software.

https://github.com/hanford/bi-directional-mfe

Webpack 5 Microfrontend, with Relay hooks and React Suspense
https://github.com/hanford/bi-directional-mfe

react relay-hooks suspense webpack5

Last synced: 4 months ago
JSON representation

Webpack 5 Microfrontend, with Relay hooks and React Suspense

Awesome Lists containing this project

README

        

# Webpack 5 Microfrontend, Relay hooks, React Suspense

preview gif

This example demos bi-directional hosts each with their own remote components. We're sharing data aware components that use react suspense and relay hooks.

- `app1` exposes a `` component.
- `app2` exposes a `` component, built with `Modal` from app3
- `app3` exposes a `` component.
- `app4` consumes `app1`, `app2`, `app5`, `app6` exposed components, it also shares a router and composes routes from `app6`
- `app5` exposes a `` component.
- `app6` exposes it's router, with `` and `Privacy` components.
- `server` is a shimmed graphql server.

# Running Demo

Run `yarn start`. This will build and serve both `app1`, `app2` and `app3` on ports 3001, 3002 and 3003 respectively. It will also start the graphql server.

- [localhost:3001](http://localhost:3001/)
- [localhost:3002](http://localhost:3002/)
- [localhost:3003](http://localhost:3003/)
- [localhost:3004](http://localhost:3004/)
- [localhost:3005](http://localhost:3005/)
- [localhost:3006](http://localhost:3006/)
- [localhost:4000](http://localhost:4000/graphql)

[Inspiration](https://github.com/mizx/module-federation-examples/tree/master/bi-directional)