reactjs / reactjs/react.dev

react-dom/server: clarify when `renderToPipeableStream` is appropriate

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

まだ誰も着手していません。

主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

At https://reactjs.org/docs/react-dom-server.html#rendertopipeablestream we see this note:

This is a Node.js specific API and modern server environments should use renderToReadableStream instead.

I initially read this as saying "use renderToReadableStream in any environment where web streams are available." This includes modern versions of Node: https://nodejs.org/api/webstreams.html.

But going to the main React 18 release notes page https://reactjs.org/blog/2022/03/29/react-v18.html#react-dom-server, we see that there is a different distinction being made.

renderToPipeableStream: for streaming in Node environments.
renderToReadableStream: for modern edge runtime environments, such as Deno and Cloudflare workers.

(Aside: is Deno really an "edge runtime environment"? 🤔 )

Combined with @sebmarkbage's outlining of the downsides of web streams here https://github.com/reactwg/react-18/discussions/91, it seems clear that renderToPipeableStream should always be preferred in Node environments. It'd be nice if the docs clearly spelled this out.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

リンク先の renderToPipeableStream ドキュメントから始め、その文言を React 18 のリリースノートおよびリンク先の web streams に関する議論と比較してください。Node 環境と edge runtime の違いを明確にし、改訂された注記が、最新の Node では renderToReadableStream を使うべきだと示唆していないことを確認してください。

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

評価

技術スタック
javascript, react
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
58/100

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

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