reactjs / reactjs/react.dev

[Beta] Use Server Components

Aperta
#4,364 0 commenti 3 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

This is not actually feasible yet but it would be nice to prepare so that when they're stable-ish in Next, we can use them.

I started a branch in https://github.com/reactjs/reactjs.org/tree/sc which only has http://localhost:3000/apis/usestate and http://localhost:3000/learn/props stubs which I use for testing.

I've ran into a few things already:

  • Basic stub
  • Shared components can't import client components (https://github.com/vercel/next.js/issues/34594), seems like a big problem for any serious code conversion
  • Actually renaming the files (it would be nice to have a script to do that)
    • We can actually do this before adopting SC so that by the time they're out, it's easy to switch. I.e. let's try to convert the site to use .client for things that need to be client components, and to follow SC rules. And then see how far we can keep things on the server, i.e. how many files don't really need .client if we do a bit of refactoring.
  • There's no support for SSG, it seems, yet. Next generates something with server runtime. Not sure when SSG is on the roadmap (if at all?)

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 esaminando il branch sc e i relativi stub /apis/usestate e /learn/props, quindi verifica le limitazioni di Next.js collegate relative ai componenti condivisi e a SSG. L'issue non indica file o test; per completarla sarebbe necessario concordare l'ambito della ridenominazione in .client, dell'adozione dei Server Components e del supporto a SSG.

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

Valutazione

Stack tecnologico
javascript, next.js, react
Ambito
documentation
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.