Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Keep zod out of the startup path to shrink the main bundle

Aperta
#34 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

area: engine area: web priority: medium type: chore

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.json has one shape), used by loadPack; 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 check in 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.json in 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nullthrone/lexvm

Tutte le issue di nullthrone/lexvm

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.