@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
1717var React = require ( "next/dist/compiled/react-experimental" ) ;
1818var ReactDOM = require ( 'react-dom' ) ;
1919
20- var ReactVersion = '18.3.0-experimental-9377e1010-20230712 ' ;
20+ var ReactVersion = '18.3.0-experimental-cb3404a0c-20230807 ' ;
2121
2222var ReactSharedInternals = React . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ;
2323
@@ -3330,6 +3330,9 @@ function pushMeta(target, props, responseState, textEmbedded, insertionMode, nos
33303330
33313331 if ( typeof props . charSet === 'string' ) {
33323332 return pushSelfClosing ( responseState . charsetChunks , props , 'meta' ) ;
3333+ } else if ( props . name === 'viewport' ) {
3334+ // "viewport" isn't related to preconnect but it has the right priority
3335+ return pushSelfClosing ( responseState . preconnectChunks , props , 'meta' ) ;
33333336 } else {
33343337 return pushSelfClosing ( responseState . hoistableChunks , props , 'meta' ) ;
33353338 }
@@ -5160,14 +5163,11 @@ function writePreamble(destination, resources, responseState, willFlushAllSegmen
51605163 resources . fontPreloads . clear ( ) ; // Flush unblocked stylesheets by precedence
51615164
51625165 resources . precedences . forEach ( flushAllStylesInPreamble , destination ) ;
5166+ resources . bootstrapScripts . forEach ( flushResourceInPreamble , destination ) ;
51635167 resources . scripts . forEach ( flushResourceInPreamble , destination ) ;
51645168 resources . scripts . clear ( ) ;
5165- resources . explicitStylesheetPreloads . forEach ( flushResourceInPreamble , destination ) ;
5166- resources . explicitStylesheetPreloads . clear ( ) ;
5167- resources . explicitScriptPreloads . forEach ( flushResourceInPreamble , destination ) ;
5168- resources . explicitScriptPreloads . clear ( ) ;
5169- resources . explicitOtherPreloads . forEach ( flushResourceInPreamble , destination ) ;
5170- resources . explicitOtherPreloads . clear ( ) ; // Write embedding preloadChunks
5169+ resources . explicitPreloads . forEach ( flushResourceInPreamble , destination ) ;
5170+ resources . explicitPreloads . clear ( ) ; // Write embedding preloadChunks
51715171
51725172 var preloadChunks = responseState . preloadChunks ;
51735173
@@ -5218,15 +5218,13 @@ function writeHoistables(destination, resources, responseState) {
52185218 resources . fontPreloads . clear ( ) ; // Preload any stylesheets. these will emit in a render instruction that follows this
52195219 // but we want to kick off preloading as soon as possible
52205220
5221- resources . precedences . forEach ( preloadLateStyles , destination ) ;
5221+ resources . precedences . forEach ( preloadLateStyles , destination ) ; // bootstrap scripts should flush above script priority but these can only flush in the preamble
5222+ // so we elide the code here for performance
5223+
52225224 resources . scripts . forEach ( flushResourceLate , destination ) ;
52235225 resources . scripts . clear ( ) ;
5224- resources . explicitStylesheetPreloads . forEach ( flushResourceLate , destination ) ;
5225- resources . explicitStylesheetPreloads . clear ( ) ;
5226- resources . explicitScriptPreloads . forEach ( flushResourceLate , destination ) ;
5227- resources . explicitScriptPreloads . clear ( ) ;
5228- resources . explicitOtherPreloads . forEach ( flushResourceLate , destination ) ;
5229- resources . explicitOtherPreloads . clear ( ) ; // Write embedding preloadChunks
5226+ resources . explicitPreloads . forEach ( flushResourceLate , destination ) ;
5227+ resources . explicitPreloads . clear ( ) ; // Write embedding preloadChunks
52305228
52315229 var preloadChunks = responseState . preloadChunks ;
52325230
@@ -5646,11 +5644,9 @@ function createResources() {
56465644 // usedImagePreloads: new Set(),
56475645 precedences : new Map ( ) ,
56485646 stylePrecedences : new Map ( ) ,
5647+ bootstrapScripts : new Set ( ) ,
56495648 scripts : new Set ( ) ,
5650- explicitStylesheetPreloads : new Set ( ) ,
5651- // explicitImagePreloads: new Set(),
5652- explicitScriptPreloads : new Set ( ) ,
5653- explicitOtherPreloads : new Set ( ) ,
5649+ explicitPreloads : new Set ( ) ,
56545650 // like a module global for currently rendering boundary
56555651 boundaryResources : null
56565652 } ;
@@ -5876,29 +5872,10 @@ function preload(href, options) {
58765872 pushLinkImpl ( resource . chunks , resource . props ) ;
58775873 }
58785874
5879- switch ( as ) {
5880- case 'font' :
5881- {
5882- resources . fontPreloads . add ( resource ) ;
5883- break ;
5884- }
5885-
5886- case 'style' :
5887- {
5888- resources . explicitStylesheetPreloads . add ( resource ) ;
5889- break ;
5890- }
5891-
5892- case 'script' :
5893- {
5894- resources . explicitScriptPreloads . add ( resource ) ;
5895- break ;
5896- }
5897-
5898- default :
5899- {
5900- resources . explicitOtherPreloads . add ( resource ) ;
5901- }
5875+ if ( as === 'font' ) {
5876+ resources . fontPreloads . add ( resource ) ;
5877+ } else {
5878+ resources . explicitPreloads . add ( resource ) ;
59025879 }
59035880
59045881 flushResources ( request ) ;
@@ -6120,6 +6097,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
61206097 rel : 'preload' ,
61216098 href : src ,
61226099 as : 'script' ,
6100+ fetchPriority : 'low' ,
61236101 nonce : nonce ,
61246102 integrity : integrity ,
61256103 crossOrigin : crossOrigin
@@ -6131,7 +6109,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
61316109 props : props
61326110 } ;
61336111 resources . preloadsMap . set ( key , resource ) ;
6134- resources . explicitScriptPreloads . add ( resource ) ;
6112+ resources . bootstrapScripts . add ( resource ) ;
61356113 pushLinkImpl ( resource . chunks , props ) ;
61366114} // This function is only safe to call at Request start time since it assumes
61376115// that each module has not already been preloaded. If we find a need to preload
@@ -6154,6 +6132,7 @@ function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
61546132 var props = {
61556133 rel : 'modulepreload' ,
61566134 href : src ,
6135+ fetchPriority : 'low' ,
61576136 nonce : nonce ,
61586137 integrity : integrity ,
61596138 crossOrigin : crossOrigin
@@ -6165,7 +6144,7 @@ function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
61656144 props : props
61666145 } ;
61676146 resources . preloadsMap . set ( key , resource ) ;
6168- resources . explicitScriptPreloads . add ( resource ) ;
6147+ resources . bootstrapScripts . add ( resource ) ;
61696148 pushLinkImpl ( resource . chunks , props ) ;
61706149 return ;
61716150}
0 commit comments