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

Find legitimate unmount strategy #5

Closed
joeldenning opened this issue Feb 17, 2020 · 3 comments
Closed

Find legitimate unmount strategy #5

joeldenning opened this issue Feb 17, 2020 · 3 comments

Comments

@joeldenning
Copy link
Member

joeldenning commented Feb 17, 2020

Our current implementation does not call the lifecycle functions onDetach and destroy when the application is unmounted. This is a big problem because listeners aren't cleaned up, which is both a memory leak and leads to buggy behaviors.

Current implementation:

// TODO - find a way to unmount the previously rendered
const renderResult = opts.renderer(() =>
opts.v("div", { style: "display: none;" })
);
renderResult.mount(opts.mountOptions);
});

@joeldenning
Copy link
Member Author

joeldenning commented Feb 23, 2020

This was now added to dojo in dojo/framework#680. Waiting for a release and then we'll update single-spa-dojo to use the new renderResult.unmount() function.

@eithe
Copy link

eithe commented Oct 8, 2021

Hi, any updates on this?

@joeldenning
Copy link
Member Author

I released https://github.com/single-spa/single-spa-dojo/releases/tag/v2.0.0 which uses dojo's unmount function. See https://github.com/single-spa/single-spa-dojo/releases/tag/v2.0.0 for more details. I didn't test it with a dojo application, since I don't use dojo much, so let me know if you get it working or not.

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

No branches or pull requests

2 participants