Transform inline "use server" functions inside file-level "use server" files
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- react, typescript
- 領域
- build-system
調査の方向性
組み込みの Server Function transform から始め、モジュールレベルの "use server" ディレクティブとインラインの "use server" ディレクティブをどのように処理するかを追跡します。issue の例を再現用として使用し、その後、利用可能であれば既存の transform のカバレッジを調べます。outer と inner の両方が独立した Server Functions として登録され、inner を返すとシリアライズ可能なサーバー参照が生成されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The composability issue of file directive and inline directive is hinted in https://github.com/vitejs/vite-plugin-react/issues/1336 for use server/cache, but this is already an issue with same use server directives. Before jumping too focused on use server/cache composition, we should evaluate the design for use server separately.
It may be a low priority if it's not used in practice, but it's good to be aware that there's a general Next.js transform approach divergence.
EDIT: It turned out Next.js doesn't support fully due to runtime side issue:
https://github.com/hi-ogawa/reproductions/tree/main/next-rsc-returned-nested-action
Description
The built-in Server Function transform currently chooses between handling a module-level "use server" directive and handling inline "use server" directives. When a file has the module directive, it wraps the module exports but does not hoist and register explicitly annotated local functions inside those exports.
For example:
'use server'
export async function outer() {
async function inner() {
'use server'
return 'inner result'
}
return inner
}
outer is exported and inherits the module-level role. inner is local, so it does not inherit that role, but its own inline directive explicitly declares it as a Server Function. The expected result is that outer and inner are independently registered Server Functions and that calling outer can return inner as a serializable server reference.
The current transform registers only outer. It leaves inner as an ordinary nested function, including the inert directive string in its body. Returning that function through React therefore does not produce a registered server reference.
- 主要言語
- TypeScript
- スター
- 1.2k
- フォーク
- 287
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vitejs/vite-plugin-react のほかの issue
-
plugin-rsc: a client reference's CSS is linked before the CSS of the chunks it imports (build)対応中かも @wozhenbang2004 が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
vitejs/vite-plugin-react#1570 ·
メンテナーはふだん 1 日以内に返信
-
[plugin-rsc] With two dev servers in one process, loadModule runs in the last server's environmentオープン
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
vitejs/vite-plugin-react#1589 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
vitejs/vite-plugin-react#1581 ·
メンテナーはふだん 1 日以内に返信
-
[plugin-rsc] Build exits 0, but the app fails at runtime: a server action imported only by browser code is missing from the RSC build対応中かも @NeilPant が 4 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
vitejs/vite-plugin-react#1578 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
vitejs/vite-plugin-react#1577 ·
メンテナーはふだん 1 日以内に返信
vitejs/vite-plugin-react の issue をすべて見る
似ている issue
-
bug from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nightly-labs/openbot#18462 ·
メンテナーはふだん 1 日以内に返信
-
Fast and light shell approval "Always allow" button shows raw English backticks and scrambles commands in Arabic対応中かも @tylerbea が今日担当しました。 オープンagent-ui bug p3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug] Windows: Ctrl+C / Ctrl+V not working in chat input box対応中かも @PranavTJ-05 が今日担当しました。 オープンcomp/desktop desktop/chat desktop/shell os/windows P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NousResearch/hermes-agent#161023 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
resources
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
railmapgen/rmg-templates#2703 ·
メンテナーはふだん 1 日以内に返信
-
TypeScript OSS: `huggingfaceBaseUrl` is dropped by config validation, so the documented HuggingFace embedder example throws対応中かも @jaisogani-ai が今日担当しました。 オープンbug sdk-typescript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信