reactjs / reactjs/react.dev

[Beta] Use Server Components

Đang mở
#4,364 0 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng việc xem xét branch sc và các stub /apis/usestate/learn/props của branch này, sau đó kiểm tra các giới hạn của Next.js được liên kết về component dùng chung và SSG. Issue không nêu tên file hoặc test; để hoàn thành sẽ cần thống nhất phạm vi cho việc đổi tên thành .client, áp dụng Server Components và hỗ trợ SSG.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, next.js, react
Lĩnh vực
documentation
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.