[Beta] Use Server Components
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
- Need a layout system (I hacked one in)
- Need to have a way to pass components to MDX
- Minor bug I worked around https://github.com/vercel/next.js/issues/34595
- 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
.clientfor 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.clientif we do a bit of refactoring.
- 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
- 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
- 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.
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