From 627e1bebae5b96f282a92cec175fb94b0f594a38 Mon Sep 17 00:00:00 2001 From: gnoff Date: Fri, 19 Apr 2024 04:11:51 +0000 Subject: [PATCH] Remove `renderToStaticNodeStream` (#28873) Stacked on #28872 renderToStaticNodeStream was not originally deprecated when renderToNodeStream was deprecated because it did not yet have a clear analog in the modern streaming implementation for SSR. In React 19 we have already removed renderToNodeStream. This change removes renderToStaticNodeStream as well because you can replicate it's semantics using renderToPipeableStream with onAllReady or renderToReadableStream with await stream.allready. DiffTrain build for [33a32441e991e126e5e874f831bd3afc237a3ecf](https://github.com/facebook/react/commit/33a32441e991e126e5e874f831bd3afc237a3ecf) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/ReactDOMServer-dev.classic.js | 10 +--------- compiled/facebook-www/ReactDOMServer-dev.modern.js | 10 +--------- compiled/facebook-www/ReactDOMServer-prod.classic.js | 5 +---- compiled/facebook-www/ReactDOMServer-prod.modern.js | 5 +---- .../facebook-www/__test_utils__/ReactAllWarnings.js | 1 - 6 files changed, 5 insertions(+), 28 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index a0b3f434b41a6..6bd92ef89bccf 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -d329ff9d9e87f3f909f98cf63701ef3795cf2584 +33a32441e991e126e5e874f831bd3afc237a3ecf diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index a0e02131856b3..7826ae5295ca8 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); - var ReactVersion = "19.0.0-www-classic-477ccba7"; + var ReactVersion = "19.0.0-www-classic-09d610a8"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -14736,15 +14736,7 @@ if (__DEV__) { ); } - function renderToStaticNodeStream() { - throw new Error( - "ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available " + - "in the browser. Use ReactDOMServer.renderToStaticMarkup() instead." - ); - } - exports.renderToStaticMarkup = renderToStaticMarkup; - exports.renderToStaticNodeStream = renderToStaticNodeStream; exports.renderToString = renderToString; exports.version = ReactVersion; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index feafd8e8ca8f1..0d9f195ff6e8b 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); - var ReactVersion = "19.0.0-www-modern-d1bfd9cd"; + var ReactVersion = "19.0.0-www-modern-a9bcdef2"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -14641,15 +14641,7 @@ if (__DEV__) { ); } - function renderToStaticNodeStream() { - throw new Error( - "ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available " + - "in the browser. Use ReactDOMServer.renderToStaticMarkup() instead." - ); - } - exports.renderToStaticMarkup = renderToStaticMarkup; - exports.renderToStaticNodeStream = renderToStaticNodeStream; exports.renderToString = renderToString; exports.version = ReactVersion; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index a7fddabef8458..c69554d6310d6 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5676,9 +5676,6 @@ exports.renderToStaticMarkup = function (children, options) { 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.renderToStaticNodeStream = function () { - throw Error(formatProdErrorMessage(208)); -}; exports.renderToString = function (children, options) { return renderToStringImpl( children, @@ -5687,4 +5684,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-www-classic-77d529ff"; +exports.version = "19.0.0-www-classic-c3826905"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index cc6a8f9c5f4aa..2f5f861f84c86 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5654,9 +5654,6 @@ exports.renderToStaticMarkup = function (children, options) { 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.renderToStaticNodeStream = function () { - throw Error(formatProdErrorMessage(208)); -}; exports.renderToString = function (children, options) { return renderToStringImpl( children, @@ -5665,4 +5662,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-www-modern-322b4431"; +exports.version = "19.0.0-www-modern-f02d17e5"; diff --git a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js index da5b09955f865..a06cfef7c11ad 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -248,7 +248,6 @@ export default [ "ReactDOM.unstable_renderSubtreeIntoContainer() has not been supported since React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot", "ReactDOM.unstable_renderSubtreeIntoContainer() was removed in React 19. Consider using a portal instead.", "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - "ReactDOMServer.renderToStaticNodeStream() is deprecated and will be removed in an upcomingrelease of React. Use ReactDOMServer.renderToPipeableStream() and wait to `pipe` until the `onAllReady` callback has been called to produce a document suitable for static use cases.", "ReactTestUtils.mockComponent() is deprecated. Use shallow rendering or jest.mock() instead.\n\nSee https://react.dev/link/test-utils-mock-component for more information.", "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", "Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.",