Deprecate renderToNodeStream (and fix textarea bug) #23359
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a deprecation warning for renderToNodeStream and favors the new renderToPipeableStream.
Notably renderToStaticNodeStream is NOT deprecated yet. That's because the static optimizations are only in the legacy build right now. I don't really want to add that flag to the main line so we should do something special for the e-mail generation use case with a special build. So we don't have an alternative yet. That also means there's no static option for Web Streams.
I switched our integration tests to use renderToPipeableStream. That revealed some breaking tests. All due to the fact that we add trailing comment nodes to any text node. This is pretty clowny and known optimization that we know we need to add back in. The only reason it didn't break before is because the legacy version strips it out at the end.
However, in the case of "textarea" that's actually a bug since that will show up in the textarea's value. So I fixed that bug.