Server Components: RSC client runtime lands in the shared entry chunk even when one route uses it
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 15.3k
- フォーク
- 1.9k
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 46
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/router のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')対応中かも @hassanabrar202 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)対応中かも @Sheraff が 27 日前に担当しました。 オープンpackage: router-generator performance
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiers対応中かも @Sheraff が 27 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
docs(router): clarify static title fallback in SPA mode対応中かも @Rohan-Dedhia が 17 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
TanStack/router の issue をすべて見る
似ている issue
-
[BUG]: Shared links drop the configured basePath on GitHub Pages対応中かも @anshulchikhale30-p が今日担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add: GTrekkerオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
メンテナーはふだん 1 日以内に返信
-
area: ui Bug Payload OSS
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
payloadcms/payload#19839 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
メンテナーはふだん 1 日以内に返信