Micro frontend architecture advice

后端 未结 8 2301
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 00:57

We have several web applications that we wish to present under one single page application. We are looking for a micro-frontend architecture/framework to use. As we see it,

8条回答
  •  猫巷女王i
    2020-12-30 01:36

    Since your question is somewhat broad, I will only address your inquiries about the usage of Iframes, since advising you on architecture is pointless, without knowing the circumstances (target group?, mobile?, what are the KPIs? (performance, initial load, development costs, re-usability, ...)

    Iframes are good for "total" isolation (code + style), no other approach will give you this, however because of this, they have a lot of drawbacks:

    • sharing data between iframes needs orchestration in the outer AND the inner SPAs, that involves setting up additional security measures (because each SPAs is exposed)
    • styling your inner SPAs by the outer one, will only work, when they are on the same domain and needs additional JS code
    • sharing cookies only works, if the inner SPAs are on the same domain as the outer SPAs
    • performance-wise each Iframe needs to load everything by itself; re-using assets, libraries etc. is very difficult and involves meddling with the tooling of each SPA.

    Usually, if you have everything under your control going with a real micro frontend approach is the better solution than Iframes.

提交回复
热议问题