@@ -99,12 +99,7 @@ function originalRenderToNodeStream(element, cache, streamingStart, memLife=0) {
99
99
return new ReactMarkupReadableStream ( element , false , cache , streamingStart , memLife ) ;
100
100
}
101
101
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 ) {
108
103
109
104
const streamingStart = {
110
105
sliceStartCount : htmlStart . length ,
@@ -114,7 +109,7 @@ export function renderToNodeStream(element, cache, res) {
114
109
cacheStream . pipe ( res ) ;
115
110
cacheStream . write ( htmlStart ) ;
116
111
117
- const stream = originalRenderToNodeStream ( element , cache , streamingStart ) ;
112
+ const stream = originalRenderToNodeStream ( element , cache , streamingStart , memLife ) ;
118
113
stream . pipe ( cacheStream , { end : false } ) ;
119
114
stream . on ( "end" , ( ) => {
120
115
cacheStream . end ( htmlEnd ) ;
@@ -131,11 +126,7 @@ function originalRenderToStaticNodeStream(element, cache, streamingStart, memLif
131
126
return new ReactMarkupReadableStream ( element , true , cache , streamingStart , memLife ) ;
132
127
}
133
128
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 ) {
139
130
140
131
const streamingStart = {
141
132
sliceStartCount : htmlStart . length ,
@@ -145,7 +136,7 @@ export function renderToStaticNodeStream(element, cache, res) {
145
136
cacheStream . pipe ( res ) ;
146
137
cacheStream . write ( htmlStart ) ;
147
138
148
- const stream = originalRenderToStaticNodeStream ( element , cache , streamingStart ) ;
139
+ const stream = originalRenderToStaticNodeStream ( element , cache , streamingStart , memLife ) ;
149
140
stream . pipe ( cacheStream , { end : false } ) ;
150
141
stream . on ( "end" , ( ) => {
151
142
cacheStream . end ( htmlEnd ) ;
0 commit comments