reactjs / reactjs/react.dev

[Beta] Use Server Components

Offen
#4,364 0 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
11.8k
Forks
7.9k
Ø Merge
1 T. 11 Std.
Gemergte PRs (30 T.)
11

Beschreibung

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?)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Überprüfung des sc-Branches und seiner Stubs /apis/usestate und /learn/props; prüfe anschließend die verlinkten Next.js-Einschränkungen rund um gemeinsam genutzte Komponenten und SSG. Das Issue nennt keine Dateien oder Tests; für den Abschluss wäre ein abgestimmter Umfang für die Umbenennung in .client, die Einführung von Server Components und die Unterstützung von SSG erforderlich.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, next.js, react
Bereich
documentation
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.