@@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
17
17
var React = require ( "next/dist/compiled/react-experimental" ) ;
18
18
var ReactDOM = require ( 'react-dom' ) ;
19
19
20
- var ReactVersion = '18.3.0-experimental-9377e1010-20230712 ' ;
20
+ var ReactVersion = '18.3.0-experimental-cb3404a0c-20230807 ' ;
21
21
22
22
var ReactSharedInternals = React . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ;
23
23
@@ -3330,6 +3330,9 @@ function pushMeta(target, props, responseState, textEmbedded, insertionMode, nos
3330
3330
3331
3331
if ( typeof props . charSet === 'string' ) {
3332
3332
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' ) ;
3333
3336
} else {
3334
3337
return pushSelfClosing ( responseState . hoistableChunks , props , 'meta' ) ;
3335
3338
}
@@ -5160,14 +5163,11 @@ function writePreamble(destination, resources, responseState, willFlushAllSegmen
5160
5163
resources . fontPreloads . clear ( ) ; // Flush unblocked stylesheets by precedence
5161
5164
5162
5165
resources . precedences . forEach ( flushAllStylesInPreamble , destination ) ;
5166
+ resources . bootstrapScripts . forEach ( flushResourceInPreamble , destination ) ;
5163
5167
resources . scripts . forEach ( flushResourceInPreamble , destination ) ;
5164
5168
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
5171
5171
5172
5172
var preloadChunks = responseState . preloadChunks ;
5173
5173
@@ -5218,15 +5218,13 @@ function writeHoistables(destination, resources, responseState) {
5218
5218
resources . fontPreloads . clear ( ) ; // Preload any stylesheets. these will emit in a render instruction that follows this
5219
5219
// but we want to kick off preloading as soon as possible
5220
5220
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
+
5222
5224
resources . scripts . forEach ( flushResourceLate , destination ) ;
5223
5225
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
5230
5228
5231
5229
var preloadChunks = responseState . preloadChunks ;
5232
5230
@@ -5646,11 +5644,9 @@ function createResources() {
5646
5644
// usedImagePreloads: new Set(),
5647
5645
precedences : new Map ( ) ,
5648
5646
stylePrecedences : new Map ( ) ,
5647
+ bootstrapScripts : new Set ( ) ,
5649
5648
scripts : new Set ( ) ,
5650
- explicitStylesheetPreloads : new Set ( ) ,
5651
- // explicitImagePreloads: new Set(),
5652
- explicitScriptPreloads : new Set ( ) ,
5653
- explicitOtherPreloads : new Set ( ) ,
5649
+ explicitPreloads : new Set ( ) ,
5654
5650
// like a module global for currently rendering boundary
5655
5651
boundaryResources : null
5656
5652
} ;
@@ -5876,29 +5872,10 @@ function preload(href, options) {
5876
5872
pushLinkImpl ( resource . chunks , resource . props ) ;
5877
5873
}
5878
5874
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 ) ;
5902
5879
}
5903
5880
5904
5881
flushResources ( request ) ;
@@ -6120,6 +6097,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
6120
6097
rel : 'preload' ,
6121
6098
href : src ,
6122
6099
as : 'script' ,
6100
+ fetchPriority : 'low' ,
6123
6101
nonce : nonce ,
6124
6102
integrity : integrity ,
6125
6103
crossOrigin : crossOrigin
@@ -6131,7 +6109,7 @@ function preloadBootstrapScript(resources, src, nonce, integrity, crossOrigin) {
6131
6109
props : props
6132
6110
} ;
6133
6111
resources . preloadsMap . set ( key , resource ) ;
6134
- resources . explicitScriptPreloads . add ( resource ) ;
6112
+ resources . bootstrapScripts . add ( resource ) ;
6135
6113
pushLinkImpl ( resource . chunks , props ) ;
6136
6114
} // This function is only safe to call at Request start time since it assumes
6137
6115
// 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) {
6154
6132
var props = {
6155
6133
rel : 'modulepreload' ,
6156
6134
href : src ,
6135
+ fetchPriority : 'low' ,
6157
6136
nonce : nonce ,
6158
6137
integrity : integrity ,
6159
6138
crossOrigin : crossOrigin
@@ -6165,7 +6144,7 @@ function preloadBootstrapModule(resources, src, nonce, integrity, crossOrigin) {
6165
6144
props : props
6166
6145
} ;
6167
6146
resources . preloadsMap . set ( key , resource ) ;
6168
- resources . explicitScriptPreloads . add ( resource ) ;
6147
+ resources . bootstrapScripts . add ( resource ) ;
6169
6148
pushLinkImpl ( resource . chunks , props ) ;
6170
6149
return ;
6171
6150
}
0 commit comments