Shrink the page collector bundle: parse5 and preact are 92% of it
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Refactoring
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 10
- Forks
- 2
- Ø Merge
- 1 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus webdriverio/devtools
-
capture-architecture enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
webdriverio/devtools#402 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Spike: how to avoid re-implementing capture per languageEvtl. wieder frei @vishnuv688 hat das vor 70 Tagen übernommen, und es ist kein Pull Request offen. Offencapture-architecture
webdriverio/devtools#298 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Epic: Cross-language capture architectureEvtl. wieder frei @vishnuv688 hat das vor 70 Tagen übernommen, und es ist kein Pull Request offen. Offencapture-architecture
webdriverio/devtools#278 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in webdriverio/devtools
Ähnliche Issues
-
[BUG] rag: sentence content can cross the reported sentence boundariesEvtl. vergeben @LJK-ikun hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
platformatic/mcp#361 ·
Maintainer antworten meist innerhalb von 1 Tag
-
frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
melgarafael/DeskcommCRM#3164 ·
Maintainer antworten meist innerhalb von 1 Tag