@@ -99,12 +99,7 @@ function originalRenderToNodeStream(element, cache, streamingStart, memLife=0) {
9999 return new ReactMarkupReadableStream ( element , false , cache , streamingStart , memLife ) ;
100100}
101101
102- export function renderToNodeStream ( element , cache , res ) {
103- 104- const htmlStart =
105- '<html><head><title>Page</title></head><body><div id="react-root">' ;
106- 107- const htmlEnd = '</div></body></html>' ;
102+ export function renderToNodeStream ( element , cache , res , htmlStart , htmlEnd , memLife ) {
108103
109104 const streamingStart = {
110105 sliceStartCount : htmlStart . length ,
@@ -114,7 +109,7 @@ export function renderToNodeStream(element, cache, res) {
114109 cacheStream . pipe ( res ) ;
115110 cacheStream . write ( htmlStart ) ;
116111
117- const stream = originalRenderToNodeStream ( element , cache , streamingStart ) ;
112+ const stream = originalRenderToNodeStream ( element , cache , streamingStart , memLife ) ;
118113 stream . pipe ( cacheStream , { end : false } ) ;
119114 stream . on ( "end" , ( ) => {
120115 cacheStream . end ( htmlEnd ) ;
@@ -131,11 +126,7 @@ function originalRenderToStaticNodeStream(element, cache, streamingStart, memLif
131126 return new ReactMarkupReadableStream ( element , true , cache , streamingStart , memLife ) ;
132127}
133128
134- export function renderToStaticNodeStream ( element , cache , res ) {
135- const htmlStart =
136- '<html><head><title>Page</title></head><body><div id="react-root">' ;
137- 138- const htmlEnd = '</div></body></html>' ;
129+ export function renderToStaticNodeStream ( element , cache , res , htmlStart , htmlEnd , memLife ) {
139130
140131 const streamingStart = {
141132 sliceStartCount : htmlStart . length ,
@@ -145,7 +136,7 @@ export function renderToStaticNodeStream(element, cache, res) {
145136 cacheStream . pipe ( res ) ;
146137 cacheStream . write ( htmlStart ) ;
147138
148- const stream = originalRenderToStaticNodeStream ( element , cache , streamingStart ) ;
139+ const stream = originalRenderToStaticNodeStream ( element , cache , streamingStart , memLife ) ;
149140 stream . pipe ( cacheStream , { end : false } ) ;
150141 stream . on ( "end" , ( ) => {
151142 cacheStream . end ( htmlEnd ) ;
0 commit comments