single-spa是个 JavaScript 框架,它把多个微前端集成为一个前端应用。虽然我们告诫提防微前端混乱,借口使用微前端来混合和匹配多个框架,但 single-spa 恰恰干的就是这个。我们明白存在一些正当的场景,比如在有必要集成多个框架时,你需要升级多个微前端中某个框架到新版本。single-spa 一直是我们团队在集成微前端时的默认框架选择,他们发现它可以跟 SystemJS 工作得很好,并且能管理单个依赖的不同版本。
single-spa is a JavaScript metaframework that allows us to build micro frontends using different frameworks that can coexist in a single application. In general, we don't recommend using more than one framework for an application, but there are times when we can't avoid doing so. For instance, single-spa can be quite useful when you're working with a legacy application and you want to experiment by developing a new feature, with either a new version of the existing framework or a completely different one. Given the short life span of many JavaScript frameworks, we see a need for a solution that would allow for future framework changes and localized experimentation, without affecting the entire application. single-spa seems to be a good start in that direction.