reactjs / reactjs/react.dev

Setting the record straight on hydration

Aperta
#3,016 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
11.8k
Fork
7.9k
Merge medio
1g 11h
PR unite (30g)
11

Descrizione

Anything I google related to react and hydration has the following blog post come up written by a prominent Google employee: https://addyosmani.com/blog/rehydration/

It shows the DOM being entirely destroyed and recreated as pictured below. The hydrate docs are a bit unclear about what exactly happens during hydration. They start out by saying that hydrate "is used to hydrate a container", but never explicitly define hydration. And so we must rely on blogs such as the one linked above to explain what hydration in more detail. After hours of digging through inaccurate information I'm pretty sure the above blog is terribly misleading.

If I'm right that Addy's image is incorrect, perhaps someone from Facebook could use their network to reach out and get this image corrected to reflect that the DOM is not destroyed? Otherwise, it would be helpful for React to have its own docs that explain hydration in more depth. The docs describe to some degree what happens during hydration, but not exactly why and leave a lot of ambiguity. E.g. why does hydration "patch up differences in text content" and why would such differences exist in the first place?

hydrate@2x

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo la documentazione collegata di React hydrate e l’articolo di riferimento su hydration, quindi confronta le loro descrizioni del riutilizzo del DOM e delle discrepanze nel testo. Aggiorna la documentazione di React in modo che hydration sia definita esplicitamente, che il suo scopo sia spiegato e che le cause delle differenze nel contenuto testuale siano chiare; le indicazioni riviste dovrebbero risolvere l’ambiguità sollevata qui.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.