Skip to Content
微前端设计与实现
book

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
构建和部署微前端
139
出一些改变。比如,微前端已经实现的部分,旧版应用就不应该再提供此服务,而是应该
将用户重定向到一个绝对
URL
地址,让路由将用户重定向到正确的位置。
另一个需要解决的问题是要找到一种方法,能够让用户遇到错误时可以快速切换版本。我
们在推出新的微前端平台时使用的一种技术是在一段时间内同时维护三个版本:旧版本、
混合版本(原有应用和微前端共存的兼容版本)和微前端版本。通过这种方式,在日常服
务中,我们可以一直维护混合版本和微前端版本,而在遇到无法快速修复问题的极端情况
时,可以全量切换到旧版本。
用户
路由
/signin
用户
路由
/catalog
App
shell
App
shell
单页应用
(旧版本)
单页应用
(旧版本)
登录
微前端
登录
微前端
6-8:在绞杀者模式中,微前端与原有应用并存,这样不用等到整个应用开发完成,我们就可以为
用户和公司创造即时价值
这种同时维护几个版本的配置会持续若干月,直到完成所有微前端的开发和改造。在这一
过程中,我们可以根据业务诉求循序渐进地改进平台。
在某些情况下,这看起来像是一种过度设计的解决方案,但是,我们的业务场景不允许停
止线上服务,所以必须为用户和公司找到一个折中策略。绞杀者模式可以让我们分析公司
能够承担多大的风险,并根据分析结果设计出合适的实现方案。
6.5.3
 可观察性
在一个成功的微前端架构中,需要着重考虑的最后一个因素是可观察性。可观察性反馈闭
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python语言及其应用(第2版)

Python语言及其应用(第2版)

Bill Lubanovic

Publisher Resources

ISBN: 9787115595089