@@ -19,7 +19,7 @@ if (__DEV__) {
1919var React = require ( "react" ) ;
2020var ReactDOM = require ( "react-dom" ) ;
2121
22- var ReactVersion = "18.3.0-www-classic-89c1183f " ;
22+ var ReactVersion = "18.3.0-www-classic-3ac6c75e " ;
2323
2424// This refers to a WWW module.
2525var warningWWW = require ( "warning" ) ;
@@ -4167,7 +4167,7 @@ function pushStyleImpl(target, props) {
41674167 }
41684168
41694169 pushInnerHTML ( target , innerHTML , children ) ;
4170- target . push ( endTag1 , stringToChunk ( "style" ) , endTag2 ) ;
4170+ target . push ( endChunkForTag ( "style" ) ) ;
41714171 return null ;
41724172}
41734173
@@ -4483,7 +4483,7 @@ function pushTitleImpl(target, props) {
44834483 }
44844484
44854485 pushInnerHTML ( target , innerHTML , children ) ;
4486- target . push ( endTag1 , stringToChunk ( "title" ) , endTag2 ) ;
4486+ target . push ( endChunkForTag ( "title" ) ) ;
44874487 return null ;
44884488}
44894489
@@ -4656,7 +4656,7 @@ function pushScriptImpl(target, props) {
46564656 target . push ( stringToChunk ( encodeHTMLTextNode ( children ) ) ) ;
46574657 }
46584658
4659- target . push ( endTag1 , stringToChunk ( "script" ) , endTag2 ) ;
4659+ target . push ( endChunkForTag ( "script" ) ) ;
46604660 return null ;
46614661}
46624662
@@ -5080,8 +5080,19 @@ function pushStartInstance(
50805080
50815081 return pushStartGenericElement ( target , props , type ) ;
50825082}
5083- var endTag1 = stringToPrecomputedChunk ( "</" ) ;
5084- var endTag2 = stringToPrecomputedChunk ( ">" ) ;
5083+ var endTagCache = new Map ( ) ;
5084+
5085+ function endChunkForTag ( tag ) {
5086+ var chunk = endTagCache . get ( tag ) ;
5087+
5088+ if ( chunk === undefined ) {
5089+ chunk = stringToPrecomputedChunk ( "</" + tag + ">" ) ;
5090+ endTagCache . set ( tag , chunk ) ;
5091+ }
5092+
5093+ return chunk ;
5094+ }
5095+
50855096function pushEndInstance ( target , type , props , resumableState , formatContext ) {
50865097 switch ( type ) {
50875098 // When float is on we expect title and script tags to always be pushed in
@@ -5136,7 +5147,7 @@ function pushEndInstance(target, type, props, resumableState, formatContext) {
51365147 break ;
51375148 }
51385149
5139- target . push ( endTag1 , stringToChunk ( type ) , endTag2 ) ;
5150+ target . push ( endChunkForTag ( type ) ) ;
51405151}
51415152
51425153function writeBootstrap ( destination , renderState ) {
@@ -6052,9 +6063,7 @@ function writePreamble(
60526063 // if the main content contained the </head> it would also have provided a
60536064 // <head>. This means that all the content inside <html> is either <body> or
60546065 // invalid HTML
6055- writeChunk ( destination , endTag1 ) ;
6056- writeChunk ( destination , stringToChunk ( "head" ) ) ;
6057- writeChunk ( destination , endTag2 ) ;
6066+ writeChunk ( destination , endChunkForTag ( "head" ) ) ;
60586067 }
60596068} // We don't bother reporting backpressure at the moment because we expect to
60606069// flush the entire preamble in a single pass. This probably should be modified
@@ -6111,15 +6120,11 @@ function writeHoistables(destination, resumableState, renderState) {
61116120}
61126121function writePostamble ( destination , resumableState ) {
61136122 if ( resumableState . hasBody ) {
6114- writeChunk ( destination , endTag1 ) ;
6115- writeChunk ( destination , stringToChunk ( "body" ) ) ;
6116- writeChunk ( destination , endTag2 ) ;
6123+ writeChunk ( destination , endChunkForTag ( "body" ) ) ;
61176124 }
61186125
61196126 if ( resumableState . hasHtml ) {
6120- writeChunk ( destination , endTag1 ) ;
6121- writeChunk ( destination , stringToChunk ( "html" ) ) ;
6122- writeChunk ( destination , endTag2 ) ;
6127+ writeChunk ( destination , endChunkForTag ( "html" ) ) ;
61236128 }
61246129}
61256130var arrayFirstOpenBracket = stringToPrecomputedChunk ( "[" ) ;
0 commit comments