Compare commits

...
150 Commits
Author SHA1 Message Date
ascoders ea56ac10ce Merge branch 'master' of https://github.com/ascoders/weekly 2021-06-07 09:33:53 +08:00
ascoders 90660c6d34 198 2021-06-07 09:33:47 +08:00
黄子毅 fcf04083a5 Merge pull request #322 from rmlzy/patch-3
Update 41.精读《Ant Design 3.0 背后的故事》.md
2021-05-31 16:05:52 +08:00
黄子毅 a1ea12a736 Merge pull request #323 from rmlzy/patch-4
Update 52.精读《图解 ES 模块》.md
2021-05-31 16:05:25 +08:00
黄子毅 02a795bb8a Merge pull request #324 from rmlzy/patch-5
Update 137.精读《当我在分享的时候,我在做什么?》.md
2021-05-31 16:05:12 +08:00
黄子毅 6bffed8eb5 Merge pull request #325 from rmlzy/patch-6
Update 136.精读《极客公园 IFX - 下》.md
2021-05-31 16:04:47 +08:00
黄子毅 ddd5ceb74a Merge pull request #326 from rmlzy/patch-7
Update 135.精读《极客公园 IFX - 上》.md
2021-05-31 16:04:34 +08:00
rmlzy 3c6cee2f49 Update 135.精读《极客公园 IFX - 上》.md
修正错别字
2021-05-31 16:00:59 +08:00
rmlzy fc2f0c6f68 Update 136.精读《极客公园 IFX - 下》.md
修正错别字
2021-05-31 15:50:42 +08:00
rmlzy 0dcf208315 Update 137.精读《当我在分享的时候,我在做什么?》.md
修正错别字
2021-05-31 15:47:03 +08:00
rmlzy 7730834e83 Update 52.精读《图解 ES 模块》.md
修正错别字
2021-05-31 15:40:39 +08:00
rmlzy 91875ab232 Update 41.精读《Ant Design 3.0 背后的故事》.md
修正格式错误
2021-05-31 15:32:52 +08:00
黄子毅 d81e6d7813 Merge pull request #320 from rmlzy/patch-1
Update 20.精读《Nestjs》文档.md
2021-05-31 10:02:25 +08:00
黄子毅 3e299d85e9 Merge pull request #321 from rmlzy/patch-2
Update 119.精读《前端深水区》.md
2021-05-31 10:02:04 +08:00
ascoders 455e1693f4 197 2021-05-31 10:01:23 +08:00
rmlzy 2a17e62107 Update 119.精读《前端深水区》.md
修正标点符号
2021-05-31 09:54:38 +08:00
rmlzy 0a090cf0a7 Update 20.精读《Nestjs》文档.md
Nextjs 目前是 Providers 配合 `@Injectable()` 装饰器实现 DI
2021-05-31 09:50:16 +08:00
ascoders c13f0af435 Merge branch 'master' of https://github.com/ascoders/weekly 2021-05-24 13:50:42 +08:00
ascoders 8ee7995ddc fix typo error 2021-05-24 13:50:31 +08:00
黄子毅 0e8c749e68 Merge pull request #318 from neighborhood999/fix/typo
fix(196): typo
2021-05-24 10:49:54 +08:00
Jie Peng ee0450ffb2 fix(196): typo
Signed-off-by: Jie Peng <im@jiepeng.me>
2021-05-24 10:32:12 +08:00
ascoders e0d8be6916 196 2021-05-24 10:12:55 +08:00
ascoders 7c4d37a428 fix typo 2021-05-17 13:21:06 +08:00
ascoders eeaebad903 195 2021-05-17 09:43:00 +08:00
黄子毅 c624e7e607 Merge pull request #315 from kamilic/patch-1
Update 194.精读《算法基础数据结构》.md
2021-05-12 13:53:55 +08:00
kamilic 0f724a20cf Update 194.精读《算法基础数据结构》.md
chores: fix typo
2021-05-11 21:08:13 +08:00
黄子毅 c7922c4a0e Merge pull request #314 from jihchi/patch-1
Update 194.精读《算法基础数据结构》.md -- 連結正確但文字錯誤
2021-05-10 14:23:45 +08:00
Jihchi Lee 9d98f72fd3 Update 194.精读《算法基础数据结构》.md 2021-05-10 11:25:53 +08:00
ascoders db9a256efa update readme 2021-05-10 08:59:01 +08:00
ascoders aedfdd4b91 Merge branch 'master' of https://github.com/dt-fe/weekly 2021-05-10 08:57:02 +08:00
ascoders 99d5c51d42 194 2021-05-10 08:56:52 +08:00
黄子毅 086b733288 Merge pull request #313 from jihchi/patch-1
96.精读《useEffect%20完全指南》-- 修正錯誤依賴
2021-05-08 10:46:03 +08:00
Jihchi Lee 6f9ccaef9e Update 96.精读《useEffect 完全指南》.md 2021-05-07 12:01:13 +08:00
ascoders dba92f52b5 update 2021-04-25 10:10:15 +08:00
ascoders 61512fba55 193 2021-04-25 10:06:54 +08:00
ascoders 542faafe04 fix: 修复算法错误 2021-04-22 17:18:24 +08:00
ascoders 70468eae8a update readme 2021-04-19 09:23:05 +08:00
ascoders 9e0c2027d2 update readme 2021-04-17 17:41:05 +08:00
ascoders 6ac4e965bb update readme 2021-04-17 17:39:58 +08:00
ascoders 5edddb5890 update readme 2021-04-17 17:37:09 +08:00
ascoders 706ac612ff update readme 2021-04-17 17:29:15 +08:00
ascoders 444a56e333 update readme 2021-04-17 17:27:31 +08:00
ascoders 2e966d717d update readme 2021-04-17 17:25:42 +08:00
ascoders 237d856cfe update readme 2021-04-17 17:24:13 +08:00
ascoders d12c076774 update readme 2021-04-16 22:58:32 +08:00
ascoders 3e3cc53715 remove assets 2021-04-16 22:38:46 +08:00
ascoders ea4d30385a 按目录整理 2021-04-16 22:22:48 +08:00
ascoders 1b03871be8 fix lint 2021-04-16 17:25:53 +08:00
ascoders 42e068aab7 update readme 2021-04-16 17:17:52 +08:00
ascoders 280efe4545 191 2021-04-12 09:51:09 +08:00
ascoders 9b54c138a7 fix bug 2021-04-07 14:01:02 +08:00
ascoders c253b7d60f rename 190 2021-04-06 09:47:32 +08:00
ascoders 367bba2692 189 2021-04-06 09:46:50 +08:00
ascoders e888c4e22c 189 2021-03-29 10:33:40 +08:00
ascoders 8a3425b5e3 188 2021-03-22 07:52:11 +08:00
ascoders 9081bde65e 187 2021-03-15 08:43:49 +08:00
ascoders 4f783678da 186 2021-03-08 09:36:35 +08:00
ascoders 299a60a881 185 2021-03-01 08:59:43 +08:00
ascoders 7e651219b0 184 2021-02-22 10:11:00 +08:00
ascoders e1e7bc6f57 183 2021-02-01 09:05:50 +08:00
ascoders beed8434ec 182 2021-01-25 10:32:08 +08:00
ascoders ab13166c0a Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2021-01-20 15:12:50 +08:00
ascoders 71a48cde3b fix type 2021-01-20 15:12:30 +08:00
黄子毅 c603ac0d1d Merge pull request #297 from sosamuel/patch-1
Fix 校正笔误
2021-01-19 21:10:59 +08:00
Samuel Chia 316d3d98aa Fix 校正笔误 2021-01-18 10:43:42 +08:00
ascoders 0465cf43db 181 2021-01-18 10:14:59 +08:00
ascoders 65de19ddb6 181 2021-01-18 10:08:02 +08:00
ascoders 9c0f11cc55 181 2021-01-18 10:07:20 +08:00
ascoders 754ceb3d5a fix: typo 2021-01-10 11:28:15 +08:00
ascoders dcc5247ba0 fix typo 2021-01-10 11:23:26 +08:00
ascoders 02de198a8b 180 2021-01-10 11:21:15 +08:00
ascoders b7cfc4c6e3 179 2020-12-26 10:50:01 +08:00
ascoders 46a094e711 178 2020-12-20 23:22:19 +08:00
ascoders b5cd1b2379 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-12-13 21:45:29 +08:00
ascoders cfe94e6aa7 177 2020-12-13 21:44:46 +08:00
黄子毅 3362f25775 Merge pull request #289 from wiolem/patch-1
docs: typo onDropOver
2020-12-09 17:59:49 +08:00
William 87f9704831 Update 140.精读《结合 React 使用原生 Drag Drop API》.md 2020-12-09 10:40:49 +08:00
ascoders 6c7084dfe1 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-12-06 21:50:03 +08:00
ascoders 164590159d 176 2020-12-06 21:49:38 +08:00
黄子毅 b8ab46d26b Merge pull request #287 from spiritree/patch-3
Update 168.精读《设计模式 - Builder 生成器》.md
2020-12-03 20:19:48 +08:00
深樹 183b4fc41a Update 168.精读《设计模式 - Builder 生成器》.md
maybe misspell `Persion`->`Person`
2020-12-01 15:28:53 +08:00
ascoders 2b7ab34978 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-11-29 18:04:36 +08:00
ascoders 2ca7132569 175 2020-11-29 18:04:27 +08:00
黄子毅 aac9aa34f8 Merge pull request #283 from JeromeLin/patch-3
Update 003.精读前后端渲染之争.md
2020-11-29 11:29:25 +08:00
黄子毅 ad8a645462 Merge pull request #285 from spiritree/patch-1
Update 171.精读《设计模式 - Singleton 单例模式》.md
2020-11-26 21:46:06 +08:00
深樹 2dbe4d6368 Update 171.精读《设计模式 - Singleton 单例模式》.md
class method: `instance` -> `getInstance`
2020-11-25 19:14:31 +08:00
ascoders d76253ef75 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-11-22 11:10:11 +08:00
ascoders 46b68f1933 174 2020-11-22 11:09:40 +08:00
JeromeLin 8aab27bc3f Update 003.精读前后端渲染之争.md 2020-11-20 09:51:01 +08:00
黄子毅 22f118e1b7 Merge pull request #282 from JeromeLin/patch-2
Update 001.精读 js 模块化发展.md
2020-11-19 21:21:20 +08:00
JeromeLin 922eb6dc59 Update 001.精读 js 模块化发展.md 2020-11-19 17:37:21 +08:00
黄子毅 20526273d3 Merge pull request #281 from giscafer/patch-1
fix: typo
2020-11-18 10:35:33 +08:00
Nickbing Lao f3222c646b fix: typo
错别字
2020-11-16 16:09:23 +08:00
ascoders 9ae28c5e85 set img size 2020-11-15 16:45:15 +08:00
ascoders e72318adb4 173 2020-11-15 16:37:09 +08:00
ascoders 2682dc0504 update 2020-11-08 20:16:33 +08:00
ascoders 8b4611b47a 172 2020-11-08 20:12:56 +08:00
ascoders 25938c60a6 171 2020-11-01 21:41:08 +08:00
ascoders 9920f0dbb7 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-10-24 20:50:18 +08:00
ascoders 90f7d89db7 170 2020-10-24 20:50:04 +08:00
黄子毅 6ddbdbbbb2 Merge pull request #276 from NaturelLee/patch-1
Correct Hooks implimentation
2020-10-20 15:44:25 +08:00
NaturelLee 3c8c9fd5ef Correct Hooks implimentation
Correct Hooks implimentation from Array to single linked list
2020-10-20 15:35:08 +08:00
ascoders 91a9bf82fd fix bug 2020-10-19 10:22:17 +08:00
ascoders 4603ac77d8 169 2020-10-18 11:25:55 +08:00
ascoders 998940af1b 168 2020-10-10 17:40:42 +08:00
ascoders 24ed724eab fix: 放大图片 2020-10-07 19:32:11 +08:00
ascoders 33b71628ab update title 2020-09-24 20:15:28 +08:00
ascoders 2dbf1429ba 167 2020-09-21 09:45:35 +08:00
ascoders 9867c1ee9d 166 2020-09-14 09:52:10 +08:00
ascoders e8a0539984 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-09-07 11:28:18 +08:00
ascoders 685e8ba32a 165 2020-09-07 11:27:07 +08:00
黄子毅 6c9493df7b Merge pull request #268 from spiritree/patch-1
Update 163.精读《Spring 概念》.md
2020-09-02 09:41:32 +08:00
深樹 1994438792 Update 163.精读《Spring 概念》.md
`lass` -> `class`
2020-09-01 16:04:21 +08:00
ascoders 60be3e354b fix 2020-08-31 10:25:00 +08:00
ascoders 9d0bb5c996 163 2020-08-31 10:22:21 +08:00
ascoders 304dc5fc36 163 2020-08-24 09:35:45 +08:00
ascoders 819b6d7452 162 2020-08-17 10:24:38 +08:00
ascoders b066c8a5d7 161 2020-08-10 10:11:03 +08:00
ascoders 80fb60c6fb 160 2020-07-27 09:37:27 +08:00
ascoders 6a2031899d 159 2020-07-20 09:55:34 +08:00
ascoders aedcc2fd56 158 2020-07-13 10:26:30 +08:00
ascoders 757eb403ac update 2020-07-06 09:50:38 +08:00
ascoders 87c2745395 156 2020-06-22 09:48:19 +08:00
ascoders 0d3d8ef54c fix bug 2020-06-15 22:56:52 +08:00
ascoders 53d5ee1960 155 2020-06-15 09:42:30 +08:00
ascoders 92a8dfc55c Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-06-08 09:53:32 +08:00
ascoders c59f46cc1d 154 2020-06-08 09:53:17 +08:00
黄子毅 ef3904a2f6 Merge pull request #253 from justjavac/patch-1
fix: snowpack issue 链接
2020-06-01 23:05:43 +08:00
迷渡 994c5844d9 fix: snowpack issue 链接 2020-06-01 21:02:00 +08:00
ascoders 3881e51b08 153 2020-06-01 09:49:07 +08:00
ascoders 815ae1367a fix typo 2020-05-25 18:20:56 +08:00
ascoders 84ed47dbdf Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-05-25 09:29:02 +08:00
ascoders 252980724a 152 2020-05-25 09:28:53 +08:00
黄子毅 225aab476d Merge pull request #250 from spiritree/patch-1
Update 148. 精读《React Error Boundaries》.md
2020-05-22 18:29:16 +08:00
深樹 f065539266 Update 148. 精读《React Error Boundaries》.md
FQA -> FAQ
2020-05-22 16:55:03 +08:00
ascoders f8d81fc3f5 151 2020-05-18 08:40:17 +08:00
ascoders 43e264cc07 update 2020-05-11 13:48:07 +08:00
ascoders 957737959f 150 2020-05-11 09:39:14 +08:00
ascoders 000e6511e6 149 2020-04-27 13:01:48 +08:00
ascoders a652284bbc 148 2020-04-20 09:31:08 +08:00
ascoders 1b88e5ac06 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-04-13 09:35:39 +08:00
ascoders 79ba9ec6a1 147 2020-04-13 09:35:36 +08:00
黄子毅 a4acf09d8b Merge pull request #244 from lz-lee/patch-1
Update 145.精读《React Router v6》.md
2020-04-10 14:57:48 +08:00
lz-lee 872ef2e346 Update 145.精读《React Router v6》.md 2020-04-09 10:44:37 +08:00
黄子毅 8795ae0aaa Merge pull request #243 from Kerminate/v2
fix: 修复引用传参
2020-04-07 11:22:51 +08:00
Kerminate 23c4190d7e fix: 修复引用传参 2020-04-07 10:25:59 +08:00
Kerminate 75d0109102 Merge branch 'v2' of https://github.com/dt-fe/weekly into v2 2020-04-07 10:23:27 +08:00
Kerminate 893bb2d97a Merge branch 'master' of https://github.com/dt-fe/weekly into v2 2020-04-07 10:22:44 +08:00
黄子毅 d8f2e0977d Merge pull request #163 from vivaxy/patch-1
Update 64.精读《手写 SQL 编译器 - 词法分析》.md
2019-06-07 22:05:26 +08:00
vivaxy f4e75f5e21 Update 64.精读《手写 SQL 编译器 - 词法分析》.md
Fix syntax error
2019-06-07 14:30:27 +08:00
257 changed files with 11709 additions and 101 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

