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

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
232
附录
在开发微前端的过程中
你获得了哪些收益
遇到了哪些困难
我所遇到的一个问题就是糟糕的代码共享。共享第三方代码是手动、原始的做法,造成了
对第三方代码的集中依赖。同时,升级包版本很复杂,因为如果出现非兼容性变更,需要
所有的微前端为共享代码的升级做出响应。
另外一个问题就是糟糕的用户体验。当在微前端之间进行跳转时,页面会重新加载。针对
全局状态共享,或者让微前端像单页应用一样交互时,很少有好的解决方案。我们花了大
量时间改善用户体验。
不过,瑕不掩瑜,微前端的好处还是很多的,比如独立部署、构建速度更快、问题回溯更
方便,如果出现严重故障,也更容易发现和控制。通过微前端也可以节省项目时间和公司
成本,因为项目可以更快地交付,而不像单体应用那样,随着代码规模和复杂度的提升,
交付速度会越来越慢。同时,微前端降低了团队之间沟通和协调的成本。不同于单体应用
的整体硬件扩展,你可以针对某个页面或者某个组件进行硬件扩展。微前端对于硬件的要
求很低,不像单体应用,需要依赖价格高、性能强的硬件作为支撑。
微前端也更加敏捷,可以避免公司的整个网站出现故障。容错层可以更容易地构建,团队
可以根据自己的需要构建开发平台,而不会像单体应用那样“一刀切”。
你参与过与微前端相关的开源项目吗
如果参与过
是哪一个
针对
Next.js
webpack 5 core
single-spa
React Static
Module Federation
等的扩展和
迭代。
我们什么时候应该使用微前端
什么时候应该避免使用
由于成本问题 ...
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