[Beta] Use Server Components
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
- 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?)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 và /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