Shrink the page collector bundle: parse5 and preact are 92% of it
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
- Issue 類型
- 重構
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- typescript
研究方向
Start with the collector preload and the transform path in packages/app, then trace the current parseDocument round trip and vnode wire shape across the four adapters. Verify the examples and #403's headed reproduction; done means the page bundle is well under 50 KB while DOM capture, replay, and the A11y tab remain unchanged.
由索引模型根據 Issue 內容生成。
描述
Blocks #403, where a headed Chrome 154 session hangs on the first navigation
because the collector preload is 213 KB. That bisect showed the cost is payload
size alone, superlinear per script, and that our code is not implicated: 213 KB
of comment hangs identically.
The mitigations all cost something. Chunked registration needs the source
rebuilt from string parts and evaled, which a strict script-src CSP blocks,
so it trades a headed hang for silently losing DOM capture on exactly the pages
most likely to be real applications. Fetching the collector from the backend has
the same CSP exposure, and the JS service starts no backend in trace mode. A
preload script's body bypasses page CSP; anything evaluated from a string does
not. So the only route with no downside is to register less code.
What the bundle is
| bytes | share | |
|---|---|---|
| parse5 | 148,535 | 69.5% |
| preact / htm | 47,549 | 22.2% |
| the collector itself | 17,717 | 8.3% |
Why the two big ones are there, and why they need not be
parse5 serves a round trip the page does not need. parseDocument reads
node.outerHTML, serialising the live DOM to a string, then parses that string
back into a tree. The collector is already standing in the document. Walking the
nodes directly produces the same tree without the serialize/parse pair, and is
strictly cheaper at capture time as well.
preact/htm builds vnodes the app does not consume as vnodes. transform in
packages/app reads the wire shape and calls h() itself, so the page side only
has to emit plain { type, props } objects.
Removing both takes the preload from 213 KB to roughly 18 KB, which the #403
bisect measures at baseline navigation cost.
Acceptance criteria
The page bundle registers well under 50 KB. DOM capture, replay and the A11y
tab are unchanged across all four adapters, verified on the examples rather than
by unit tests alone, since this is the fidelity-critical path. #403's headed
reproduction passes.
Size: L. The serializer is delicate and shared by every adapter, so this wants
its own verification pass rather than riding along with another change.
- 主要語言
- TypeScript
- 星號
- 10
- 分支
- 2
- 平均合併
- 1 天 7 小時
- 30 天內合併 PR
- 29
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
webdriverio/devtools 的其他 Issue
-
Require the Node.js releases with the eMudhra CA fix (22.23.4, 24.22.1, 26.12.1)可能已有人在做 @plum117 今天認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
webdriverio/devtools#450 ·
維護者通常 1 天內回覆
-
Generate the adapter capability matrix instead of maintaining three by hand可能已有人在做 @vishnuv688 於 4 天前認領。 未關閉capture-architecture enhancement
難度 5/5 一週以上 新手友好度 42/100
webdriverio/devtools#402 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Spike: how to avoid re-implementing capture per language可能重新可做 @vishnuv688 於 74 天前認領,目前沒有進行中的 PR。 未關閉capture-architecture
webdriverio/devtools#298 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Epic: Cross-language capture architecture可能重新可做 @vishnuv688 於 74 天前認領,目前沒有進行中的 PR。 未關閉capture-architecture
webdriverio/devtools#278 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 webdriverio/devtools 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
grafana/profiles-drilldown#1212 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
grafana/traces-drilldown#980 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
openremote/openremote#3487 · 1 則留言 ·
-
triage:needs-human
難度 2/5 1-3 小時 新手友好度 67/100
garrytan/gbrain#7635 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
coollabsio/jean#867 ·
維護者通常 1 天內回覆