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

Client setup seam: run app code before the generated entry's hydrate (start.clientSetup)

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

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
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript, vite

Línea de trabajo

This is a design decision, not a ready-to-code task: the issue asks for a start.clientSetup option or a <ClientEntry /> component, and the maintainers have not chosen between them. Start with the code that generates the client entry and the existing start.instrument server hook, which the issue uses as the model. Done means a maintainer agrees on the API and the generated entry runs the setup module before hydrate.

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

Descripción

@solidjs/vite-plugin 3.0.0-next.50, solid-js 2.0.0-rc.15.

The generated client entry calls hydrate straight away, and there is no place for app code that has to run in the browser before hydration. Our real cases:

  • Installing a server-function transport wrapper that detects a response from another build (version skew) and reloads. It must be in place before the first render fires the page's reads.
  • A request-header hook on that transport, for example a tenant selector header the server functions need.
  • Registering the vite:preloadError listener before any lazy route chunk loads.
  • Reading a third-party global that a classic <script> in <body> defines (Telegram's telegram-web-app.js). Today the generated entry is an async module in <head>, so its order relative to that script is not guaranteed. #411 / solidjs/solid#4002 fixed hydration itself here, but not setup code that reads globals.

Because of this we keep authored entry-client.tsx / entry-server.tsx pairs only to run three lines before hydrate. That means we also carry the Document + hydrate(…, document) boilerplate that the generated entries would give us.

Suggestion (either works for us):

  1. start.clientSetup: './src/client-setup.ts'. The generated client entry does await import(setup) (or a static import placed first) before hydrate. This mirrors start.instrument on the server.
  2. A <ClientEntry /> component that the document places where it wants (for example at the end of <body>), with the setup module option above.

Option 1 alone would let us delete both authored entries.

Lenguaje dominante
TypeScript
Estrellas
522
Forks
73
Merge medio
1 d 5 h
PR fusionados (30 d)
34

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 solidjs/solid-vite-plugin

Todos los issues de solidjs/solid-vite-plugin

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.