搬运工 发表于 2022-8-15 00:00:01

TL 前端架构设计



前言 ..........................................................................................................................................................xi
第一部分 引言
第 1 章 前端架构原则 .......................................................................................................................7
第 2 章 Alpha 项目 ..........................................................................................................................11
2.1 慢而有力的开端 .......................................................................................................................11
2.2 全副武装 ...................................................................................................................................12
第 3 章 前端架构的核心 ................................................................................................................15
3.1 围绕四个核心工作 ...................................................................................................................15
3.2 四个核心的含义 .......................................................................................................................16
第二部分 代码核心
第 4 章 HTML ...................................................................................................................................19
4.1 过去处理标记的方法 ...............................................................................................................19
4.1.1 程序式标记:自动化程度 100%,可控程度 0% ......................................................19
4.1.2 静态标记:自动化程度 0%,可控程度 100% ..........................................................20
4.2 平衡可控性和自动化 ...............................................................................................................21
4.3 这一切背后的设计系统 ...........................................................................................................22
图灵社区会员 leezom(superjavaman.zhangli@gmail.com) 专享 尊重版权
vi | 目录
4.4 模块化 CSS 理论的多面性 ......................................................................................................22
4.4.1 OOCSS 方法.................................................................................................................23
4.4.2 SMACSS 方法 ..............................................................................................................23
4.4.3 BEM 方法 .....................................................................................................................24
4.5 选择适合的方案 .......................................................................................................................25
第 5 章 CSS ......................................................................................................................................27
5.1 特性之争与继承之痛 ...............................................................................................................28
5.2 一种现代的、模块化的方法 ...................................................................................................30
5.3 其他有助益的原则 ...................................................................................................................32
5.3.1 单一职责原则 ..............................................................................................................32
5.3.2 单一样式来源 ..............................................................................................................33
5.3.3 组件修饰符 ..................................................................................................................34
5.4 小结 ...........................................................................................................................................35
第 6 章 JavaScript ...........................................................................................................................37
6.1 选择框架 ...................................................................................................................................37
6.2 维护整洁的 JavaScript 代码 ....................................................................................................38
6.2.1 保持代码整洁 ..............................................................................................................38
6.2.2 创造可复用的函数 ......................................................................................................38
6.3 小结 ...........................................................................................................................................40
第 7 章  Red Hat 代码 ....................................................................................................................41
7.1 过多的依赖 ...............................................................................................................................41
7.2 严重的位置依赖问题 ...............................................................................................................42
7.3 设计分解 ...................................................................................................................................42
7.4 组件分类 ...................................................................................................................................43
7.5 BB 鸟规则.................................................................................................................................44
7.6 编写你自己的规则 ...................................................................................................................44
7.7 每个标签指定唯一的选择器 ...................................................................................................46
7.7.1 单一责任原则 ..............................................................................................................46
7.7.2 样式只有单一的来源 ..................................................................................................47
7.7.3 可选的修饰符 ..............................................................................................................47
7.7.4 可选的上下文 ..............................................................................................................50
7.8 语义化的网格 ...........................................................................................................................53
图灵社区会员 leezom(superjavaman.zhangli@gmail.com) 专享 尊重版权
目录 | vii
第三部分  流程核心
第 8 章 工作流 ..................................................................................................................................57
8.1 过去的开发工作流 ...................................................................................................................57
8.2 现代的开发工作流 ...................................................................................................................58
8.2.1 需求 ..............................................................................................................................58
8.2.2 原型设计 ......................................................................................................................58
8.2.3 程序开发 ......................................................................................................................58
8.3 前端工作流 ...............................................................................................................................59
8.3.1 必要的工具 ..................................................................................................................59
8.3.2 本地部署 ......................................................................................................................59
8.3.3 编写用户故事 ..............................................................................................................60
8.4 开发 ...........................................................................................................................................61
8.5 发布 ...........................................................................................................................................62
8.6 提交编译后的资源 ...................................................................................................................62
8.7 持续集成的服务器 ...................................................................................................................63
8.7.1 标签分支 ......................................................................................................................64
8.7.2 究竟为什么要这么做 ..................................................................................................64
8.8 发布渠道 ...................................................................................................................................64
第 9 章 任务处理器 .........................................................................................................................67
9.1 在任务处理器中完成一切 .......................................................................................................68
9.2 在项目中使用任务处理器 .......................................................................................................69
9.3 有明显的优胜者吗 ...................................................................................................................71
第 10 章 Red Hat 流程 ...................................................................................................................73
10.1 征服最后一英里 .....................................................................................................................73
10.2 模式驱动的设计系统 .............................................................................................................75
第四部分 测试核心
第 11 章 单元测试 ...........................................................................................................................87
11.1 单元 .........................................................................................................................................87
11.1.1 更多重用 ...................................................................................................................88
11.1.2 更好的测试 ...............................................................................................................88
图灵社区会员 leezom(superjavaman.zhangli@gmail.com) 专享 尊重版权
viii | 目录
11.2 测试驱动的开发 .....................................................................................................................88
11.3 一个测试驱动的例子 .............................................................................................................89
11.4 测试覆盖率要多大才足够 .....................................................................................................90
11.4.1 解决分歧点 ...............................................................................................................90
11.4.2 从测试覆盖率开始 ...................................................................................................90
第 12 章 性能测试 ...........................................................................................................................91
12.1 制定性能预算 .........................................................................................................................91
12.1.1 竞争基线 ...................................................................................................................92
12.1.2 平均基准 ...................................................................................................................92
12.2 原始指标 .................................................................................................................................93
12.2.1 页面大小 ...................................................................................................................93
12.2.2 HTTP 请求次数 ........................................................................................................94
12.3 计时度量 .................................................................................................................................94
12.4 混合度量标准 .........................................................................................................................95
12.4.1 PageSpeed 分数 ........................................................................................................95
12.4.2 Speed Index 指标 ......................................................................................................95
12.5 设置性能测试 .........................................................................................................................95
12.5.1 Grunt PageSpeed 插件 ..............................................................................................96
12.5.2 Grunt Perfbuget 插件 ................................................................................................96
12.6 小结 .........................................................................................................................................97
第 13 章 视觉还原测试 ..................................................................................................................99
13.1 常见的质疑 .............................................................................................................................99
13.1.1 不了解情况的开发者 .............................................................................................100
13.1.2 不一致的设计 .........................................................................................................100
13.1.3 举棋不定的决策者 .................................................................................................100
13.2 一个经过测试的解决方案 ...................................................................................................101
13.3 视觉还原测试的多面性 .......................................................................................................101
第 14 章 Red Hat 测试方法 ........................................................................................................103
14.1 实践视觉还原测试 ...............................................................................................................103
14.1.1 测试工具集 .............................................................................................................103
14.1.2 设置 Grunt ...............................................................................................................104
14.1.3 测试文件 .................................................................................................................104
14.1.4 对比 .........................................................................................................................105
图灵社区会员 leezom(superjavaman.zhangli@gmail.com) 专享 尊重版权
目录 | ix
14.1.5 运行全部测试用例 .................................................................................................106
14.1.6 如何应对测试失败 .................................................................................................107
14.1.7 从失败到成功 .........................................................................................................107
14.1.8 修改代码以适应需求 .............................................................................................108
14.1.9 将基准图片放在组件目录里 .................................................................................108
14.1.10 独立运行每个组件的测试集 ...............................................................................109
14.1.11 测试的可扩展性 ...................................................................................................110
14.2 小结 .......................................................................................................................................111
第五部分 文档核心
第 15 章 样式文档 .........................................................................................................................117
15.1 配置 Hologram ......................................................................................................................117
15.1.1 Hologram 的文档注释块 ........................................................................................119
15.1.2 Hologram 编译流程 ................................................................................................120
15.1.3 Hologram 小结 ........................................................................................................121
15.2 SassDoc .................................................................................................................................121
15.2.1 安装 SassDoc ..........................................................................................................121
15.2.2 使用 SassDoc ..........................................................................................................122
15.2.3 探索 SassDoc ..........................................................................................................123
15.2.4 深入了解 SassDoc ..................................................................................................124
15.2.5 内部依赖 .................................................................................................................125
15.3 小结 .......................................................................................................................................127
第 16 章 图形库 ..............................................................................................................................129
16.1 何为 Pattern Lab ...................................................................................................................129
16.2 运行 Pattern Lab ...................................................................................................................131
16.3 首页模板 ...............................................................................................................................133
16.4 首变量 ...................................................................................................................................134
16.5 原子 .......................................................................................................................................135
16.6 发挥原子的作用 ...................................................................................................................135
第 17 章 Red Hat 文档 .................................................................................................................137
17.1 阶段 1:静态的样式文档 ....................................................................................................137
17.2 阶段 2:重写 Pattern Lab ....................................................................................................139
图灵社区会员 leezom(superjavaman.zhangli@gmail.com) 专享 尊重版权
x | 目录
17.3 阶段 3:分拆模式库和样式文档 ........................................................................................142
17.4 阶段 4:创建统一的渲染引擎 ............................................................................................143
17.5 阶段 5:自动创建新模式 ....................................................................................................144
第 18 章 总结 ..................................................................................................................................147
作者介绍 ..............................................................................................................................................149
封面介绍 ..............................................................................................................................................149


**** Hidden Message *****

李才哥 发表于 2022-8-15 00:44:30

啥也不说了,感谢楼主分享哇!

taipingyang2021 发表于 2022-8-15 06:54:33

啥也不说了,感谢楼主分享哇!

894238940 发表于 2022-8-15 08:04:40

啥也不说了,感谢楼主分享哇!

neun 发表于 2022-8-15 17:03:03

啥也不说了,感谢楼主分享哇!

runing 发表于 2022-8-15 17:17:21

这个帖一般般,还可以哦。

hgzhou6 发表于 2022-8-16 05:24:53

啥也不说了,感谢楼主分享哇!

randy_1981 发表于 2022-8-16 05:33:50

正需要,支持楼主大人了!

dongxinmario 发表于 2022-8-16 13:55:05

啥也不说了,感谢楼主分享哇!

hphpdtc 发表于 2022-8-17 16:28:21

啥也不说了,感谢楼主分享哇!
页: [1] 2
查看完整版本: TL 前端架构设计