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

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
探索微前端架构
53
4.3.9
 架构特征
可部署性(5 分)
因为每个微前端都是单一的
HTML
页面或
单页应用,所以可以很容易地将产品部署在
云存储或应用服务器上,并在这些服务器之前部署
CDN
节点
。许多前端开发人员已经
使用这一方法多年,用于交付
We
b
应用。另外,当使用多
CDN
策略时,无论
CDN
供商出现任何问题,我们都可以确保将内容正常地提供给用户。
模块化(2 分)
这个架构的模块化程度一般。虽然有一定程度的模块化和可复用性,但更多的是在代码
层面共享组件或库,而在功能层面的共享较少。比如,负责开发目录的微前端团队不太
可能与另一个微前端团队共享代码。此外,因要实现新功能而不得不将一个纵向拆分的
微前端分割成两个或更多的部分时,由于它被设计成一个独特的逻辑单元,因此需要更
大的成本来解耦其中所有的共享依赖关系。
简单性(4 分)
这种方法的主要目的是减少团队的心智负担,通过前端开发人员的实践培育业务领域的
专家,这就体现了这种架构的简单性。接受这种架构不需要太多思维方式上的转变,也
没有太多新技术需要学习。对于前端开发人员来说,从
single-spa
Module Federation
开始接入微前端的成本应该是最小的。
可测试性(4 分)
与单页应用相比,这种方法在
App shell
的端到
端测试方面有一些弱点。然而,除了极
端情况,测试纵向拆分的微前端仍然可以复用现有的单元测试、集成测试或端到端测试
的经验。
性能(4 分)
你可以共享纵向拆分架构的公共库,尽管这需要团队在一定程度上保持协同。由于采用
这种方法的架构不太可能有数百个微前端,因此可以很容易地创建一种部署策略,将公 ...
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