dillon1000/react

Commit

Deprecate renderToNodeStream (and fix textarea bug) (#23359)

* Deprecate renderToNodeStream

* Use renderToPipeableStream in tests instead of renderToNodeStream

This is the equivalent API. This means that we have way less test coverage
of this API but I feel like that's fine since it has a deprecation warning
in it and we have coverage on renderToString that is mostly the same.

* Fix textarea bug

The test changes revealed a bug with textarea. It happens because we
currently always insert trailing comment nodes. We should optimize that
away. However, we also don't really support complex children so we
should toString it anyway which is what partial renderer used to do.

* Update tests that assert number of nodes

These tests are unnecessarily specific about number of nodes.

I special case these, which these tests already do, because they're good
tests to test that the optimization actually works later when we do
fix it.
Browse files
Changed paths7 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js ModifiedM packages/react-dom/src/__tests__/ReactServerRendering-test.js ModifiedM packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js ModifiedM packages/react-dom/src/server/ReactDOMLegacyServerNode.js ModifiedM packages/react-dom/src/server/ReactDOMServerFormatConfig.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…