reactjs / reactjs/react.dev

[Beta] Use Server Components

Open
#4,364 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the sc branch and its /apis/usestate and /learn/props stubs, then check the linked Next.js limitations around shared components and SSG. The issue does not name files or tests; completion would need an agreed scope for .client renaming, server-component adoption, and SSG support.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js, react
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.