Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Angular doesn't trigger detect changes between coexisting microfrontends #114

Closed
Magefo opened this issue Nov 4, 2019 · 3 comments
Closed

Comments

@Magefo
Copy link
Contributor

Magefo commented Nov 4, 2019

The problem is related to detect changes on angular projects, when you build a portal and at least two angular microfrontends, when you fire an event in the mf1 and the mf2 is listening through router change or single spa update lifecycle the mf2 doesn't updte until you interact with it.

@joeldenning joeldenning transferred this issue from single-spa/single-spa Nov 4, 2019
@joeldenning
Copy link
Member

Hi Magefo - the bug you've reported here is one that we've seen periodically for about 4 years. We have put in several workarounds in the past and then taken them out when they don't quite work out. This has been previously discussed in #86

Our current workaround is this:

https://github.com/CanopyTax/single-spa-angular/blob/master/src/browser-lib/single-spa-angular.ts#L61

The problem is that change detection through ZoneJS + Angular is really finnicky. The way that Angular implemented zonejs via the core angular libraries actually assumes that there is only ever one angular application on the page at any point in time. Single-spa-angular goes to pretty great lengths to get angular + zonejs to not freak out about multiple angular applications. However, with all of those workarounds, things are still not perfect.

Another related issue is #113

@Magefo
Copy link
Contributor Author

Magefo commented Nov 5, 2019

thank you!

@Magefo Magefo closed this as completed Nov 5, 2019
@christcottrell
Copy link

It looks like this has been closed for a while, but the link to the current work around is no longer working. Thanks!

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

No branches or pull requests

3 participants