+21
View File
@@ -0,0 +1,21 @@
/**
* 发布辅助脚本
* @author 黄子毅
*/
const fs = require('fs')
const dirs = ['前沿技术', '设计模式', '编译原理', '源码解读', '商业思考', '算法']
dirs.forEach(dir => {
const readDir = fs.readdirSync(`./${dir}`);
console.log(`### ${dir}\n`)
readDir.sort((left, right) => left.split('.')[0] - right.split('.')[0]).forEach(dirName=>{
console.log(`- <a href="./${dir}/${dirName}">${dirName.replace('.md', '')}</a>`)
})
console.log('')
})
+228 -17
View File
@@ -1,27 +1,238 @@
# 前端精读
<a href="https://travis-ci.org/dt-fe/weekly">
<img src="https://travis-ci.org/dt-fe/weekly.svg?branch=v2" alt="CircleCI Status">
<a href="https://travis-ci.org/ascoders/weekly">
<img src="https://travis-ci.org/ascoders/weekly.svg?branch=v2" alt="CircleCI Status">
</a>
前端界的好文精读,每周更新!
- [周刊参考池](https://github.com/dt-fe/weekly/issues/2)
最新精读:<a href="./算法/198.精读《算法 - 动态规划》.md">198.精读《算法 - 动态规划》</a>
素材来源:[周刊参考池](https://github.com/ascoders/weekly/issues/2)
现已涵盖:
- 结合大厂工作经验解读的 [前沿技术](./前沿技术)[源码解读](./源码解读)。
- 逐渐加入一些后端技术解读。
- 一些 [商业思考](./商业思考)。
- 已完成 [编译原理](./编译原理)、[设计模式](./设计模式) 两大基础模块。
### 前沿技术
- <a href="./前沿技术/1.精读《js 模块化发展》.md">1.精读《js 模块化发展》</a>
- <a href="./前沿技术/2.精读《模态框的最佳实践》.md">2.精读《模态框的最佳实践》</a>
- <a href="./前沿技术/3.精读《前后端渲染之争》.md">3.精读《前后端渲染之争》</a>
- <a href="./前沿技术/4.精读《AsyncAwait 优越之处》.md">4.精读《AsyncAwait 优越之处》</a>
- <a href="./前沿技术/5.精读《民工叔单页数据流方案》.md">5.精读《民工叔单页数据流方案》</a>
- <a href="./前沿技术/6.精读《JavaScript 错误堆栈处理》.md">6.精读《JavaScript 错误堆栈处理》</a>
- <a href="./前沿技术/7.精读《请停止 css-in-js 的行为》.md">7.精读《请停止 css-in-js 的行为》</a>
- <a href="./前沿技术/8.精读《入坑 React 前没有人会告诉你的事》.md">8.精读《入坑 React 前没有人会告诉你的事》</a>
- <a href="./前沿技术/9.精读《Immutable 结构共享》.md">9.精读《Immutable 结构共享》</a>
- <a href="./前沿技术/10.精读《Web Components 的困境》.md">10.精读《Web Components 的困境》</a>
- <a href="./前沿技术/11.精读《前端调试技巧》.md">11.精读《前端调试技巧》</a>
- <a href="./前沿技术/12.精读《React 高阶组件》.md">12.精读《React 高阶组件》</a>
- <a href="./前沿技术/13.精读《This 带来的困惑》.md">13.精读《This 带来的困惑》</a>
- <a href="./前沿技术/14.精读《架构设计之 DCI》.md">14.精读《架构设计之 DCI》</a>
- <a href="./前沿技术/15.精读《TC39 与 ECMAScript 提案》.md">15.精读《TC39 与 ECMAScript 提案》</a>
- <a href="./前沿技术/16.精读《CSS Animations vs Web Animations API》.md">16.精读《CSS Animations vs Web Animations API》</a>
- <a href="./前沿技术/17.精读《如何安全地使用 React context》.md">17.精读《如何安全地使用 React context》</a>
- <a href="./前沿技术/18.精读《设计完美的日期选择器》.md">18.精读《设计完美的日期选择器》</a>
- <a href="./前沿技术/19.精读《最佳前端面试题》及面试官技巧.md">19.精读《最佳前端面试题》及面试官技巧</a>
- <a href="./前沿技术/20.精读《Nestjs》文档.md">20.精读《Nestjs》文档</a>
- <a href="./前沿技术/21.精读《Web fonts: when you need them, when you dont》.md">21.精读《Web fonts: when you need them, when you dont》</a>
- <a href="./前沿技术/22.精读《V8 引擎特性带来的的 JS 性能变化》.md">22.精读《V8 引擎特性带来的的 JS 性能变化》</a>
- <a href="./前沿技术/23.精读《API 设计原则》.md">23.精读《API 设计原则》</a>
- <a href="./前沿技术/24.精读《现代 JavaScript 概览》.md">24.精读《现代 JavaScript 概览》</a>
- <a href="./前沿技术/25.精读《null >= 0?》.md">25.精读《null >= 0?》</a>
- <a href="./前沿技术/26.精读《加密媒体扩展》.md">26.精读《加密媒体扩展》</a>
- <a href="./前沿技术/27.精读《css-in-js 杀鸡用牛刀》.md">27.精读《css-in-js 杀鸡用牛刀》</a>
- <a href="./前沿技术/28.精读《2017 前端性能优化备忘录》.md">28.精读《2017 前端性能优化备忘录》</a>
- <a href="./前沿技术/29.精读《JS 中的内存管理》.md">29.精读《JS 中的内存管理》</a>
- <a href="./前沿技术/30.精读《Javascript 事件循环与异步》.md">30.精读《Javascript 事件循环与异步》</a>
- <a href="./前沿技术/31.精读《我不再使用高阶组件》.md">31.精读《我不再使用高阶组件》</a>
- <a href="./前沿技术/32.精读《React Router4.0 进阶概念》.md">32.精读《React Router4.0 进阶概念》</a>
- <a href="./前沿技术/33.精读《30 行 js 代码创建神经网络》.md">33.精读《30 行 js 代码创建神经网络》</a>
- <a href="./前沿技术/34.精读《React 代码整洁之道》.md">34.精读《React 代码整洁之道》</a>
- <a href="./前沿技术/35.精读《dob - 框架实现》.md">35.精读《dob - 框架实现》</a>
- <a href="./前沿技术/36.精读《When You “Git” in Trouble- a Version Control Story》.md">36.精读《When You “Git” in Trouble- a Version Control Story》</a>
- <a href="./前沿技术/37.精读《how we position and what we compare》.md">37.精读《how we position and what we compare》</a>
- <a href="./前沿技术/38.精读《dob - 框架使用》.md">38.精读《dob - 框架使用》</a>
- <a href="./前沿技术/39.精读《全链路体验浏览器挖矿》.md">39.精读《全链路体验浏览器挖矿》</a>
- <a href="./前沿技术/40.精读《初探 Reason 与 GraphQL》.md">40.精读《初探 Reason 与 GraphQL》</a>
- <a href="./前沿技术/41.精读《Ant Design 3.0 背后的故事》.md">41.精读《Ant Design 3.0 背后的故事》</a>
- <a href="./前沿技术/42.精读《前端数据流哲学》.md">42.精读《前端数据流哲学》</a>
- <a href="./前沿技术/43.精读《增强现实与可视化》.md">43.精读《增强现实与可视化》</a>
- <a href="./前沿技术/44.精读《Rekit Studio》.md">44.精读《Rekit Studio》</a>
- <a href="./前沿技术/45.精读《React's new Context API》.md">45.精读《React's new Context API》</a>
- <a href="./前沿技术/46.精读《react-rxjs》.md">46.精读《react-rxjs》</a>
- <a href="./前沿技术/47.精读《webpack4.0 升级指南》.md">47.精读《webpack4.0 升级指南》</a>
- <a href="./前沿技术/49.精读《Compilers are the New Frameworks》.md">49.精读《Compilers are the New Frameworks》</a>
- <a href="./前沿技术/50.精读《快速上手构建 ARKit 应用》.md">50.精读《快速上手构建 ARKit 应用》</a>
- <a href="./前沿技术/51.精读《Elements of Web Dev》.md">51.精读《Elements of Web Dev》</a>
- <a href="./前沿技术/52.精读《图解 ES 模块》.md">52.精读《图解 ES 模块》</a>
- <a href="./前沿技术/53.精读《插件化思维》.md">53.精读《插件化思维》</a>
- <a href="./前沿技术/54.精读《在浏览器运行 serverRender》.md">54.精读《在浏览器运行 serverRender》</a>
- <a href="./前沿技术/55.精读《async await 是把双刃剑》.md">55.精读《async await 是把双刃剑》</a>
- <a href="./前沿技术/56.精读《重新思考 Redux》.md">56.精读《重新思考 Redux》</a>
- <a href="./前沿技术/57.精读《现代 js 框架存在的根本原因》.md">57.精读《现代 js 框架存在的根本原因》</a>
- <a href="./前沿技术/58.精读《Typescript2.0 - 2.9》.md">58.精读《Typescript2.0 - 2.9》</a>
- <a href="./前沿技术/59.精读《如何利用 Nodejs 监听文件夹》.md">59.精读《如何利用 Nodejs 监听文件夹》</a>
- <a href="./前沿技术/60.精读《如何在 nodejs 使用环境变量》.md">60.精读《如何在 nodejs 使用环境变量》</a>
- <a href="./前沿技术/61.精读《React 八种条件渲染》.md">61.精读《React 八种条件渲染》</a>
- <a href="./前沿技术/62.精读《JS 引擎基础之 Shapes and Inline Caches》.md">62.精读《JS 引擎基础之 Shapes and Inline Caches》</a>
- <a href="./前沿技术/63.精读《React 的多态性》.md">63.精读《React 的多态性》</a>
- <a href="./前沿技术/68.精读《衡量用户体验》.md">68.精读《衡量用户体验》</a>
- <a href="./前沿技术/69.精读《SQL vs Flux》.md">69.精读《SQL vs Flux》</a>
- <a href="./前沿技术/72.精读《REST, GraphQL, Webhooks, & gRPC 如何选型》.md">72.精读《REST, GraphQL, Webhooks, & gRPC 如何选型》</a>
- <a href="./前沿技术/74.精读《12 个评估 JS 库你需要关心的事》.md">74.精读《12 个评估 JS 库你需要关心的事》</a>
- <a href="./前沿技术/76.精读《谈谈 Web Workers》.md">76.精读《谈谈 Web Workers》</a>
- <a href="./前沿技术/77.精读《用 Reduce 实现 Promise 串行执行》.md">77.精读《用 Reduce 实现 Promise 串行执行》</a>
- <a href="./前沿技术/79.精读《React Hooks》.md">79.精读《React Hooks》</a>
- <a href="./前沿技术/80.精读《怎么用 React Hooks 造轮子》.md">80.精读《怎么用 React Hooks 造轮子》</a>
- <a href="./前沿技术/81.精读《使用 CSS 属性选择器》.md">81.精读《使用 CSS 属性选择器》</a>
- <a href="./前沿技术/83.精读《React16 新特性》.md">83.精读《React16 新特性》</a>
- <a href="./前沿技术/84.精读《Typescript 3.2 新特性》.md">84.精读《Typescript 3.2 新特性》</a>
- <a href="./前沿技术/86.精读《国际化布局 - Logical Properties》.md">86.精读《国际化布局 - Logical Properties》</a>
- <a href="./前沿技术/87.精读《setState 做了什么》.md">87.精读《setState 做了什么》</a>
- <a href="./前沿技术/88.精读《Caches API》.md">88.精读《Caches API》</a>
- <a href="./前沿技术/89.精读《如何编译前端项目与组件》.md">89.精读《如何编译前端项目与组件》</a>
- <a href="./前沿技术/91.精读《正则 ES2018》.md">91.精读《正则 ES2018》</a>
- <a href="./前沿技术/94.精读《Serverless 给前端带来了什么》.md">94.精读《Serverless 给前端带来了什么》</a>
- <a href="./前沿技术/95.精读《Function VS Class 组件》.md">95.精读《Function VS Class 组件》</a>
- <a href="./前沿技术/96.精读《useEffect 完全指南》.md">96.精读《useEffect 完全指南》</a>
- <a href="./前沿技术/97.精读《编写有弹性的组件》.md">97.精读《编写有弹性的组件》</a>
- <a href="./前沿技术/99.精读《Scheduling in React》.md">99.精读《Scheduling in React》</a>
- <a href="./前沿技术/100.精读《V8 引擎 Lazy Parsing》.md">100.精读《V8 引擎 Lazy Parsing》</a>
- <a href="./前沿技术/101.精读《持续集成 vs 持续交付 vs 持续部署》.md">101.精读《持续集成 vs 持续交付 vs 持续部署》</a>
- <a href="./前沿技术/102.精读《Monorepo 的优势》.md">102.精读《Monorepo 的优势》</a>
- <a href="./前沿技术/104.精读《Function Component 入门》.md">104.精读《Function Component 入门》</a>
- <a href="./前沿技术/105.精读《What's new in javascript》.md">105.精读《What's new in javascript》</a>
- <a href="./前沿技术/107.精读《Optional chaining》.md">107.精读《Optional chaining》</a>
- <a href="./前沿技术/109.精读《Vue3.0 Function API》.md">109.精读《Vue3.0 Function API》</a>
- <a href="./前沿技术/111.精读《前端未来展望》.md">111.精读《前端未来展望》</a>
- <a href="./前沿技术/112.精读《源码学习》.md">112.精读《源码学习》</a>
- <a href="./前沿技术/113.精读《Nodejs V12》.md">113.精读《Nodejs V12》</a>
- <a href="./前沿技术/117.精读《Tableau 探索式模型》.md">117.精读《Tableau 探索式模型》</a>
- <a href="./前沿技术/118.精读《使用 css 变量生成颜色主题》.md">118.精读《使用 css 变量生成颜色主题》</a>
- <a href="./前沿技术/119.精读《前端深水区》.md">119.精读《前端深水区》</a>
- <a href="./前沿技术/120.精读《React Hooks 最佳实践》.md">120.精读《React Hooks 最佳实践》</a>
- <a href="./前沿技术/121.精读《前端与 BI》.md">121.精读《前端与 BI》</a>
- <a href="./前沿技术/123.精读《用 Babel 创造自定义 JS 语法》.md">123.精读《用 Babel 创造自定义 JS 语法》</a>
- <a href="./前沿技术/124.精读《用 css grid 重新思考布局》.md">124.精读《用 css grid 重新思考布局》</a>
- <a href="./前沿技术/125.精读《深度学习 - 函数式之美》.md">125.精读《深度学习 - 函数式之美》</a>
- <a href="./前沿技术/126.精读《Nuxtjs》.md">126.精读《Nuxtjs》</a>
- <a href="./前沿技术/127.精读《React Conf 2019 - Day1》.md">127.精读《React Conf 2019 - Day1》</a>
- <a href="./前沿技术/129.精读《React Conf 2019 - Day2》.md">129.精读《React Conf 2019 - Day2》</a>
- <a href="./前沿技术/132.精读《正交的 React 组件》.md">132.精读《正交的 React 组件》</a>
- <a href="./前沿技术/133.精读《寻找框架设计的平衡点》.md">133.精读《寻找框架设计的平衡点》</a>
- <a href="./前沿技术/134.精读《我在阿里数据中台大前端》.md">134.精读《我在阿里数据中台大前端》</a>
- <a href="./前沿技术/138.精读《精通 console.log》.md">138.精读《精通 console.log》</a>
- <a href="./前沿技术/139.精读《手写 JSON Parser》.md">139.精读《手写 JSON Parser》</a>
- <a href="./前沿技术/140.精读《结合 React 使用原生 Drag Drop API》.md">140.精读《结合 React 使用原生 Drag Drop API》</a>
- <a href="./前沿技术/141.精读《useRef 与 createRef 的区别》.md">141.精读《useRef 与 createRef 的区别》</a>
- <a href="./前沿技术/142.精读《如何做好 CodeReview》.md">142.精读《如何做好 CodeReview》</a>
- <a href="./前沿技术/143.精读《Suspense 改变开发方式》.md">143.精读《Suspense 改变开发方式》</a>
- <a href="./前沿技术/144.精读《Webpack5 新特性 - 模块联邦》.md">144.精读《Webpack5 新特性 - 模块联邦》</a>
- <a href="./前沿技术/145.精读《React Router v6》.md">145.精读《React Router v6》</a>
- <a href="./前沿技术/146.精读《React Hooks 数据流》.md">146.精读《React Hooks 数据流》</a>
- <a href="./前沿技术/147. 精读《@types react 值得注意的 TS 技巧》.md">147. 精读《@types react 值得注意的 TS 技巧》</a>
- <a href="./前沿技术/148. 精读《React Error Boundaries》.md">148. 精读《React Error Boundaries》</a>
- <a href="./前沿技术/149. 精读《React 性能调试》.md">149. 精读《React 性能调试》</a>
- <a href="./前沿技术/150. 精读《Deno 1.0 你需要了解的》.md">150. 精读《Deno 1.0 你需要了解的》</a>
- <a href="./前沿技术/152. 精读《recoil》.md">152. 精读《recoil》</a>
- <a href="./前沿技术/153. 精读《snowpack》.md">153. 精读《snowpack》</a>
- <a href="./前沿技术/154. 精读《用 React 做按需渲染》.md">154. 精读《用 React 做按需渲染》</a>
- <a href="./前沿技术/157. 精读《如何比较 Object 对象》.md">157. 精读《如何比较 Object 对象》</a>
- <a href="./前沿技术/158. 精读《Typescript 4》.md">158. 精读《Typescript 4》</a>
- <a href="./前沿技术/159. 精读《对低代码搭建的理解》.md">159. 精读《对低代码搭建的理解》</a>
- <a href="./前沿技术/160. 精读《函数缓存》.md">160. 精读《函数缓存》</a>
- <a href="./前沿技术/161.精读《可视化搭建思考 - 富文本搭建》.md">161.精读《可视化搭建思考 - 富文本搭建》</a>
- <a href="./前沿技术/162.精读《Tasks, microtasks, queues and schedules》.md">162.精读《Tasks, microtasks, queues and schedules》</a>
- <a href="./前沿技术/163.精读《Spring 概念》.md">163.精读《Spring 概念》</a>
- <a href="./前沿技术/164.精读《数据搭建引擎 bi-designer API-设计器》.md">164.精读《数据搭建引擎 bi-designer API-设计器》</a>
- <a href="./前沿技术/165.精读《数据搭建引擎 bi-designer API-组件》.md">165.精读《数据搭建引擎 bi-designer API-组件》</a>
- <a href="./前沿技术/166.精读《BI 搭建 - 筛选条件》.md">166.精读《BI 搭建 - 筛选条件》</a>
- <a href="./前沿技术/190.精读《DOM diff 原理详解》.md">190.精读《DOM diff 原理详解》</a>
- <a href="./前沿技术/191.精读《高性能表格》.md">191.精读《高性能表格》</a>
- <a href="./前沿技术/192.精读《DOM diff 最长上升子序列》.md">192.精读《DOM diff 最长上升子序列》</a>
- <a href="./前沿技术/193.精读《React Server Component》.md">193.精读《React Server Component》</a>
- <a href="./前沿技术/194.精读《算法基础数据结构》.md">194.精读《算法基础数据结构》</a>
- <a href="./前沿技术/195.精读《新一代前端构建工具对比》.md">195.精读《新一代前端构建工具对比》</a>
- <a href="./前沿技术/196.精读《前端职业规划 - 2021 年》.md">196.精读《前端职业规划 - 2021 年》</a>
- <a href="./前沿技术/197.精读《低代码逻辑编排》.md">197.精读《低代码逻辑编排》</a>
### 设计模式
- <a href="./设计模式/167.精读《设计模式 - Abstract Factory 抽象工厂》.md">167.精读《设计模式 - Abstract Factory 抽象工厂》</a>
- <a href="./设计模式/168.精读《设计模式 - Builder 生成器》.md">168.精读《设计模式 - Builder 生成器》</a>
- <a href="./设计模式/169.精读《设计模式 - Factory Method 工厂方法》.md">169.精读《设计模式 - Factory Method 工厂方法》</a>
- <a href="./设计模式/170.精读《设计模式 - Prototype 原型模式》.md">170.精读《设计模式 - Prototype 原型模式》</a>
- <a href="./设计模式/171.精读《设计模式 - Singleton 单例模式》.md">171.精读《设计模式 - Singleton 单例模式》</a>
- <a href="./设计模式/172.精读《设计模式 - Adapter 适配器模式》.md">172.精读《设计模式 - Adapter 适配器模式》</a>
- <a href="./设计模式/173.精读《设计模式 - Bridge 桥接模式》.md">173.精读《设计模式 - Bridge 桥接模式》</a>
- <a href="./设计模式/174.精读《设计模式 - Composite 组合模式》.md">174.精读《设计模式 - Composite 组合模式》</a>
- <a href="./设计模式/175.精读《设计模式 - Decorator 装饰器模式》.md">175.精读《设计模式 - Decorator 装饰器模式》</a>
- <a href="./设计模式/176.精读《设计模式 - Facade 外观模式》.md">176.精读《设计模式 - Facade 外观模式》</a>
- <a href="./设计模式/177.精读《设计模式 - Flyweight 享元模式》.md">177.精读《设计模式 - Flyweight 享元模式》</a>
- <a href="./设计模式/178.精读《设计模式 - Proxy 代理模式》.md">178.精读《设计模式 - Proxy 代理模式》</a>
- <a href="./设计模式/179.精读《设计模式 - Chain of Responsibility 职责链模式》.md">179.精读《设计模式 - Chain of Responsibility 职责链模式》</a>
- <a href="./设计模式/180.精读《设计模式 - Command 命令模式》.md">180.精读《设计模式 - Command 命令模式》</a>
- <a href="./设计模式/181.精读《设计模式 - Interpreter 解释器模式》.md">181.精读《设计模式 - Interpreter 解释器模式》</a>
- <a href="./设计模式/182.精读《设计模式 - Iterator 迭代器模式》.md">182.精读《设计模式 - Iterator 迭代器模式》</a>
- <a href="./设计模式/183.精读《设计模式 - Mediator 中介者模式》.md">183.精读《设计模式 - Mediator 中介者模式》</a>
- <a href="./设计模式/184.精读《设计模式 - Memoto 备忘录模式》.md">184.精读《设计模式 - Memoto 备忘录模式》</a>
- <a href="./设计模式/185.精读《设计模式 - Observer 观察者模式》.md">185.精读《设计模式 - Observer 观察者模式》</a>
- <a href="./设计模式/186.精读《设计模式 - State 状态模式》.md">186.精读《设计模式 - State 状态模式》</a>
- <a href="./设计模式/187.精读《设计模式 - Strategy 策略模式》.md">187.精读《设计模式 - Strategy 策略模式》</a>
- <a href="./设计模式/188.精读《设计模式 - Template Method 模版模式》.md">188.精读《设计模式 - Template Method 模版模式》</a>
- <a href="./设计模式/189.精读《设计模式 - Visitor 访问者模式》.md">189.精读《设计模式 - Visitor 访问者模式》</a>
### 编译原理
- <a href="./编译原理/64.精读《手写 SQL 编译器 - 词法分析》.md">64.精读《手写 SQL 编译器 - 词法分析》</a>
- <a href="./编译原理/65.精读《手写 SQL 编译器 - 文法介绍》.md">65.精读《手写 SQL 编译器 - 文法介绍》</a>
- <a href="./编译原理/66.精读《手写 SQL 编译器 - 语法分析》.md">66.精读《手写 SQL 编译器 - 语法分析》</a>
- <a href="./编译原理/67.精读《手写 SQL 编译器 - 回溯》.md">67.精读《手写 SQL 编译器 - 回溯》</a>
- <a href="./编译原理/70.精读《手写 SQL 编译器 - 语法树》.md">70.精读《手写 SQL 编译器 - 语法树》</a>
- <a href="./编译原理/71.精读《手写 SQL 编译器 - 错误提示》.md">71.精读《手写 SQL 编译器 - 错误提示》</a>
- <a href="./编译原理/78.精读《手写 SQL 编译器 - 性能优化之缓存》.md">78.精读《手写 SQL 编译器 - 性能优化之缓存》</a>
- <a href="./编译原理/85.精读《手写 SQL 编译器 - 智能提示》.md">85.精读《手写 SQL 编译器 - 智能提示》</a>
### 源码解读
- <a href="./源码解读/48.精读《Immer.js》源码.md">48.精读《Immer.js》源码</a>
- <a href="./源码解读/73.精读《sqorn 源码》.md">73.精读《sqorn 源码》</a>
- <a href="./源码解读/75.精读《Epitath 源码 - renderProps 新用法》.md">75.精读《Epitath 源码 - renderProps 新用法》</a>
- <a href="./源码解读/82.精读《Htm - Hyperscript 源码》.md">82.精读《Htm - Hyperscript 源码》</a>
- <a href="./源码解读/92.精读《React PowerPlug 源码》.md">92.精读《React PowerPlug 源码》</a>
- <a href="./源码解读/93.精读《syntax-parser 源码》.md">93.精读《syntax-parser 源码》</a>
- <a href="./源码解读/98.精读《react-easy-state 源码》.md">98.精读《react-easy-state 源码》</a>
- <a href="./源码解读/110.精读《Inject Instance 源码》.md">110.精读《Inject Instance 源码》</a>
- <a href="./源码解读/122.精读《robot 源码 - 有限状态机》.md">122.精读《robot 源码 - 有限状态机》</a>
- <a href="./源码解读/128.精读《Hooks 取数 - swr 源码》.md">128.精读《Hooks 取数 - swr 源码》</a>
- <a href="./源码解读/130.精读《unstated 与 unstated-next 源码》.md">130.精读《unstated 与 unstated-next 源码》</a>
- <a href="./源码解读/151. 精读《@umijs use-request》源码.md">151. 精读《@umijs use-request》源码</a>
- <a href="./源码解读/155. 精读《use-what-changed 源码》.md">155. 精读《use-what-changed 源码》</a>
- <a href="./源码解读/156. 精读《react-intersection-observer 源码》.md">156. 精读《react-intersection-observer 源码》</a>
### 商业思考
- <a href="./商业思考/90.精读《极客公园 2019》.md">90.精读《极客公园 2019》</a>
- <a href="./商业思考/103.精读《为什么专家不再关心技术细节》.md">103.精读《为什么专家不再关心技术细节》</a>
- <a href="./商业思考/106.精读《数据之上·智慧之光 - 2018》.md">106.精读《数据之上·智慧之光 - 2018》</a>
- <a href="./商业思考/108.精读《智能商业》.md">108.精读《智能商业》</a>
- <a href="./商业思考/114.精读《谁在世界中心》.md">114.精读《谁在世界中心》</a>
- <a href="./商业思考/115.精读《Tableau 入门》.md">115.精读《Tableau 入门》</a>
- <a href="./商业思考/116.精读《刷新》.md">116.精读《刷新》</a>
- <a href="./商业思考/131.精读《从 0 到 1》.md">131.精读《从 0 到 1》</a>
- <a href="./商业思考/135.精读《极客公园 IFX - 上》.md">135.精读《极客公园 IFX - 上》</a>
- <a href="./商业思考/136.精读《极客公园 IFX - 下》.md">136.精读《极客公园 IFX - 下》</a>
- <a href="./商业思考/137.精读《当我在分享的时候,我在做什么?》.md">137.精读《当我在分享的时候,我在做什么?》</a>
### 算法
- <a href="./算法/198.精读《算法 - 动态规划》.md">198.精读《算法 - 动态规划》</a>
## 关注前端精读微信公众号
<img width=200 src="https://img.alicdn.com/tfs/TB165W0MCzqK1RjSZFLXXcn2XXa-258-258.jpg">
## Special Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://e.coding.net/?utm_source=weekly" target="_blank">
<img width="300" src="https://img.alicdn.com/tfs/TB107D.QbrpK1RjSZTEXXcWAVXa-1000-332.png">
</a>
</td>
</tr>
</tbody>
</table>
@@ -8,7 +8,7 @@
# 1 引言
<img src="assets/1/cube.jpeg" alt="logo" width="500" />
<img src="https://img.alicdn.com/imgextra/i4/O1CN01mvDKCM1owPSsLDBmI_!!6000000005289-2-tps-475-297.png" alt="logo" width="500" />
> 如今,Javascript 模块化规范非常方便、自然,但这个新规范仅执行了 2 年,就在 4 年前,js 的模块化还停留在运行时支持,10 年前,通过后端模版定义、注释定义模块依赖。对经历过来的人来说,历史的模块化方式还停留在脑海中,反而新上手的同学会更快接受现代的模块化规范。
@@ -103,7 +103,7 @@ YUI3 的 sandbox 像极了差不多同时出现的 AMD 规范,但早期 yahoo
> 看到大家基本都提到了 HTTP/2,对这项技术解决前端模块化及资源打包等工程问题抱有非常大的期待。很多人也认为 HTTP/2 普及后,基本就没有 Webpack 什么事情了。
不过 Webpack 作者 @sokra 在他的文章 [webpack & HTTP/2](https://medium.com/webpack/webpack-http-2-7083ec3f3ce6#.zdo4juvgo) 里提到了一个新的 Webpack 插件 `AggressiveSplittingPlugin`。简单的说,这款插件就是为了充分利用 HTTP/2 的文件缓存能力,将你的业务代码自动拆分成若干个数十 KB 的小文件。后续若其中任意一个文件发生变化,可以保证其他的小 chunck 不需要重新下载。
不过 Webpack 作者 @sokra 在他的文章 [webpack & HTTP/2](https://medium.com/webpack/webpack-http-2-7083ec3f3ce6#.zdo4juvgo) 里提到了一个新的 Webpack 插件 `AggressiveSplittingPlugin`。简单的说,这款插件就是为了充分利用 HTTP/2 的文件缓存能力,将你的业务代码自动拆分成若干个数十 KB 的小文件。后续若其中任意一个文件发生变化,可以保证其他的小 chunk 不需要重新下载。
可见,**即使不断的有新技术出现,也依然需要配套的工具来将前端工程问题解决方案推向极致。**
@@ -4,7 +4,7 @@
# 1 引言
<img src="assets/11/coffee.jpg" width="500" alt="logo" />
<img src="https://img.alicdn.com/imgextra/i2/O1CN01JC1TZ51Nxn24teojP_!!6000000001637-2-tps-1024-1296.png" width="500" alt="logo" />
梵高这幅画远景漆黑一片,近景的咖啡店色彩却反差很大,他只是望着黑夜中温暖的咖啡馆,交织着矛盾与孤独。代码不可能没有 BUG,调试与开发也始终交织在一起,我们在这两种矛盾中不断成长。
@@ -105,7 +105,7 @@ Css 不像 Js 一样方便分析规则是否存在冗余,Chrome 帮我们做
Chrome 会记录最后插入的 5 个元素,分别以 `$0` ~ `$4` 的方式在控制台直接输出。
<img src="assets/11/last-item.png" width="500" alt="last-items" />
<img src="https://img.alicdn.com/imgextra/i4/O1CN01xsKHb822gkXhDDcCA_!!6000000007150-2-tps-417-516.png" width="500" alt="last-items" />
### Console.table
@@ -10,7 +10,7 @@
## 概述
原文对于深水区的想法,讲的很清楚,还是建议读者去读一下原文。
对比 2010 年,整个前端生态已经翻新了好几遍,直到近几年的 Node BFF、IDE Cloud,抑或是客户端 AI,还是 Serverless 的建设,前端想要深度参与的话,单纯依靠原来的 HTML/CSS/JS 三件套技能也远远不够了。再抛开技术,整个互联网创业生态也重构了好几遍。无论是技术层面还是意识层面,如今的前端开发已经进入深水区。
对比 2010 年,整个前端生态已经翻新了好几遍,直到近几年的 Node BFF、IDE Cloud,抑或是客户端 AI,还是 Serverless 的建设,前端想要深度参与的话,单纯依靠原来的 HTML/CSS/JS 三件套技能也远远不够了。再抛开技术,整个互联网创业生态也重构了好几遍。无论是技术层面还是意识层面,如今的前端开发已经进入深水区。
- 深水区需要哪些技能
![image.png](https://img.alicdn.com/tfs/TB1oovQe8r0gK0jSZFnXXbRRXXa-1832-1032.png)
@@ -1,6 +1,6 @@
# 1 引言
<img src="assets/13/logo.jpeg" width="500" alt="logo" />
<img src="https://img.alicdn.com/imgextra/i2/O1CN014VGV7a1x3ILYqK9OD_!!6000000006387-2-tps-1024-732.png" width="500" alt="logo" />
javascript 的 this 是个头痛的话题,本期精读的文章更是引出了一个观点,避免使用 this。我们来看看是否有道理。
@@ -53,7 +53,7 @@ getName(person3) // Name: Sarah Doe
getGreetingCallback(person3)('Jeff') // Hello Jeff, I'm Sarah Doe
```
<img src="assets/13/1.png" width="500" alt="demo1" />
<img src="https://img.alicdn.com/imgextra/i3/O1CN017Kw37u1oOyYHXGlqC_!!6000000005216-2-tps-1338-338.png" width="500" alt="demo1" />
这样 person 实例是个纯对象,没有将方法挂载到原型链上,简单易懂。
@@ -179,7 +179,7 @@ const dragProps = {
```jsx
const dropProps = {
onDropOver: ev => {
onDragOver: ev => {
// 做一些样式处理,提示用户此时松手会将元素防止在何处
},
onDrop: ev => {
@@ -48,7 +48,7 @@ function App() {
### <Route> 升级
在 v5 版本,想要给组件传参数是不太直观的,需要利用 RenderProps 的方式透传 `routeProps`
在 v5 版本,想要给组件传参数是不太直观的,需要利用 RenderProps 的方式透传 `routeProps`
```jsx
import Profile from './Profile';
@@ -229,7 +229,7 @@ function Child() {
const userDeep = useDeepMemo(() => user, [user]);
return <UserPage user={user} />;
return <UserPage user={userDeep} />;
}
```
@@ -251,7 +251,7 @@ function Child() {
const userDeep = useDeepMemo(() => user, [user]);
return <UserPage user={user} />;
return <UserPage user={userDeep} />;
}
```
@@ -280,7 +280,7 @@ function Child() {
const userDeep = useDeepMemo(() => user, [user]);
return <UserPage user={user} />;
return <UserPage user={userDeep} />;
}
```
@@ -311,7 +311,7 @@ function Child() {
const userDeep = useDeepMemo(() => user, [user]);
return <UserPage user={user} />;
return <UserPage user={userDeep} />;
}
```
@@ -0,0 +1,141 @@
## 1 引言
从 [@types/react](https://unpkg.com/browse/@types/react@16.9.34/index.d.ts) 源码中挖掘一些 Typescript 使用技巧吧。
## 2 精读
### 泛型 extends
泛型可以指代可能的参数类型,但指代任意类型范围太模糊,当我们需要对参数类型加以限制,或者确定只处理某种类型参数时,就可以对泛型进行 extends 修饰。
问题:`React.lazy` 需要限制返回值是一个 `Promise<T>` 类型,且 `T` 必须是 React 组件类型。
方案:
```typescript
function lazy<T extends ComponentType<any>>(
factory: () => Promise<{ default: T }>
): LazyExoticComponent<T>;
```
`T extends ComponentType` 确保了 T 这个类型一定符合 `ComponentType` 这个 React 组件类型定义,我们再将 T 用到 `Promise<{ default: T }>` 位置即可。
## 泛型 extends + infer
如果有一种场景,需要拿到一个类型,这个类型是当某个参数符合某种结构时,这个结构内的一种子类型,就需要结合 泛型 extends + infer 了。
问题:`React.useReducer` 第一个参数是 Reducer,第二个参数是初始化参数,其实第二个参数的类型是第一个参数中回调函数第一个参数的类型,那我们怎么将这两个参数的关系联系到一起呢?
方案:
```typescript
function useReducer<R extends Reducer<any, any>, I>(
reducer: R,
initializerArg: I & ReducerState<R>,
initializer: (arg: I & ReducerState<R>) => ReducerState<R>
): [ReducerState<R>, Dispatch<ReducerAction<R>>];
type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any>
? S
: never;
```
`R extends Reducer<any, any>` 的意思在上面已经提过了,也就是 R 必须符合 `Reducer` 结构,也就是 `reducer` 必须符合这个结构,之后重点来了:`initializerArg` 利用 `ReducerState` 这个类型直接从 `reducer` 的类型 `R` 中将第一个回调参数挖了出来并返回。
`ReducerState` 定义中 `R extends Reducer<infer S, any> ? S : never` 的含义是:如果 R 符合 `Reducer<infer S, any>` 类型,则返回类型 `S`,这个 `S``Reducer<infer S>` 也就是 State 位置的类型,否则返回 `never` 类型。
所以 infer 表示待推断类型,是非常强大的功能,可以指定在任意位置代指其类型,并配合 extends 判断是否符合结构,可以使类型推断具备一定编程能力。
要用 extends 的另一个原因是,只有 extends 才能将结构描述出来,我们才能精确定义 infer 指代类型的位置。
### 类型重载
当一个类型拥有多种使用可能性时,可以采用类型重载定义复数类型,Typescript 作用时会逐个匹配并找到第一个满足条件的。
问题:`createElement` 第一个参数支持 FunctionComponent 与 ClassComponent,而且传入参数不同,返回值的类型也不同。
方案:
```typescript
function createElement<P extends {}>(
type: FunctionComponent<P>,
props?: (Attributes & P) | null,
...children: ReactNode[]
): FunctionComponentElement<P>;
function createElement<P extends {}>(
type: ClassType<
P,
ClassicComponent<P, ComponentState>,
ClassicComponentClass<P>
>,
props?: (ClassAttributes<ClassicComponent<P, ComponentState>> & P) | null,
...children: ReactNode[]
): CElement<P, ClassicComponent<P, ComponentState>>;
```
`createElement` 写两遍及以上,并配合不同的参数类型与返回值类型即可。
### 自定义类型收窄
我们可以通过 `typeof``instanceof` 做一些类型收窄工作,但有些类型甚至自定义类型的收窄判断函数需要自定义,我们可以通过 `is` 关键字定义自定义类型收窄判断函数。
问题:`isValidElement` 判断对象是否是合法的 React 元素,我们希望这个函数具备类型收窄的功能。
方案:
```typescript
function isValidElement<P>(
object: {} | null | undefined
): object is ReactElement<P>;
const element: string | ReactElement = "";
if (isValidElement(element)) {
element; // 自动推导类型为 ReactElement
} else {
element; // 自动推导类型为 string
}
```
基于这个方案,我们可以创建一些很有用的函数,比如 `isArray``isMap``isSet` 等等,通过 `is` 关键字时其被调用时具备类型收窄的功能。
### 用 Interface 定义函数
一般定义函数类型我们用 `type`,但有些情况下定义的函数既可被调用,也有一些默认属性值需要定义,我们可以继续用 Interface 定义。
问题:`FunctionComponent` 既可以当作函数调用,同时又能定义 `defaultProps` `displayName` 等固定属性。
方案:
```typescript
interface FunctionComponent<P = {}> {
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
propTypes?: WeakValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
}
```
`(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null` 表示这种类型的变量可以作为函数执行:
```jsx
const App: FunctionComponent = () => <div />;
App.displayName = "App";
```
## 3 总结
看完文章内容,相信你已经可以独立读懂 [@types/react](https://unpkg.com/browse/@types/react@16.9.34/index.d.ts) 这个包的所有类型定义!
更多基础内容可以阅读 [精读《Typescript2.0 - 2.9》](https://github.com/dt-fe/weekly/blob/7de3c77c3bdd7304c9e4b0c0f70c3ba6968ebd29/058.%E7%B2%BE%E8%AF%BB%E3%80%8ATypescript2.0%20-%202.9%E3%80%8B.md) 与 [精读《Typescript 3.2 新特性》](https://github.com/dt-fe/weekly/blob/v2/084.%E7%B2%BE%E8%AF%BB%E3%80%8ATypescript%203.2%20%E6%96%B0%E7%89%B9%E6%80%A7%E3%80%8B.md),由于 TS 更新频繁,后续 TS 技巧可能继续以阅读源码方式进行,希望这次选用的 React 类型源码可以让你印象深刻。
> 讨论地址是:[精读《@types/react 值得注意的 TS 技巧》 · Issue #245 · dt-fe/weekly](https://github.com/dt-fe/weekly/issues/245)
**如果你想参与讨论,请 [点击这里](https://github.com/dt-fe/weekly),每周都有新的主题,周末或周一发布。前端精读 - 帮你筛选靠谱的内容。**
> 关注 **前端精读微信公众号**
<img width=200 src="https://img.alicdn.com/tfs/TB165W0MCzqK1RjSZFLXXcn2XXa-258-258.jpg">
> 版权声明:自由转载-非商用-非衍生-保持署名([创意共享 3.0 许可证](https://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh)
@@ -0,0 +1,133 @@
## 1 引言
Error Boundaries 是 React16 提出来用来捕获渲染时错误的概念,今天我们一起读一读 [A Simple Guide to Error Boundaries in React](https://alligator.io/react/error-boundaries/) 这篇文章,了解一下这个重要机制。
## 2 概述
Error Boundaries 可以用来捕获渲染时错误,API 如下:
```jsx
class MyErrorBoundary extends Component {
state = {
error: null,
};
static getDerivedStateFromError(error) {
// 更新 state,下次渲染可以展示错误相关的 UI
return { error: error };
}
componentDidCatch(error, info) {
// 错误上报
logErrorToMyService(error, info);
}
render() {
if (this.state.error) {
// 渲染出错时的 UI
return <p>Something broke</p>;
}
return this.props.children;
}
}
```
- `static getDerivedStateFromError`: 在出错后有机会修改 state 触发最后一次错误 fallback 的渲染。
- `componentDidCatch`: 用于出错时副作用代码,比如错误上报等。
这两种方法中任意一个被定义时,这个组件就会成为 `Error Boundary` 组件,可以阻止子组件渲染时报错。
最后作者还提出一个建议,建议将 Error Boundary 单独作为一个组件,而不是将错误监听方法与业务组件耦合,一方面考虑到复用,另一方面则因为错误检测只对子组件生效。
好吧,其实 React 官方文档比这篇文章介绍的详细的多得多,原文介绍到此结束。
## 3 精读
[React Error Boundaries 官方文档](https://reactjs.org/docs/error-boundaries.html) 里提到了四种无法 Catch 的错误场景:
1. 回调事件。由于回调事件执行时机不在渲染周期内,因此无法被 Error Boundary Catch 住,如有必要得自行 try/catch。
2. 异步。比如 `setTimeout``requestAnimationFrame`,和第一条同理。
3. 服务端渲染。
4. Error Boundary 组件自身触发的错误。因为只能捕获其子组件的错误。
这也是使用 Error Boundaries 最容易有疑问的地方。除了上面的情况,笔者结合自身经验再列举几种异常边界场景。
### 无法捕获编译时错误
很明显,即便是 React 官方 API `Error Boundary` 也只能捕获运行时错误,而对编译时错误无能为力。
编译时错误包括不限于编译环境错误、运行前的框架错误检查提示、TS/Flow 类型错误等,这些都是 `Error Boundary` 无法捕获的,而且没有更好的办法 Catch 住,遇到编译错误就在编译时解决吧,仅关注运行时错误就好了。
### 可以作用于 Function Component
虽然函数式组件无法定义 `Error Boundary`,但 `Error Boundary` 可以捕获函数式组件的错误,因此可以曲线救国:
```jsx
// ErrorBoundary 组件
class ErrorBoundary extends React.Component {
// ...
}
// 可以捕获所有组件异常,包括 Function Component 的子组件
const App = () => {
return (
<ErrorBoundary>
<Child />
</ErrorBoundary>
);
};
```
### 对 Hooks 也可生效
对于 Hooks 中异常也可以生效,比如下面的代码:
```jsx
const Child = (props) => {
React.useEffect(() => {
console.log(1);
props.a.b;
console.log(2);
}, [props.a.b]);
return <div />;
};
```
要注意的是,出现在 deps 中的错误会立即被 Catch,导致 `console.log(1)` 都无法打印。但如果是下面的代码,则可以打印出 `console.log(1)`,无法打印出 `console.log(2)`:
```jsx
const Child = (props) => {
React.useEffect(() => {
console.log(1);
props.a.b;
console.log(2);
}, []);
return <div />;
};
```
所以 React 官网的这句话并不是指 `Error Boundary` 对 Hooks 不生效,而是指 `Error Boundary` 无法以 Hooks 方式指定,对功能是没有影响的:
> componentDidCatch and getDerivedStateFromError: There are no Hook equivalents for these methods yet, but they will be added soon.
所以这里的理解要注意一下,另外 React 官方文档 [Hooks FAQ](https://reactjs.org/docs/hooks-faq.html#how-do-lifecycle-methods-correspond-to-hooks) 有很多宝藏,建议抽时间逐条阅读。
## 4 总结
`Error Boundary` 可以捕获所有子元素渲染时异常,包括 render、各生命周期函数,但也有很多使用限制,希望你可以正确使用它。
错误捕获也不是万能的,更多时候我们要避免并及时修复错误,通过错误捕获降低出错时对用户体验的影响,并在第一时间内监控起来并快速修复。
最后,你有明明正确使用了 `Error Boundary` 却依然无法 Catch 住的错误 Case 吗?
> 讨论地址是:[精读《React Error Boundaries》 · Issue #246 · dt-fe/weekly](https://github.com/dt-fe/weekly/issues/246)
**如果你想参与讨论,请 [点击这里](https://github.com/dt-fe/weekly),每周都有新的主题,周末或周一发布。前端精读 - 帮你筛选靠谱的内容。**
> 关注 **前端精读微信公众号**
<img width=200 src="https://img.alicdn.com/tfs/TB165W0MCzqK1RjSZFLXXcn2XXa-258-258.jpg">
> 版权声明:自由转载-非商用-非衍生-保持署名([创意共享 3.0 许可证](https://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh)
@@ -0,0 +1,199 @@
## 1 引言
在数据中台做 BI 工具经常面对海量数据的渲染处理,除了组件本身性能优化之外,经常要排查整体页面性能瓶颈点,尤其是维护一些性能做得并不好的旧代码时。
React 性能调试是面对这种问题的必修课,借助 [Profiling React.js Performance](https://addyosmani.com/blog/profiling-react-js/) 这篇文章一起学习一下这个技能吧。
## 2 精读
本文介绍了众多性能检测工具与方法。
### React Profiler
`Profiler` 这个 API 是一种运行时 Debug 的补充,可以通过其 callback 拿到组件渲染信息,用法如下:
```jsx
const Movies = ({ movies, addToQueue }) => (
<React.Profiler id="Movies" onRender={callback}>
<div />
</React.Profiler>
);
function callback(
id,
phase,
actualTime,
baseTime,
startTime,
commitTime,
interactions
) {}
```
这个 callback 会在每次渲染时执行,渲染分为初始化和更新阶段,通过 `phase` 区分,下面是参数详细说明:
- id: 传入的 id。
- phase: "mount" 或 "update",表示更新状态。
- actualDuration: 实际渲染耗时。
- baseDuration: 没有使用 memo 时的渲染预计耗时。
- startTime: 开始渲染的时间。
- commitTime: React 提交更新的时间
- interactions: 何种原因导致的渲染,比如 `setState` 或 hooks changed 之类。
注意尽量不要轻易使用 `Profiler` 检测性能,因为 `Profiler` 本身也会消耗性能。
如果不想获得这么详细的渲染耗时,或者不想提前在代码中埋点,可以利用 DevTools 的 Profiler 查看更直观更简洁的渲染耗时:
<img width=400 src="https://img.alicdn.com/tfs/TB1sPAuDuL2gK0jSZPhXXahvXXa-1846-1028.png">
其中 Ranked 可以展示按照渲染耗时排序后的结果,Interations 需要配合 Tracing API 使用,在后面会提到。
### Tracing API
利用 `scheduler/tracing` 提供的 `trace` API,我们可以记录某个动作的耗时,比如 “点击添加按钮收藏一个电影” 耗时多久:
```jsx
import { render } from "react-dom";
import { unstable_trace as trace } from "scheduler/tracing";
class MyComponent extends Component {
addMovieButtonClick = (event) => {
trace("Add To Movies Queue click", performance.now(), () => {
this.setState({ itemAddedToQueue: true });
});
};
}
```
在 Interations 中可以看到动作触发的耗时:
<img width=400 src="https://img.alicdn.com/tfs/TB1XR.FDAY2gK0jSZFgXXc5OFXa-1846-1010.png">
这个动作还可以是渲染,比如可以记录 ReactDOM 渲染的耗时:
```jsx
import { unstable_trace as trace } from "scheduler/tracing";
trace("initial render", performance.now(), () => {
ReactDom.render(<App />, document.getElementById("app"));
});
```
<img width=300 src="https://img.alicdn.com/tfs/TB18hyHfcKfxu4jSZPfXXb3dXXa-1846-740.png">
甚至还可以追踪异步的耗时:
```jsx
import {
unstable_trace as trace,
unstable_wrap as wrap,
} from "scheduler/tracing";
trace("Some event", performance.now(), () => {
setTimeout(
wrap(() => {
// 异步操作
})
);
});
```
有了 `Profiler``trace` 这两件武器,我们可以监控任意元素的渲染耗时与交互耗时,几乎可以涵盖所有性能监控需要。
### Puppeteer
我们还可以利用 Puppeteer 实现自动化操作并打印报告:
```jsx
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
const navigationPromise = page.waitForNavigation();
await page.goto("https://react-movies-queue.glitch.me/");
await page.setViewport({ width: 1276, height: 689 });
await navigationPromise;
const addMovieToQueueBtn =
"li:nth-child(3) > .card > .card__info > div > .button";
await page.waitForSelector(addMovieToQueueBtn);
// Begin profiling...
await page.tracing.start({ path: "profile.json" });
// Click the button
await page.click(addMovieToQueueBtn);
// Stop profliling
await page.tracing.stop();
await browser.close();
})();
```
首先利用 `puppeteer` 创建一个浏览器,新建一个页面并打开 `https://react-movies-queue.glitch.me/` 这个 URL,等待页面加载完毕后利用 DOM 选择器找到按钮,利用 `page.click` API 模拟点击这个按钮,并在前后利用 `page.tracing` 记录性能变化,并将这个文件上传到 DevTools Performance 面板,就会得到一份自动的性能检测报告:
<img width=400 src="https://img.alicdn.com/tfs/TB1623EDxz1gK0jSZSgXXavwpXa-2769-2289.png">
这张图相当重要,是浏览器综合运行开销分析的利器,最上面分为 4 个部分:
- FPS:每秒帧数,绿色竖线越高表示 FPS 越高,出现红线则表示出现了卡顿。
- CPU:CPU 资源,用面积图展示消耗 CPU 资源的事件。
- NET:网络消耗,每条横杠表示一种资源的加载。
- HEAP:内存水位,由于短时间内看不出来是否会内存溢出,一般只用来简单看看内存消耗是否符合预期,对于内存溢出的检测需要用持续监控上报的方式。
下面会有一张 Network 详细图解,比如这张图:
<img width=400 src="https://img.alicdn.com/tfs/TB1D.wKDxD1gK0jSZFyXXciOVXa-2868-750.png">
细线表示等待的时间,粗线表示实际加载的情况,其中浅色部分表示服务器等待时间,即从发送下载请求到服务器响应第一个字节的时间。这部分可以看出资源并行加载阻塞情况以及资源服务器响应时间是否存在问题。
Timings 展示了几个重要时间节点,这里列举一部分:
- FPFirst Paint,第一次绘制。
- FCPFirst Contentful Paint,第一次内容绘制。
- LCPLargest Contentful Paint,最大内容绘制。
- DCLDocument Content LoadedDOM 内容加载完毕。
再下面是 JS 计算消耗,用了一张火焰图,火焰图是性能分析的常用可视化工具。以下面这张图为例:
<img width=350 src="https://img.alicdn.com/tfs/TB1JecIDrr1gK0jSZFDXXb9yVXa-1404-616.png">
看火焰图首先看跨度最长的函数,也就是最长的那条线,这是最耗时的部分,从左到右是浏览器脚本的调用顺序,从上到下是函数嵌套的顺序。
我们可以看到鼠标位置的 34 这个函数虽然长,但并不是性能瓶颈,因为下面执行的 n 函数长度和它一样,表示 34 函数的性能几乎无损耗,其性能由其调用的 n 函数决定。
我们可以利用这种方式一步步排查到叶子结点,找到对性能影响最大的元子函数。
### User Timing API
我们还可以利用 `performance.mark` 自定义性能检测节点:
```jsx
// Record the time before running a task
performance.mark("Movies:updateStart");
// Do some work
// Record the time after running a task
performance.mark("Movies:updateEnd");
// Measure the difference between the start and end of the task
performance.measure("moviesRender", "Movies:updateStart", "Movies:updateEnd");
```
这些节点可以在上面介绍的 Performance 面板中展示出来用于自定义分析。
## 3 总结
利用 Performance 进行通用性能分析,利用 React Profiler 进行 React 定制性能分析,这两个结合在一起几乎可以完成任何性能检测。
一般来说,首先应该用 React Profiler 进行 React 层面的问题筛查,这样更直观,更容易定位问题。如果某些问题跳出了 React 框架范围,或者不再能以组件粒度进行度量,我们可以回到 Performance 面板进行通用性能分析。
> 讨论地址是:[精读《React 性能调试》 · Issue #247 · dt-fe/weekly](https://github.com/dt-fe/weekly/issues/247)
**如果你想参与讨论,请 [点击这里](https://github.com/dt-fe/weekly),每周都有新的主题,周末或周一发布。前端精读 - 帮你筛选靠谱的内容。**
> 关注 **前端精读微信公众号**
<img width=200 src="https://img.alicdn.com/tfs/TB165W0MCzqK1RjSZFLXXcn2XXa-258-258.jpg">
> 版权声明:自由转载-非商用-非衍生-保持署名([创意共享 3.0 许可证](https://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh)

Some files were not shown because too many files have changed in this diff Show More