Keep zod out of the startup path to shrink the main bundle
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 32/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript, vite
- Ambito
- frontend, performance, testing
Direzione di ricerca
Start with apps/web/vite.config.ts and packages/engine/src/load.ts, then read apps/web/src/services/packs.ts and the referenced ADRs and SECURITY.md. Measure the current chunks and compare the listed options; record the chosen approach and main chunk budget in the issue. Done means CI enforces the budget, an invalid stored pack is rejected before engine execution, and throttled mobile startup time is measured before and after.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
At the v0.1 pull request the main chunk is about 85 KB gzip (270 KB raw). It includes zod, pulled in by loadPack, which validates every pack (built-in, stored, imported) before use. The Create screen (54 KB gzip) and the YAML compiler (32 KB gzip) are already separate chunks. Start-up time on low-end phones matters (ADR 0009), and validation at the boundary must stay (SECURITY.md).
Options
- A. A small hand-written validator for the canonical compiled form (
.lexpack.jsonhas one shape), used byloadPack; zod stays for YAML compile and import. Drift risk: test it against the zod schema with shared valid and invalid fixtures. - B. Lazy-load the zod chunk: the library shows catalog metadata, and full validation runs when a game starts.
- C. Trust built-in packs by a content hash recorded at build time (they pass
lexvm checkin CI); validate stored and imported packs with zod, lazily. - D. A smaller schema library. This is a new dependency and changes ADR 0004.
Scope
Measure the chunks, choose an option (an ADR if D), agree a size budget for the main chunk in this issue, and enforce it in CI.
Acceptance criteria
- The chosen option and the budget are recorded in this issue (ADR if D).
- The main chunk is within the budget; CI fails when it is exceeded.
- Every pack is still validated before the engine runs it (test with a crafted invalid
.lexpack.jsonin storage). - Start-up time on a throttled mobile profile is measured before and after.
References
- apps/web/vite.config.ts
- packages/engine/src/load.ts
- apps/web/src/services/packs.ts
- docs/adr/0004-yaml-source-json-runtime-zod-schema.md
- docs/adr/0009-vanilla-typescript-ui.md
- SECURITY.md (Controls)
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Merge medio
- 28m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nullthrone/lexvm
-
area: web good first issue priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nullthrone/lexvm#49 ·
-
area: infra good first issue priority: low type: chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
nullthrone/lexvm#41 ·
-
area: engine good first issue priority: low type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
nullthrone/lexvm#27 ·
-
area: web priority: low type: research
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
nullthrone/lexvm#63 ·
-
area: infra area: web priority: medium type: chore
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
nullthrone/lexvm#62 ·
Tutte le issue di nullthrone/lexvm
Issue simili
-
area: image-engine bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
snapotter-hq/SnapOtter#3885 ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug P3 UI/UX
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
openclaw/openclaw#182077 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno