Server Components: RSC client runtime lands in the shared entry chunk even when one route uses it
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Versions
@tanstack/react-start1.169.5,@tanstack/react-router1.170.46,@tanstack/react-start-rsc0.1.66@vitejs/plugin-rsc0.5.39, Vite 8 (Vite+ core 1.5.0), React 19.3.1, production build
What happens
With tanstackStart({ rsc: { enabled: true } }) and rsc(), one route that calls renderServerComponent(<p>…</p>) from a server function adds the RSC client runtime to the shared entry chunk, so every route pays for it, not only the route that uses Server Components.
Same app and sources, before and after adding that one route (vite build --sourcemap, bytes attributed per source file through the maps):
| before | after | |
|---|---|---|
| all client JS, raw | 1,663,509 B | 1,674,859 B (+11,350) |
| all client JS, gzip | 554,604 B | 560,321 B (+5,717) |
shared index chunk, raw |
303,755 B | 329,464 B |
shared index chunk, gzip |
96,334 B | 104,493 B (+8.2 kB) |
Sources in the index chunk afterwards include @tanstack/react-start-rsc/dist/esm/rscCssEnvelope.js, reactSymbols.js, awaitLazyElements.js and ServerComponentTypes.js; @vitejs/plugin-rsc accounts for about 19 kB raw.
Expectation
For an app that adopts Server Components on a few routes, I'd expect the Flight client runtime to load with those routes' chunks (or lazily on first use), not in the entry chunk. Is that something that can be code-split today, for example through the route's lazy chunk, or is the entry chunk the intended place? If it is intended, a note in the Server Components guide about the fixed client cost would help people size the trade-off.
- Ngôn ngữ chính
- TypeScript
- Star
- 15.3k
- Fork
- 1.9k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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.
Issue khác của TanStack/router
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')Có thể đã có người làm @hassanabrar202 đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)Có thể đã có người làm @Sheraff đã nhận 27 ngày trước. Đang mởpackage: router-generator performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiersCó thể đã có người làm @Sheraff đã nhận 27 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(router): clarify static title fallback in SPA modeCó thể đã có người làm @Rohan-Dedhia đã nhận 17 ngày trước. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/router
Issue tương tự
-
[BUG]: Shared links drop the configured basePath on GitHub PagesCó thể đã có người làm @anshulchikhale30-p đã nhận hôm nay. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: GTrekkerĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ui Bug Payload OSS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
payloadcms/payload#19839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
Maintainer thường phản hồi trong vòng 1 ngày