FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module-federation-examples/runtime-plugins at master · jonthomp/module-federation-examples · GitHub

Latest commit

 

History

History
 
 

README.md

Runtime Plugin Examples

These examples show how runtime plugins move product policy out of Module Federation core and into composable hooks. The core runtime owns stable loading, sharing, snapshot, and factory execution semantics; runtime plugins customize policy such as request routing, fallback modules, share selection, resource loading, preload behavior, and telemetry.

Hook Coverage

Hook family Hooks Example coverage
Bootstrap beforeInit, init, apply control-sharing, remote-control, isolate-shared-dependencies, multiple-react-versions, remote-router
Remote policy beforeRequest, errorLoadRemote, afterLoadRemote remote-router, offline-remote
Share policy beforeLoadShare, resolveShare control-sharing, isolate-shared-dependencies, multiple-react-versions, remote-control
Loader policy createScript, afterLoadEntry remote-router
Factory execution onLoad multiple-react-versions
Preload policy beforePreloadRemote, generatePreloadAssets remote-router

Examples

  • control-sharing: exposes a UI for changing shared module resolver rules at runtime.
  • isolate-shared-dependencies: uses tuple runtime plugin parameters to isolate selected shared dependencies while keeping code sharing.
  • multiple-react-versions: adapts share loading and remote module execution so legacy and modern React versions can coexist.
  • offline-remote: returns a fallback module from errorLoadRemote when a remote is unavailable.
  • remote-control: changes shared loading behavior based on runtime state.
  • remote-router: rewrites remote entries, records runtime telemetry, customizes script loading, and observes preload hooks.
  • single-runtime: demonstrates single-runtime behavior for host/remote sharing.

Additional core hooks such as afterLoadShare, errorLoadShare, snapshot hooks, and bridge hooks are available for production plugins, but these examples stay focused on the hooks they exercise directly.


Back | FazBrowse Home | New Git URL