Comments (8)
Maybe using MutationObserver is worthwhile for this? basically, observe for if/when the childList is empty. Could also possibly done with ResizeObserver since it may not just be because children were removed... Just thinking.
from single-spa-inspector.
I don't think we need MutationObserver here. Can't we just hook into the click event for the Mount and Unmount buttons (here) and call a prop function to setState inside of apps.component in order to trigger this effect to clean up?
Seems like since we're the ones controlling the Unmount button that we should be able to manage the state needed to get the overlay unmounted.
from single-spa-inspector.
My thought process is that the devtools should display if the app has a visible size, maybe even using some threshold to determine if it should be shown. Any number of things can cause an app to become unmounted to so just hooking into the buttons doesn't seem ideal, but if there is a way to hook into the activity functions that would work well too.
from single-spa-inspector.
Single-spa’s app change event (https://single-spa.js.org/docs/api.html#app-change-event) might be useful then? I’m very averse to introducing a mutation observer when we have 100% control over all of the code involved
from single-spa-inspector.
Ah, hmm, it may be as easy as changing the event we're listening to from the routing event to the app change event then?
Since that event I believe causes a rerender, which should in turn add/remove overlays? or am I wrong there?
from single-spa-inspector.
Yea, app-change looks like exactly what we want to use here. No MutationObserver then!
from single-spa-inspector.
Wait but single-spa:routing-event
fires every time that app-change is fired, plus more. I did not realize that we were already listening to it. Listening to app-change won't help then. The bug must be something else?
from single-spa-inspector.
Hmm possibly. I think this is more like a missed feature, not quite a bug. I'll look into whether still using routing-event
is enough. I personally haven't had time to dig into it.
from single-spa-inspector.
Related Issues (20)
- Special chars in app names not properly escaped
- Add ability to toggle on/off *all* of the overlays at once HOT 1
- Upgrade to web-ext@3 HOT 2
- auto deployments HOT 6
- Overlay toggles are full-width in Chrome
- Overlays do not resize dynamically HOT 7
- Order of apps is reversed
- Submit/deploy as Edge extension HOT 3
- Overlays are no longer colored by a generated value from their names HOT 1
- Not showing utility mfe or root-config (SystemJS modules that are not single-spa apps) HOT 2
- Temporary disable an override HOT 1
- Enhancement: Point to an import-map.json for easy Overrides HOT 3
- Inspector display no table rows HOT 4
- How to disable single-spa-inspector in production mode? HOT 2
- Parcels don't show up in the list. HOT 5
- extention not working for chrome HOT 2
- Impossible to see Utility module HOT 1
- RFC: update single-spa-inspector HOT 2
- Inspector bug report
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from single-spa-inspector.