Benjamin-Coleman / single-spa-unload-issue

Simple demo app to repro issue when a broken MFE is unable to be unloaded and set back into NOT_LOADED state if it enters SKIP_BECAUSE_BROKEN state

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

single-spa-unload-app-repro

Demo application using https://github.com/react-microfrontends as base to repro behavior where a MFE that enters SKIP_BECAUSE_BROKEN status is unable to use unloadApplication to revert the state back to NOT_LOADED and it remains in SKIP_BECAUSE_BROKEN state

Setup

  • Run root-config app by installing with yarn and run yarn start
  • Application runs on localhost:3000
  • Either run the planets MFE with by installing and starting on port 8080 or import override with steps from README.md in planets MFE and point to any JS file that is not a legitimate single-spa application with the proper lifecycle methods exported.
  • Once running, click on planets navigation item leading to broken MFE, then back to root-config or any other MFE.
  • MFE will attempt to unload the planets app in 10 seconds (noted in console)
  • Use single-spa Inspector browser extension to note the planets MFE status that remains in SKIP_BECAUSE_BROKEN state
localStorage.setItem("devtools", true);

Refresh the page. Click on the tan / beige rectangle:

image

Set an import map override to 9001.

image

About

Simple demo app to repro issue when a broken MFE is unable to be unloaded and set back into NOT_LOADED state if it enters SKIP_BECAUSE_BROKEN state


Languages

Language:JavaScript 84.1%Language:EJS 15.2%Language:Shell 0.7%