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

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
微前端技术实现
99
简单回顾一下,这个应用包含一个在整个用户会话期间可用的
App shell
。它加载不同的微
前端,比如身份认证、目录和账户管理。在技术栈上,公司选择了
React
with webpack
Module Federation
,让每个团队都可以创建独立的微前端
。使用
Module Federation
,可以
共享公共依赖项,并且在每个用户会话期间仅加载一次。这样做,可以在不影响开发体验
的同时,为用户创造良好的体验。现在,让我们开始深入了解应用的关键实现过程吧。
5.3.1
 项目结构
在继续研究案例之前,我想说一下关于构建这个电子商务项目结构的想法。当克隆代码仓
库时,你会看到多个文件夹,如图
5-3
所示。
5-3swag 电子商务网站项目的目录结构
每个文件夹代表一个独立的项目。因为它们存在于同一个代码库中,所以这是一种被叫作
单一代码库(
monorepo
)的方法
,但它们可以很容易地以多代码库(
polyrepo
)方法提取。
6
章将详细介绍这两个版本控制策略之间的差异。
所有目录都具有相同的结构,如图
5-4
所示。
5-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