Inert hydration data mode for hash-based CSP on cached SSR pages
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
Línea de trabajo
Start by reading the hydration paths in packages/web/src/server.ts, packages/solid/src/client/hydration.ts, packages/web/src/client.ts, and the bootstrap runtime. Then trace the existing serialization and streaming flow and inspect createJSONSerializer and createJSONDataTable. Done means an opt-in inert data mode with a fixed pump handles streamed values and hydration tasks, is covered by byte-exact fixtures, and adds no bytes when disabled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Split out of #4028 (proposal 1). Deferred until after 2.0.
Problem
Hydration data is currently executable JS: each flush writes an inline script that assigns seroval output into _$HY.r. Fragment swaps ($df), head ops, the shell-end marker and redirects are inline scripts too.
Under a strict CSP an inline script runs only with a per-request nonce or a listed hash. A cached or CDN-served SSR page can't carry a fresh nonce. Hashes don't help either, because the data scripts' bodies differ per page, so the CSP header can't be written ahead of time.
#4161 made async-mode output deterministic, so the same data now gives the same bytes and the same hashes. That doesn't help when the data itself differs.
Idea
- Inert data: emit values as
type="application/json"script blocks. The browser never executes them, so CSP doesn't apply. - Fixed pump: one runtime script whose bytes are identical on every render, so its hash is a build-time constant for a static CSP header. It decodes the JSON blocks into
_$HY.rand settles streamed promises. Streaming chunks are each followed by the same constant trigger script. - Today's executable tasks (fragment swaps, head ops, shell-end marker) become data records the pump applies. The redirect becomes a meta refresh.
Cost and constraints
- JSON can't express seroval's JS output (shared and cyclic refs, promises, Maps, Dates), so the data uses the JSON data-table format (
createJSONSerializer/createJSONDataTable) plus a client decoder. - This is a second hydration wire format to keep in sync on both server (
packages/web/src/server.ts) and client (packages/solid/src/client/hydration.ts,packages/web/src/client.ts, the bootstrap runtime). - It must be opt-in and pay-for-use: apps that don't enable it should ship zero extra bytes, with the decoder tree-shaken away.
- Rough estimate: 600–1,000 lines plus byte-exact fixtures.
Who needs it: apps serving cached or static SSR HTML under a hash-based CSP. Nonce-based CSP works today.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 10 h 34 min
- PR fusionados (30 d)
- 364
Preparar el entorno
- Sin Dockerfile ni 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 solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Posiblemente ocupada @itisrmk la tomó hace 6 días. Abierto1.x
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
[2.0] Event handlers fired synchronously from an effect (focus(), showModal()) inherit the effect's strict-read windowPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 44/100
Los mantenedores suelen responder en 1 día
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsPosiblemente ocupada @boombang la tomó hace 8 días. Abierto1.x
Dificultad 4/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Per-scope takeover for live nodes whose server value is still streaming (D8 follow-up to #3817)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
source-cooperative/docs.source.coop#41 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Nimblesite/SharpLsp#468 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
solidjs-community/solid-primitives#1082 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día