URL based routing for issues in microfrontends setup #11567
Replies: 2 comments
-
Yeah URL based routing makes most sense to me, though you'll run into edge cases where you might hit an error right before navigate that you want MFE B to recieve instead of MFE A when navigating from MFE A -> MFE B In generaly there is always going to be edge cases, especially with async heavy code. Given the browser does not have any ability to to async context tracking, just something that has to be lived with. |
Beta Was this translation helpful? Give feedback.
-
Hi @AbhiPrasad, thanks a lot for your answer here. It makes sense, also the note about the potential async issues is very helpful. We will be rolling out URL-based routing soon and I will report results here. I will keep the discussion open until then. |
Beta Was this translation helpful? Give feedback.
-
Hello there!
Thanks a lot for improving the documentation on microfrontends. Our team has been following its development, and we try to stick to the guidelines outlined there. I wanted to raise a question that needs a bit of context before I can state it:
Our setup consists of a main platform application, which is responsible for loading and mounting the rest of our products. In short, the platform app initializes, then lazy-loads other MFEs and mounts the corresponding MFE based on the current URL.
For quite some time, we have been experiencing "mis-routed" runtime issues in Sentry projects. Thus, an issue that has occurred in project A might be reported to project B (and vice versa). We are not 100% sure what causes this to happen, but we have one idea:
We have some shared dependencies across all MFEs, such as React, TanStack Query, and our Design System component library. Thus, we have a hypothesis that something like the following can happen:
We were thinking of how we could possibly overcome this. There was an idea suggested that we could route runtime issues based on the URL. All of our MFEs are separate products served by separate routes (i.e., company.com/product-a, company.com/product-b). Thus, it seems that with URL-based issue routing, we would have more certainty that a runtime issue occurred while a particular MFE had control.
I wanted to raise a discussion here to see if anyone had set up similar issues routing or potential pitfalls behind the idea that might not be obvious. Would appreciate all inputs, ideas, or directions. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions