Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#34 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
32/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript, vite

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)
Lenguaje dominante
TypeScript
Estrellas
0
Forks
0
Merge medio
28 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nullthrone/lexvm

Todos los issues de nullthrone/lexvm

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.