Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fully unmounting entire application #676

Closed
joeldenning opened this issue Feb 17, 2020 · 0 comments · Fixed by #680
Closed

Fully unmounting entire application #676

joeldenning opened this issue Feb 17, 2020 · 0 comments · Fixed by #680

Comments

@joeldenning
Copy link

Hi there 👋

I'm the maintainer of single-spa, the most popular open source microfrontends framework.

We recently created https://github.com/single-spa/single-spa-dojo, which is the adapter layer needed for dojo applications to participate in a single-spa microfrontends web app.

To do so, we need to be able to fully unmount a Dojo application, including calling all onDetach / destroy lifecycles. I have been unable to find a way to do this in the dojo documentation and source code. As a workaround we are doing renderer(<div style="display: none"></div>) on the same div where dojo is mounted. The problem is that this does not actually call the onDetach lifecyle. You can see more detail at single-spa/single-spa-dojo#5

The closest thing I've been able to find in the source code for this is the DeleteDomApplication interface inside of vdom.ts:

framework/src/core/vdom.ts

Lines 1766 to 1773 in 824a7b3

} else if (item.type === 'delete') {
const { current } = item;
const { exitAnimation, exitAnimationActive } = current.node.properties;
if (_mountOptions.transition && exitAnimation && exitAnimation !== true) {
_mountOptions.transition.exit(current.domNode as HTMLElement, exitAnimation, exitAnimationActive);
} else {
current.domNode!.parentNode!.removeChild(current.domNode!);
}

Is full unmounting possible?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant