`serverFetch` / `fetch`: move `context` into `init`

オープン
#4,822 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@pi0 がすでに取り組んでいます。

2026年10月26日 から。

  • #4920 @kanchingyg による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Compare the serverFetch and fetch implementations in src/runtime/nitro.ts and src/runtime/internal/app.ts, then read their descriptions in docs/1.docs/62.utils.md. First clarify whether the implementations should be unified or their differences documented, and how the proposed init.context change handles the breaking-change concern. Done means the chosen behavior is consistent between the API and its documentation.

索引モデルが issue の本文から書いたものです。

説明

breaking change discussion

serverFetch(resource, init, context) and fetch(resource, init, context) take context as a third positional argument (src/runtime/nitro.ts, src/runtime/internal/app.ts). Moving it to init.context would match the standard fetch signature and leave room to grow. Changing it after RC would be breaking.

Related: nitro and nitro/app export different implementations. The nitro one looks up the app on globalThis.__nitro__ / __nitro_builder__ and works outside the bundle; the nitro/app one calls useNitroApp(). docs/1.docs/62.utils.md describes them as the same, so we should either document the difference or unify them.

Opened with AI assistance.

主要言語
TypeScript
スター
11.5k
フォーク
968
平均マージ
4日 9時間
マージ済み PR(30日)
64

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nitrojs/nitro のほかの issue

nitrojs/nitro の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。