Client setup seam: run app code before the generated entry's hydrate (start.clientSetup)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript, vite
- Ambito
- build-system, frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@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:preloadErrorlistener before any lazy route chunk loads. - Reading a third-party global that a classic
<script>in<body>defines (Telegram'stelegram-web-app.js). Today the generated entry is anasyncmodule 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):
start.clientSetup: './src/client-setup.ts'. The generated client entry doesawait import(setup)(or a static import placed first) beforehydrate. This mirrorsstart.instrumenton the server.- 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.
- Lingua principale
- TypeScript
- Stelle
- 522
- Fork
- 73
- Merge medio
- 1g 5h
- PR unite (30g)
- 34
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di solidjs/solid-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesForse già presa @carloitaben l’ha presa 54 giorni fa. Aperta1.x
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
solidjs/solid-vite-plugin#205 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
solidjs/solid-vite-plugin#420 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 30/100
solidjs/solid-vite-plugin#418 ·
I maintainer di solito rispondono entro 1 giorno
-
Dev manifest bridge keeps stale CSS after an editForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 34/100
solidjs/solid-vite-plugin#415 ·
I maintainer di solito rispondono entro 1 giorno
-
Dev manifest loses lazy CSS when imported before HTTP startupForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
solidjs/solid-vite-plugin#414 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid-vite-plugin
Issue simili
-
area:ui effort:S enhancement priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
QuantumNous/new-api#7839 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
dark-princezz/stellar-hooks#1010 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
interledger/rhyza#352 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno