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

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
100
5
每个微前端文件夹都包含以下内容。
dist 目录
构建微前端后,可以在该目录下找到所有用于部署到环境中的已优化文件。
node_modules 目录
该目录包含所有微前端依赖项。
package.json
该文件收集有关项目的所有元数据,定义功能属性,为
npm
配置安装依赖项
、运行脚
本以及指定入口等。
src 目录
该目录包含所有微前端的业务逻辑。
webpack.config.js
该文件是
webpack
的配置文件,用于配置
Module Federation
,为微前端提供服务。
这是一个典型的
JavaScript
项目的目录结构
Module Federation
不需要你改变平常的工作
方式,它会在后台处理所有依赖项以及加载和删除依赖项的逻辑,而无须改变你偏爱的目
录结构。
5.3.2
 
App shell
如前所述,
App shell
存在于整个用户会话中。考虑到调整微前端是必要的,这个过程不适
合放在任何一个业务子域中,团队决定将
App shell
的实现分配给由首席工程师组成的新团
队,名为
Sasazushi
。构建这部分系统不需要投入太多成本
,后期维护也应该是最少的。正
是因为
App shell
不涉及任何业务逻辑,所以由这样的工程师组成的团队会更合适。
Sasazushi
团队负责:
避免
App shell
中的域泄露;
实现微前端之间的全局路由;
确保正确加载和卸载微前端;
在一个或多个
JavaScript
代码块中生成跨子域的依赖项。
此外,因为这个团队是由首席工程师组成的,所以团队也将负责系统的整体性能 ...
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