[⚡] [V2] every useComputed$ gets its own tiny chunk, and resume imports all of them at load
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rollup, typescript, vite
- Área
- build-system, frontend, performance
Línea de trabajo
Start with EAGER_CTX_NAMES and the rolldown group logic in packages/qwik-vite/src/plugins/plugin.ts, then the signal QRL resolution in inflate.ts. The reporter's draft PR #9366 already proposes placing computeds with their creating entry, so review that before proposing another approach. Done means the chunking decision is settled and the resume path no longer issues one dynamic import per computed, which needs maintainer agreement on the design.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which component is affected?
Qwik Core (optimizer / build)
Describe the bug
Hey 👋
In a production build with the default smart entry strategy, every useComputed$ segment ends up in its own tiny chunk (70 to 500 bytes), because the rolldown group for the "eager contexts" returns null for them:
https://github.com/QwikDev/qwik/blob/main/packages/qwik-vite/src/plugins/plugin.ts (EAGER_CTX_NAMES, with the comment "Eager contexts stay with their parent, not a segment chunk" and a TODO about useComputed$)
Since 7f51ab522 the runtime resolves the QRL of every serialized computed signal while resuming (inflate.ts), so a page pays one dynamic import() per computed at load, before any of them is needed. In v1 a computed's code was only loaded when it had to recompute, so the split cost nothing there.
On a page of mine with 38 computeds at load this showed up as the biggest part of the resume task: importSymbol took 52 ms self time (4x CPU throttle) against 7 ms for the same app on Qwik 1.x, and the page had a 122 to 134 ms long task right after qresume (Lighthouse mobile, chords page, text heavy, about 620 DOM nodes).
I opened a draft PR that treats a computed like useTask$ (it ships with the chunk of the entry that created it): https://github.com/QwikDev/qwik/pull/9366
Numbers, same app and same data, Lighthouse mobile, 3 runs each:
| TBT | long task after resume | |
|---|---|---|
| main as is | 88 to 106 ms | 122 to 134 ms |
| with the PR | 58 to 68 ms | 100 to 103 ms |
(For comparison the same page on Qwik 1.x has about 5 ms TBT, the rest of the gap is state deserialization at resume.) The same 38 computed symbols still run at load.
How to see it
Build any app with a few useComputed$ in components that are server rendered and look at dist/build: one chunk per computed, each exporting a single s_... symbol. Then load the page and look at the network tab right after resume.
I can put together a small repro repo if that helps.
System Info
Binaries:
Node: 24.16.0
npmPackages:
@qwik.dev/core: 2.0.0-rc.4 (+ main)
vite: 8.x
- Lenguaje dominante
- TypeScript
- Estrellas
- 22.1k
- Forks
- 1.4k
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 159
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QwikDev/qwik
-
Reveal: resolved but blocked Pending boundary hides its fallbackPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
docs router V2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
DX enhancement V2
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
QwikDev/qwik#8480 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
preloader V2
Dificultad 4/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
Todos los issues de QwikDev/qwik
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
feature request needs triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 69/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
HarperFast/symphony#91 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
solidjs/solid-docs#1716 ·
Los mantenedores suelen responder en 1 día