react-markup 0.0.0-experimental-d46b04a2-20250117 → 0.0.0-experimental-18eaf51b-20250118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3224,26 +3224,26 @@ function createRenderState(
3224
3224
  ("" + JSON.stringify(importMap)).replace(scriptRegex, scriptReplacer)
3225
3225
  ),
3226
3226
  externalRuntimeConfig.push("\x3c/script>"));
3227
- importMap = {
3227
+ importMap = onHeaders
3228
+ ? {
3229
+ preconnects: "",
3230
+ fontPreloads: "",
3231
+ highImagePreloads: "",
3232
+ remainingCapacity:
3233
+ 2 + ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
3234
+ }
3235
+ : null;
3236
+ onHeaders = {
3228
3237
  placeholderPrefix: idPrefix + "P:",
3229
3238
  segmentPrefix: idPrefix + "S:",
3230
3239
  boundaryPrefix: idPrefix + "B:",
3231
3240
  startInlineScript: inlineScriptWithNonce,
3232
- htmlChunks: null,
3233
- headChunks: null,
3241
+ preamble: createPreambleState(),
3234
3242
  externalRuntimeScript: externalRuntimeScript,
3235
3243
  bootstrapChunks: bootstrapChunks,
3236
3244
  importMapChunks: externalRuntimeConfig,
3237
3245
  onHeaders: onHeaders,
3238
- headers: onHeaders
3239
- ? {
3240
- preconnects: "",
3241
- fontPreloads: "",
3242
- highImagePreloads: "",
3243
- remainingCapacity:
3244
- 2 + ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
3245
- }
3246
- : null,
3246
+ headers: importMap,
3247
3247
  resets: {
3248
3248
  font: {},
3249
3249
  dns: {},
@@ -3272,25 +3272,27 @@ function createRenderState(
3272
3272
  stylesToHoist: !1
3273
3273
  };
3274
3274
  if (void 0 !== bootstrapScripts)
3275
- for (onHeaders = 0; onHeaders < bootstrapScripts.length; onHeaders++)
3276
- (externalRuntimeConfig = bootstrapScripts[onHeaders]),
3277
- (idPrefix = inlineScriptWithNonce = void 0),
3278
- (externalRuntimeScript = {
3275
+ for (
3276
+ inlineScriptWithNonce = 0;
3277
+ inlineScriptWithNonce < bootstrapScripts.length;
3278
+ inlineScriptWithNonce++
3279
+ )
3280
+ (externalRuntimeConfig = bootstrapScripts[inlineScriptWithNonce]),
3281
+ (importMap = externalRuntimeScript = void 0),
3282
+ (maxHeadersLength = {
3279
3283
  rel: "preload",
3280
3284
  as: "script",
3281
3285
  fetchPriority: "low",
3282
3286
  nonce: nonce
3283
3287
  }),
3284
3288
  "string" === typeof externalRuntimeConfig
3285
- ? (externalRuntimeScript.href = maxHeadersLength =
3286
- externalRuntimeConfig)
3287
- : ((externalRuntimeScript.href = maxHeadersLength =
3288
- externalRuntimeConfig.src),
3289
- (externalRuntimeScript.integrity = idPrefix =
3289
+ ? (maxHeadersLength.href = idPrefix = externalRuntimeConfig)
3290
+ : ((maxHeadersLength.href = idPrefix = externalRuntimeConfig.src),
3291
+ (maxHeadersLength.integrity = importMap =
3290
3292
  "string" === typeof externalRuntimeConfig.integrity
3291
3293
  ? externalRuntimeConfig.integrity
3292
3294
  : void 0),
3293
- (externalRuntimeScript.crossOrigin = inlineScriptWithNonce =
3295
+ (maxHeadersLength.crossOrigin = externalRuntimeScript =
3294
3296
  "string" === typeof externalRuntimeConfig ||
3295
3297
  null == externalRuntimeConfig.crossOrigin
3296
3298
  ? void 0
@@ -3298,24 +3300,24 @@ function createRenderState(
3298
3300
  ? "use-credentials"
3299
3301
  : "")),
3300
3302
  (externalRuntimeConfig = resumableState),
3301
- (bootstrapScriptContent = maxHeadersLength),
3303
+ (bootstrapScriptContent = idPrefix),
3302
3304
  (externalRuntimeConfig.scriptResources[bootstrapScriptContent] = null),
3303
3305
  (externalRuntimeConfig.moduleScriptResources[bootstrapScriptContent] =
3304
3306
  null),
3305
3307
  (externalRuntimeConfig = []),
3306
- pushLinkImpl(externalRuntimeConfig, externalRuntimeScript),
3307
- importMap.bootstrapScripts.add(externalRuntimeConfig),
3308
- bootstrapChunks.push(
3309
- '<script src="',
3310
- escapeTextForBrowser(maxHeadersLength)
3311
- ),
3308
+ pushLinkImpl(externalRuntimeConfig, maxHeadersLength),
3309
+ onHeaders.bootstrapScripts.add(externalRuntimeConfig),
3310
+ bootstrapChunks.push('<script src="', escapeTextForBrowser(idPrefix)),
3312
3311
  nonce && bootstrapChunks.push('" nonce="', escapeTextForBrowser(nonce)),
3313
- "string" === typeof idPrefix &&
3314
- bootstrapChunks.push('" integrity="', escapeTextForBrowser(idPrefix)),
3315
- "string" === typeof inlineScriptWithNonce &&
3312
+ "string" === typeof importMap &&
3313
+ bootstrapChunks.push(
3314
+ '" integrity="',
3315
+ escapeTextForBrowser(importMap)
3316
+ ),
3317
+ "string" === typeof externalRuntimeScript &&
3316
3318
  bootstrapChunks.push(
3317
3319
  '" crossorigin="',
3318
- escapeTextForBrowser(inlineScriptWithNonce)
3320
+ escapeTextForBrowser(externalRuntimeScript)
3319
3321
  ),
3320
3322
  bootstrapChunks.push('" async="">\x3c/script>');
3321
3323
  if (void 0 !== bootstrapModules)
@@ -3324,52 +3326,51 @@ function createRenderState(
3324
3326
  bootstrapScripts < bootstrapModules.length;
3325
3327
  bootstrapScripts++
3326
3328
  )
3327
- (externalRuntimeScript = bootstrapModules[bootstrapScripts]),
3328
- (inlineScriptWithNonce = maxHeadersLength = void 0),
3329
- (idPrefix = {
3329
+ (maxHeadersLength = bootstrapModules[bootstrapScripts]),
3330
+ (externalRuntimeScript = idPrefix = void 0),
3331
+ (importMap = {
3330
3332
  rel: "modulepreload",
3331
3333
  fetchPriority: "low",
3332
3334
  nonce: nonce
3333
3335
  }),
3334
- "string" === typeof externalRuntimeScript
3335
- ? (idPrefix.href = onHeaders = externalRuntimeScript)
3336
- : ((idPrefix.href = onHeaders = externalRuntimeScript.src),
3337
- (idPrefix.integrity = inlineScriptWithNonce =
3338
- "string" === typeof externalRuntimeScript.integrity
3339
- ? externalRuntimeScript.integrity
3336
+ "string" === typeof maxHeadersLength
3337
+ ? (importMap.href = inlineScriptWithNonce = maxHeadersLength)
3338
+ : ((importMap.href = inlineScriptWithNonce = maxHeadersLength.src),
3339
+ (importMap.integrity = externalRuntimeScript =
3340
+ "string" === typeof maxHeadersLength.integrity
3341
+ ? maxHeadersLength.integrity
3340
3342
  : void 0),
3341
- (idPrefix.crossOrigin = maxHeadersLength =
3342
- "string" === typeof externalRuntimeScript ||
3343
- null == externalRuntimeScript.crossOrigin
3343
+ (importMap.crossOrigin = idPrefix =
3344
+ "string" === typeof maxHeadersLength ||
3345
+ null == maxHeadersLength.crossOrigin
3344
3346
  ? void 0
3345
- : "use-credentials" === externalRuntimeScript.crossOrigin
3347
+ : "use-credentials" === maxHeadersLength.crossOrigin
3346
3348
  ? "use-credentials"
3347
3349
  : "")),
3348
- (externalRuntimeScript = resumableState),
3349
- (externalRuntimeConfig = onHeaders),
3350
- (externalRuntimeScript.scriptResources[externalRuntimeConfig] = null),
3351
- (externalRuntimeScript.moduleScriptResources[externalRuntimeConfig] =
3352
- null),
3353
- (externalRuntimeScript = []),
3354
- pushLinkImpl(externalRuntimeScript, idPrefix),
3355
- importMap.bootstrapScripts.add(externalRuntimeScript),
3350
+ (maxHeadersLength = resumableState),
3351
+ (externalRuntimeConfig = inlineScriptWithNonce),
3352
+ (maxHeadersLength.scriptResources[externalRuntimeConfig] = null),
3353
+ (maxHeadersLength.moduleScriptResources[externalRuntimeConfig] = null),
3354
+ (maxHeadersLength = []),
3355
+ pushLinkImpl(maxHeadersLength, importMap),
3356
+ onHeaders.bootstrapScripts.add(maxHeadersLength),
3356
3357
  bootstrapChunks.push(
3357
3358
  '<script type="module" src="',
3358
- escapeTextForBrowser(onHeaders)
3359
+ escapeTextForBrowser(inlineScriptWithNonce)
3359
3360
  ),
3360
3361
  nonce && bootstrapChunks.push('" nonce="', escapeTextForBrowser(nonce)),
3361
- "string" === typeof inlineScriptWithNonce &&
3362
+ "string" === typeof externalRuntimeScript &&
3362
3363
  bootstrapChunks.push(
3363
3364
  '" integrity="',
3364
- escapeTextForBrowser(inlineScriptWithNonce)
3365
+ escapeTextForBrowser(externalRuntimeScript)
3365
3366
  ),
3366
- "string" === typeof maxHeadersLength &&
3367
+ "string" === typeof idPrefix &&
3367
3368
  bootstrapChunks.push(
3368
3369
  '" crossorigin="',
3369
- escapeTextForBrowser(maxHeadersLength)
3370
+ escapeTextForBrowser(idPrefix)
3370
3371
  ),
3371
3372
  bootstrapChunks.push('" async="">\x3c/script>');
3372
- return importMap;
3373
+ return onHeaders;
3373
3374
  }
3374
3375
  function createResumableState(
3375
3376
  identifierPrefix,
@@ -3400,6 +3401,9 @@ function createResumableState(
3400
3401
  moduleScriptResources: {}
3401
3402
  };
3402
3403
  }
3404
+ function createPreambleState() {
3405
+ return { htmlChunks: null, headChunks: null, bodyChunks: null };
3406
+ }
3403
3407
  function createFormatContext(insertionMode, selectedValue, tagScope) {
3404
3408
  return {
3405
3409
  insertionMode: insertionMode,
@@ -3418,33 +3422,34 @@ function getChildFormatContext(parentContext, type, props) {
3418
3422
  parentContext.tagScope
3419
3423
  );
3420
3424
  case "svg":
3421
- return createFormatContext(3, null, parentContext.tagScope);
3425
+ return createFormatContext(4, null, parentContext.tagScope);
3422
3426
  case "picture":
3423
3427
  return createFormatContext(2, null, parentContext.tagScope | 2);
3424
3428
  case "math":
3425
- return createFormatContext(4, null, parentContext.tagScope);
3429
+ return createFormatContext(5, null, parentContext.tagScope);
3426
3430
  case "foreignObject":
3427
3431
  return createFormatContext(2, null, parentContext.tagScope);
3428
3432
  case "table":
3429
- return createFormatContext(5, null, parentContext.tagScope);
3433
+ return createFormatContext(6, null, parentContext.tagScope);
3430
3434
  case "thead":
3431
3435
  case "tbody":
3432
3436
  case "tfoot":
3433
- return createFormatContext(6, null, parentContext.tagScope);
3437
+ return createFormatContext(7, null, parentContext.tagScope);
3434
3438
  case "colgroup":
3435
- return createFormatContext(8, null, parentContext.tagScope);
3439
+ return createFormatContext(9, null, parentContext.tagScope);
3436
3440
  case "tr":
3437
- return createFormatContext(7, null, parentContext.tagScope);
3441
+ return createFormatContext(8, null, parentContext.tagScope);
3442
+ case "head":
3443
+ if (2 > parentContext.insertionMode)
3444
+ return createFormatContext(3, null, parentContext.tagScope);
3445
+ break;
3446
+ case "html":
3447
+ if (0 === parentContext.insertionMode)
3448
+ return createFormatContext(1, null, parentContext.tagScope);
3438
3449
  }
3439
- return 5 <= parentContext.insertionMode
3450
+ return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
3440
3451
  ? createFormatContext(2, null, parentContext.tagScope)
3441
- : 0 === parentContext.insertionMode
3442
- ? "html" === type
3443
- ? createFormatContext(1, null, parentContext.tagScope)
3444
- : createFormatContext(2, null, parentContext.tagScope)
3445
- : 1 === parentContext.insertionMode
3446
- ? createFormatContext(2, null, parentContext.tagScope)
3447
- : parentContext;
3452
+ : parentContext;
3448
3453
  }
3449
3454
  var styleNameCache = new Map();
3450
3455
  function pushStyleAttribute(target, style) {
@@ -3911,6 +3916,7 @@ function pushStartInstance$1(
3911
3916
  props,
3912
3917
  resumableState,
3913
3918
  renderState,
3919
+ preambleState,
3914
3920
  hoistableState,
3915
3921
  formatContext,
3916
3922
  textEmbedded,
@@ -4390,7 +4396,7 @@ function pushStartInstance$1(
4390
4396
  return JSCompiler_inline_result$jscomp$2;
4391
4397
  case "title":
4392
4398
  if (
4393
- 3 === formatContext.insertionMode ||
4399
+ 4 === formatContext.insertionMode ||
4394
4400
  formatContext.tagScope & 1 ||
4395
4401
  null != props.itemProp
4396
4402
  )
@@ -4409,7 +4415,7 @@ function pushStartInstance$1(
4409
4415
  href = props.href,
4410
4416
  precedence = props.precedence;
4411
4417
  if (
4412
- 3 === formatContext.insertionMode ||
4418
+ 4 === formatContext.insertionMode ||
4413
4419
  formatContext.tagScope & 1 ||
4414
4420
  null != props.itemProp ||
4415
4421
  "string" !== typeof rel ||
@@ -4491,7 +4497,7 @@ function pushStartInstance$1(
4491
4497
  "symbol" === typeof asyncProp ||
4492
4498
  props.onLoad ||
4493
4499
  props.onError ||
4494
- 3 === formatContext.insertionMode ||
4500
+ 4 === formatContext.insertionMode ||
4495
4501
  formatContext.tagScope & 1 ||
4496
4502
  null != props.itemProp
4497
4503
  )
@@ -4532,7 +4538,7 @@ function pushStartInstance$1(
4532
4538
  var precedence$jscomp$0 = props.precedence,
4533
4539
  href$jscomp$0 = props.href;
4534
4540
  if (
4535
- 3 === formatContext.insertionMode ||
4541
+ 4 === formatContext.insertionMode ||
4536
4542
  formatContext.tagScope & 1 ||
4537
4543
  null != props.itemProp ||
4538
4544
  "string" !== typeof precedence$jscomp$0 ||
@@ -4635,7 +4641,7 @@ function pushStartInstance$1(
4635
4641
  return JSCompiler_inline_result$jscomp$6;
4636
4642
  case "meta":
4637
4643
  if (
4638
- 3 === formatContext.insertionMode ||
4644
+ 4 === formatContext.insertionMode ||
4639
4645
  formatContext.tagScope & 1 ||
4640
4646
  null != props.itemProp
4641
4647
  )
@@ -4813,10 +4819,13 @@ function pushStartInstance$1(
4813
4819
  case "missing-glyph":
4814
4820
  break;
4815
4821
  case "head":
4816
- if (2 > formatContext.insertionMode && null === renderState.headChunks) {
4817
- renderState.headChunks = [];
4822
+ if (2 > formatContext.insertionMode) {
4823
+ var preamble = preambleState || renderState.preamble;
4824
+ if (preamble.headChunks)
4825
+ throw Error("The `<head>` tag may only be rendered once.");
4826
+ preamble.headChunks = [];
4818
4827
  var JSCompiler_inline_result$jscomp$9 = pushStartGenericElement(
4819
- renderState.headChunks,
4828
+ preamble.headChunks,
4820
4829
  props,
4821
4830
  "head"
4822
4831
  );
@@ -4827,24 +4836,42 @@ function pushStartInstance$1(
4827
4836
  "head"
4828
4837
  );
4829
4838
  return JSCompiler_inline_result$jscomp$9;
4830
- case "html":
4831
- if (
4832
- 0 === formatContext.insertionMode &&
4833
- null === renderState.htmlChunks
4834
- ) {
4835
- renderState.htmlChunks = ["<!DOCTYPE html>"];
4839
+ case "body":
4840
+ if (2 > formatContext.insertionMode) {
4841
+ var preamble$jscomp$0 = preambleState || renderState.preamble;
4842
+ if (preamble$jscomp$0.bodyChunks)
4843
+ throw Error("The `<body>` tag may only be rendered once.");
4844
+ preamble$jscomp$0.bodyChunks = [];
4836
4845
  var JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
4837
- renderState.htmlChunks,
4846
+ preamble$jscomp$0.bodyChunks,
4838
4847
  props,
4839
- "html"
4848
+ "body"
4840
4849
  );
4841
4850
  } else
4842
4851
  JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
4843
4852
  target$jscomp$0,
4844
4853
  props,
4845
- "html"
4854
+ "body"
4846
4855
  );
4847
4856
  return JSCompiler_inline_result$jscomp$10;
4857
+ case "html":
4858
+ if (0 === formatContext.insertionMode) {
4859
+ var preamble$jscomp$1 = preambleState || renderState.preamble;
4860
+ if (preamble$jscomp$1.htmlChunks)
4861
+ throw Error("The `<html>` tag may only be rendered once.");
4862
+ preamble$jscomp$1.htmlChunks = ["<!DOCTYPE html>"];
4863
+ var JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
4864
+ preamble$jscomp$1.htmlChunks,
4865
+ props,
4866
+ "html"
4867
+ );
4868
+ } else
4869
+ JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
4870
+ target$jscomp$0,
4871
+ props,
4872
+ "html"
4873
+ );
4874
+ return JSCompiler_inline_result$jscomp$11;
4848
4875
  default:
4849
4876
  if (-1 !== type.indexOf("-")) {
4850
4877
  target$jscomp$0.push(startChunkForTag(type));
@@ -4905,6 +4932,15 @@ function endChunkForTag(tag) {
4905
4932
  void 0 === chunk && ((chunk = "</" + tag + ">"), endTagCache.set(tag, chunk));
4906
4933
  return chunk;
4907
4934
  }
4935
+ function hoistPreambleState(renderState, preambleState) {
4936
+ renderState = renderState.preamble;
4937
+ null === renderState.htmlChunks &&
4938
+ (renderState.htmlChunks = preambleState.htmlChunks);
4939
+ null === renderState.headChunks &&
4940
+ (renderState.headChunks = preambleState.headChunks);
4941
+ null === renderState.bodyChunks &&
4942
+ (renderState.bodyChunks = preambleState.bodyChunks);
4943
+ }
4908
4944
  function writeBootstrap(destination, renderState) {
4909
4945
  renderState = renderState.bootstrapChunks;
4910
4946
  for (var i = 0; i < renderState.length - 1; i++)
@@ -4928,6 +4964,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4928
4964
  switch (formatContext.insertionMode) {
4929
4965
  case 0:
4930
4966
  case 1:
4967
+ case 3:
4931
4968
  case 2:
4932
4969
  return (
4933
4970
  destination.push('<div hidden id="'),
@@ -4936,7 +4973,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4936
4973
  destination.push(renderState),
4937
4974
  destination.push('">')
4938
4975
  );
4939
- case 3:
4976
+ case 4:
4940
4977
  return (
4941
4978
  destination.push('<svg aria-hidden="true" style="display:none" id="'),
4942
4979
  destination.push(renderState.segmentPrefix),
@@ -4944,7 +4981,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4944
4981
  destination.push(renderState),
4945
4982
  destination.push('">')
4946
4983
  );
4947
- case 4:
4984
+ case 5:
4948
4985
  return (
4949
4986
  destination.push('<math aria-hidden="true" style="display:none" id="'),
4950
4987
  destination.push(renderState.segmentPrefix),
@@ -4952,7 +4989,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4952
4989
  destination.push(renderState),
4953
4990
  destination.push('">')
4954
4991
  );
4955
- case 5:
4992
+ case 6:
4956
4993
  return (
4957
4994
  destination.push('<table hidden id="'),
4958
4995
  destination.push(renderState.segmentPrefix),
@@ -4960,7 +4997,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4960
4997
  destination.push(renderState),
4961
4998
  destination.push('">')
4962
4999
  );
4963
- case 6:
5000
+ case 7:
4964
5001
  return (
4965
5002
  destination.push('<table hidden><tbody id="'),
4966
5003
  destination.push(renderState.segmentPrefix),
@@ -4968,7 +5005,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4968
5005
  destination.push(renderState),
4969
5006
  destination.push('">')
4970
5007
  );
4971
- case 7:
5008
+ case 8:
4972
5009
  return (
4973
5010
  destination.push('<table hidden><tr id="'),
4974
5011
  destination.push(renderState.segmentPrefix),
@@ -4976,7 +5013,7 @@ function writeStartSegment(destination, renderState, formatContext, id) {
4976
5013
  destination.push(renderState),
4977
5014
  destination.push('">')
4978
5015
  );
4979
- case 8:
5016
+ case 9:
4980
5017
  return (
4981
5018
  destination.push('<table hidden><colgroup id="'),
4982
5019
  destination.push(renderState.segmentPrefix),
@@ -4992,19 +5029,20 @@ function writeEndSegment(destination, formatContext) {
4992
5029
  switch (formatContext.insertionMode) {
4993
5030
  case 0:
4994
5031
  case 1:
5032
+ case 3:
4995
5033
  case 2:
4996
5034
  return destination.push("</div>");
4997
- case 3:
4998
- return destination.push("</svg>");
4999
5035
  case 4:
5000
- return destination.push("</math>");
5036
+ return destination.push("</svg>");
5001
5037
  case 5:
5002
- return destination.push("</table>");
5038
+ return destination.push("</math>");
5003
5039
  case 6:
5004
- return destination.push("</tbody></table>");
5040
+ return destination.push("</table>");
5005
5041
  case 7:
5006
- return destination.push("</tr></table>");
5042
+ return destination.push("</tbody></table>");
5007
5043
  case 8:
5044
+ return destination.push("</tr></table>");
5045
+ case 9:
5008
5046
  return destination.push("</colgroup></table>");
5009
5047
  default:
5010
5048
  throw Error("Unknown insertion mode. This is a bug in React.");
@@ -5939,7 +5977,7 @@ function RequestInstance(
5939
5977
  this.status = 10;
5940
5978
  this.fatalError = null;
5941
5979
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
5942
- this.completedRootSegment = null;
5980
+ this.completedPreambleSegments = this.completedRootSegment = null;
5943
5981
  this.abortableTasks = abortSet;
5944
5982
  this.pingedTasks = [];
5945
5983
  this.clientRenderedBoundaries = [];
@@ -5998,6 +6036,7 @@ function createRequest(
5998
6036
  null,
5999
6037
  renderState,
6000
6038
  null,
6039
+ null,
6001
6040
  resumableState.abortableTasks,
6002
6041
  null,
6003
6042
  rootFormatContext,
@@ -6016,7 +6055,12 @@ function pingTask(request, task) {
6016
6055
  ((request.flushScheduled = null !== request.destination),
6017
6056
  performWork(request));
6018
6057
  }
6019
- function createSuspenseBoundary(request, fallbackAbortableTasks) {
6058
+ function createSuspenseBoundary(
6059
+ request,
6060
+ fallbackAbortableTasks,
6061
+ contentPreamble,
6062
+ fallbackPreamble
6063
+ ) {
6020
6064
  return {
6021
6065
  status: 0,
6022
6066
  rootSegmentID: -1,
@@ -6028,6 +6072,8 @@ function createSuspenseBoundary(request, fallbackAbortableTasks) {
6028
6072
  errorDigest: null,
6029
6073
  contentState: createHoistableState(),
6030
6074
  fallbackState: createHoistableState(),
6075
+ contentPreamble: contentPreamble,
6076
+ fallbackPreamble: fallbackPreamble,
6031
6077
  trackedContentKeyPath: null,
6032
6078
  trackedFallbackNode: null
6033
6079
  };
@@ -6039,6 +6085,7 @@ function createRenderTask(
6039
6085
  childIndex,
6040
6086
  blockedBoundary,
6041
6087
  blockedSegment,
6088
+ blockedPreamble,
6042
6089
  hoistableState,
6043
6090
  abortSet,
6044
6091
  keyPath,
@@ -6061,6 +6108,7 @@ function createRenderTask(
6061
6108
  },
6062
6109
  blockedBoundary: blockedBoundary,
6063
6110
  blockedSegment: blockedSegment,
6111
+ blockedPreamble: blockedPreamble,
6064
6112
  hoistableState: hoistableState,
6065
6113
  abortSet: abortSet,
6066
6114
  keyPath: keyPath,
@@ -6104,6 +6152,7 @@ function createReplayTask(
6104
6152
  },
6105
6153
  blockedBoundary: blockedBoundary,
6106
6154
  blockedSegment: null,
6155
+ blockedPreamble: null,
6107
6156
  hoistableState: hoistableState,
6108
6157
  abortSet: abortSet,
6109
6158
  keyPath: keyPath,
@@ -6127,11 +6176,12 @@ function createPendingSegment(
6127
6176
  ) {
6128
6177
  return {
6129
6178
  status: 0,
6179
+ parentFlushed: !1,
6130
6180
  id: -1,
6131
6181
  index: index,
6132
- parentFlushed: !1,
6133
6182
  chunks: [],
6134
6183
  children: [],
6184
+ preambleChildren: [],
6135
6185
  parentFormatContext: parentFormatContext,
6136
6186
  boundary: boundary,
6137
6187
  lastPushedText: lastPushedText,
@@ -6370,9 +6420,10 @@ function renderElement(request, task, keyPath, type, props, ref) {
6370
6420
  defaultProps = newProps.chunks;
6371
6421
  initialState = request.resumableState;
6372
6422
  ref = request.renderState;
6373
- propName$85 = task.hoistableState;
6374
- propName = task.formatContext;
6375
- var textEmbedded = newProps.lastPushedText,
6423
+ propName$85 = task.blockedPreamble;
6424
+ propName = task.hoistableState;
6425
+ var formatContext = task.formatContext,
6426
+ textEmbedded = newProps.lastPushedText,
6376
6427
  isFallback = task.isFallback;
6377
6428
  for (contextType in props)
6378
6429
  if (hasOwnProperty.call(props, contextType)) {
@@ -6388,7 +6439,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
6388
6439
  ") in renderToHTML because the HTML will never be hydrated so they can never get called."
6389
6440
  );
6390
6441
  }
6391
- initialState = pushStartInstance$1(
6442
+ contextType = pushStartInstance$1(
6392
6443
  defaultProps,
6393
6444
  type,
6394
6445
  props,
@@ -6396,17 +6447,48 @@ function renderElement(request, task, keyPath, type, props, ref) {
6396
6447
  ref,
6397
6448
  propName$85,
6398
6449
  propName,
6450
+ formatContext,
6399
6451
  textEmbedded,
6400
6452
  isFallback
6401
6453
  );
6402
6454
  newProps.lastPushedText = !1;
6403
6455
  defaultProps = task.formatContext;
6404
- contextType = task.keyPath;
6405
- task.formatContext = getChildFormatContext(defaultProps, type, props);
6456
+ initialState = task.keyPath;
6406
6457
  task.keyPath = keyPath;
6407
- renderNode(request, task, initialState, -1);
6458
+ 3 ===
6459
+ (task.formatContext = getChildFormatContext(defaultProps, type, props))
6460
+ .insertionMode
6461
+ ? ((keyPath = createPendingSegment(
6462
+ request,
6463
+ 0,
6464
+ null,
6465
+ task.formatContext,
6466
+ !1,
6467
+ !1
6468
+ )),
6469
+ newProps.preambleChildren.push(keyPath),
6470
+ (keyPath = createRenderTask(
6471
+ request,
6472
+ null,
6473
+ contextType,
6474
+ -1,
6475
+ task.blockedBoundary,
6476
+ keyPath,
6477
+ task.blockedPreamble,
6478
+ task.hoistableState,
6479
+ request.abortableTasks,
6480
+ task.keyPath,
6481
+ task.formatContext,
6482
+ task.context,
6483
+ task.treeContext,
6484
+ task.componentStack,
6485
+ task.isFallback
6486
+ )),
6487
+ pushComponentStack(keyPath),
6488
+ request.pingedTasks.push(keyPath))
6489
+ : renderNode(request, task, contextType, -1);
6408
6490
  task.formatContext = defaultProps;
6409
- task.keyPath = contextType;
6491
+ task.keyPath = initialState;
6410
6492
  a: {
6411
6493
  task = newProps.chunks;
6412
6494
  request = request.resumableState;
@@ -6441,6 +6523,9 @@ function renderElement(request, task, keyPath, type, props, ref) {
6441
6523
  request.hasHtml = !0;
6442
6524
  break a;
6443
6525
  }
6526
+ break;
6527
+ case "head":
6528
+ if (1 >= defaultProps.insertionMode) break a;
6444
6529
  }
6445
6530
  task.push(endChunkForTag(type));
6446
6531
  }
@@ -6491,24 +6576,33 @@ function renderElement(request, task, keyPath, type, props, ref) {
6491
6576
  } else {
6492
6577
  type = task.keyPath;
6493
6578
  isFallback = task.blockedBoundary;
6579
+ contextType = task.blockedPreamble;
6494
6580
  propValue = task.hoistableState;
6495
- contextType = task.blockedSegment;
6496
- ref = props.fallback;
6581
+ ref = task.blockedSegment;
6582
+ propName$85 = props.fallback;
6497
6583
  props = props.children;
6498
6584
  var fallbackAbortSet = new Set();
6499
- propName$85 = createSuspenseBoundary(request, fallbackAbortSet);
6585
+ propName =
6586
+ 2 > task.formatContext.insertionMode
6587
+ ? createSuspenseBoundary(
6588
+ request,
6589
+ fallbackAbortSet,
6590
+ createPreambleState(),
6591
+ createPreambleState()
6592
+ )
6593
+ : createSuspenseBoundary(request, fallbackAbortSet, null, null);
6500
6594
  null !== request.trackedPostpones &&
6501
- (propName$85.trackedContentKeyPath = keyPath);
6502
- propName = createPendingSegment(
6595
+ (propName.trackedContentKeyPath = keyPath);
6596
+ formatContext = createPendingSegment(
6503
6597
  request,
6504
- contextType.chunks.length,
6505
- propName$85,
6598
+ ref.chunks.length,
6599
+ propName,
6506
6600
  task.formatContext,
6507
6601
  !1,
6508
6602
  !1
6509
6603
  );
6510
- contextType.children.push(propName);
6511
- contextType.lastPushedText = !1;
6604
+ ref.children.push(formatContext);
6605
+ ref.lastPushedText = !1;
6512
6606
  textEmbedded = createPendingSegment(
6513
6607
  request,
6514
6608
  0,
@@ -6522,27 +6616,33 @@ function renderElement(request, task, keyPath, type, props, ref) {
6522
6616
  newProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
6523
6617
  defaultProps = [newProps[1], newProps[2], [], null];
6524
6618
  request.trackedPostpones.workingMap.set(newProps, defaultProps);
6525
- propName$85.trackedFallbackNode = defaultProps;
6526
- task.blockedSegment = propName;
6619
+ propName.trackedFallbackNode = defaultProps;
6620
+ task.blockedSegment = formatContext;
6621
+ task.blockedPreamble = propName.fallbackPreamble;
6527
6622
  task.keyPath = newProps;
6528
- propName.status = 6;
6623
+ formatContext.status = 6;
6529
6624
  try {
6530
- renderNode(request, task, ref, -1), (propName.status = 1);
6625
+ renderNode(request, task, propName$85, -1),
6626
+ (formatContext.status = 1);
6531
6627
  } catch (thrownValue) {
6532
6628
  throw (
6533
- ((propName.status = 12 === request.status ? 3 : 4), thrownValue)
6629
+ ((formatContext.status = 12 === request.status ? 3 : 4),
6630
+ thrownValue)
6534
6631
  );
6535
6632
  } finally {
6536
- (task.blockedSegment = contextType), (task.keyPath = type);
6633
+ (task.blockedSegment = ref),
6634
+ (task.blockedPreamble = contextType),
6635
+ (task.keyPath = type);
6537
6636
  }
6538
6637
  task = createRenderTask(
6539
6638
  request,
6540
6639
  null,
6541
6640
  props,
6542
6641
  -1,
6543
- propName$85,
6642
+ propName,
6544
6643
  textEmbedded,
6545
- propName$85.contentState,
6644
+ propName.contentPreamble,
6645
+ propName.contentState,
6546
6646
  task.abortSet,
6547
6647
  keyPath,
6548
6648
  task.formatContext,
@@ -6554,8 +6654,9 @@ function renderElement(request, task, keyPath, type, props, ref) {
6554
6654
  pushComponentStack(task);
6555
6655
  request.pingedTasks.push(task);
6556
6656
  } else {
6557
- task.blockedBoundary = propName$85;
6558
- task.hoistableState = propName$85.contentState;
6657
+ task.blockedBoundary = propName;
6658
+ task.blockedPreamble = propName.contentPreamble;
6659
+ task.hoistableState = propName.contentState;
6559
6660
  task.blockedSegment = textEmbedded;
6560
6661
  task.keyPath = keyPath;
6561
6662
  textEmbedded.status = 6;
@@ -6563,14 +6664,17 @@ function renderElement(request, task, keyPath, type, props, ref) {
6563
6664
  if (
6564
6665
  (renderNode(request, task, props, -1),
6565
6666
  (textEmbedded.status = 1),
6566
- queueCompletedSegment(propName$85, textEmbedded),
6567
- 0 === propName$85.pendingTasks && 0 === propName$85.status)
6667
+ queueCompletedSegment(propName, textEmbedded),
6668
+ 0 === propName.pendingTasks && 0 === propName.status)
6568
6669
  ) {
6569
- propName$85.status = 1;
6670
+ propName.status = 1;
6671
+ 0 === request.pendingRootTasks &&
6672
+ task.blockedPreamble &&
6673
+ preparePreamble(request);
6570
6674
  break a;
6571
6675
  }
6572
6676
  } catch (thrownValue$80) {
6573
- (propName$85.status = 4),
6677
+ (propName.status = 4),
6574
6678
  12 === request.status
6575
6679
  ? ((textEmbedded.status = 3), (newProps = request.fatalError))
6576
6680
  : ((textEmbedded.status = 4), (newProps = thrownValue$80)),
@@ -6585,22 +6689,24 @@ function renderElement(request, task, keyPath, type, props, ref) {
6585
6689
  newProps,
6586
6690
  defaultProps
6587
6691
  )),
6588
- (propName$85.errorDigest = initialState),
6589
- untrackBoundary(request, propName$85);
6692
+ (propName.errorDigest = initialState),
6693
+ untrackBoundary(request, propName);
6590
6694
  } finally {
6591
6695
  (task.blockedBoundary = isFallback),
6696
+ (task.blockedPreamble = contextType),
6592
6697
  (task.hoistableState = propValue),
6593
- (task.blockedSegment = contextType),
6698
+ (task.blockedSegment = ref),
6594
6699
  (task.keyPath = type);
6595
6700
  }
6596
6701
  task = createRenderTask(
6597
6702
  request,
6598
6703
  null,
6599
- ref,
6704
+ propName$85,
6600
6705
  -1,
6601
6706
  isFallback,
6602
- propName,
6603
- propName$85.fallbackState,
6707
+ formatContext,
6708
+ propName.fallbackPreamble,
6709
+ propName.fallbackState,
6604
6710
  fallbackAbortSet,
6605
6711
  [keyPath[0], "Suspense Fallback", keyPath[2]],
6606
6712
  task.formatContext,
@@ -6619,9 +6725,9 @@ function renderElement(request, task, keyPath, type, props, ref) {
6619
6725
  switch (type.$$typeof) {
6620
6726
  case REACT_FORWARD_REF_TYPE:
6621
6727
  if ("ref" in props)
6622
- for (textEmbedded in ((newProps = {}), props))
6623
- "ref" !== textEmbedded &&
6624
- (newProps[textEmbedded] = props[textEmbedded]);
6728
+ for (formatContext in ((newProps = {}), props))
6729
+ "ref" !== formatContext &&
6730
+ (newProps[formatContext] = props[formatContext]);
6625
6731
  else newProps = props;
6626
6732
  type = renderWithHooks(
6627
6733
  request,
@@ -6823,17 +6929,27 @@ function retryNode(request, task) {
6823
6929
  previousReplaySet = task.replay,
6824
6930
  parentBoundary = task.blockedBoundary,
6825
6931
  parentHoistableState = task.hoistableState,
6826
- content = props.children;
6827
- props = props.fallback;
6828
- var fallbackAbortSet = new Set(),
6829
- resumedBoundary = createSuspenseBoundary(
6830
- request,
6831
- fallbackAbortSet
6832
- );
6833
- resumedBoundary.parentFlushed = !0;
6834
- resumedBoundary.rootSegmentID = ref;
6835
- task.blockedBoundary = resumedBoundary;
6836
- task.hoistableState = resumedBoundary.contentState;
6932
+ content = props.children,
6933
+ fallback = props.fallback,
6934
+ fallbackAbortSet = new Set();
6935
+ props =
6936
+ 2 > task.formatContext.insertionMode
6937
+ ? createSuspenseBoundary(
6938
+ request,
6939
+ fallbackAbortSet,
6940
+ createPreambleState(),
6941
+ createPreambleState()
6942
+ )
6943
+ : createSuspenseBoundary(
6944
+ request,
6945
+ fallbackAbortSet,
6946
+ null,
6947
+ null
6948
+ );
6949
+ props.parentFlushed = !0;
6950
+ props.rootSegmentID = ref;
6951
+ task.blockedBoundary = props;
6952
+ task.hoistableState = props.contentState;
6837
6953
  task.keyPath = key;
6838
6954
  task.replay = {
6839
6955
  nodes: replay,
@@ -6850,16 +6966,13 @@ function retryNode(request, task) {
6850
6966
  "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
6851
6967
  );
6852
6968
  task.replay.pendingTasks--;
6853
- if (
6854
- 0 === resumedBoundary.pendingTasks &&
6855
- 0 === resumedBoundary.status
6856
- ) {
6857
- resumedBoundary.status = 1;
6858
- request.completedBoundaries.push(resumedBoundary);
6969
+ if (0 === props.pendingTasks && 0 === props.status) {
6970
+ props.status = 1;
6971
+ request.completedBoundaries.push(props);
6859
6972
  break b;
6860
6973
  }
6861
6974
  } catch (error) {
6862
- (resumedBoundary.status = 4),
6975
+ (props.status = 4),
6863
6976
  (childNodes = getThrownInfo(task.componentStack)),
6864
6977
  "object" === typeof error &&
6865
6978
  null !== error &&
@@ -6871,11 +6984,9 @@ function retryNode(request, task) {
6871
6984
  error,
6872
6985
  childNodes
6873
6986
  )),
6874
- (resumedBoundary.errorDigest = type),
6987
+ (props.errorDigest = type),
6875
6988
  task.replay.pendingTasks--,
6876
- request.clientRenderedBoundaries.push(
6877
- resumedBoundary
6878
- );
6989
+ request.clientRenderedBoundaries.push(props);
6879
6990
  } finally {
6880
6991
  (task.blockedBoundary = parentBoundary),
6881
6992
  (task.hoistableState = parentHoistableState),
@@ -6890,10 +7001,10 @@ function retryNode(request, task) {
6890
7001
  slots: node$jscomp$0,
6891
7002
  pendingTasks: 0
6892
7003
  },
6893
- props,
7004
+ fallback,
6894
7005
  -1,
6895
7006
  parentBoundary,
6896
- resumedBoundary.fallbackState,
7007
+ props.fallbackState,
6897
7008
  fallbackAbortSet,
6898
7009
  [key[0], "Suspense Fallback", key[2]],
6899
7010
  task.formatContext,
@@ -7218,6 +7329,7 @@ function spawnNewSuspendedRenderTask(request, task, thenableState) {
7218
7329
  task.childIndex,
7219
7330
  task.blockedBoundary,
7220
7331
  newSegment,
7332
+ task.blockedPreamble,
7221
7333
  task.hoistableState,
7222
7334
  task.abortSet,
7223
7335
  task.keyPath,
@@ -7403,7 +7515,12 @@ function abortRemainingReplayNodes(
7403
7515
  node = node[5];
7404
7516
  var request = request$jscomp$0,
7405
7517
  errorDigest = errorDigest$jscomp$0,
7406
- resumedBoundary = createSuspenseBoundary(request, new Set());
7518
+ resumedBoundary = createSuspenseBoundary(
7519
+ request,
7520
+ new Set(),
7521
+ null,
7522
+ null
7523
+ );
7407
7524
  resumedBoundary.parentFlushed = !0;
7408
7525
  resumedBoundary.rootSegmentID = node;
7409
7526
  resumedBoundary.status = 4;
@@ -7593,6 +7710,7 @@ function safelyEmitEarlyPreloads(request, shellComplete) {
7593
7710
  }
7594
7711
  function completeShell(request) {
7595
7712
  null === request.trackedPostpones && safelyEmitEarlyPreloads(request, !0);
7713
+ null === request.trackedPostpones && preparePreamble(request);
7596
7714
  request.onShellError = noop;
7597
7715
  request = request.onShellReady;
7598
7716
  request();
@@ -7605,6 +7723,7 @@ function completeAll(request) {
7605
7723
  : null === request.completedRootSegment ||
7606
7724
  5 !== request.completedRootSegment.status
7607
7725
  );
7726
+ preparePreamble(request);
7608
7727
  request = request.onAllReady;
7609
7728
  request();
7610
7729
  }
@@ -7645,7 +7764,11 @@ function finishedTask(request, boundary, segment) {
7645
7764
  request.completedBoundaries.push(boundary),
7646
7765
  1 === boundary.status &&
7647
7766
  (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),
7648
- boundary.fallbackAbortableTasks.clear()))
7767
+ boundary.fallbackAbortableTasks.clear(),
7768
+ 0 === request.pendingRootTasks &&
7769
+ null === request.trackedPostpones &&
7770
+ null !== boundary.contentPreamble &&
7771
+ preparePreamble(request)))
7649
7772
  : null !== segment &&
7650
7773
  segment.parentFlushed &&
7651
7774
  1 === segment.status &&
@@ -7834,7 +7957,11 @@ function performWork(request$jscomp$1) {
7834
7957
  (boundary.errorDigest = request$jscomp$0),
7835
7958
  untrackBoundary(request, boundary),
7836
7959
  boundary.parentFlushed &&
7837
- request.clientRenderedBoundaries.push(boundary)));
7960
+ request.clientRenderedBoundaries.push(boundary),
7961
+ 0 === request.pendingRootTasks &&
7962
+ null === request.trackedPostpones &&
7963
+ null !== boundary.contentPreamble &&
7964
+ preparePreamble(request)));
7838
7965
  request.allPendingTasks--;
7839
7966
  0 === request.allPendingTasks && completeAll(request);
7840
7967
  }
@@ -7857,6 +7984,85 @@ function performWork(request$jscomp$1) {
7857
7984
  }
7858
7985
  }
7859
7986
  }
7987
+ function preparePreambleFromSubtree(
7988
+ request,
7989
+ segment,
7990
+ collectedPreambleSegments
7991
+ ) {
7992
+ segment.preambleChildren.length &&
7993
+ collectedPreambleSegments.push(segment.preambleChildren);
7994
+ for (var pendingPreambles = !1, i = 0; i < segment.children.length; i++)
7995
+ pendingPreambles =
7996
+ preparePreambleFromSegment(
7997
+ request,
7998
+ segment.children[i],
7999
+ collectedPreambleSegments
8000
+ ) || pendingPreambles;
8001
+ return pendingPreambles;
8002
+ }
8003
+ function preparePreambleFromSegment(
8004
+ request,
8005
+ segment,
8006
+ collectedPreambleSegments
8007
+ ) {
8008
+ var boundary = segment.boundary;
8009
+ if (null === boundary)
8010
+ return preparePreambleFromSubtree(
8011
+ request,
8012
+ segment,
8013
+ collectedPreambleSegments
8014
+ );
8015
+ var preamble = boundary.contentPreamble,
8016
+ fallbackPreamble = boundary.fallbackPreamble;
8017
+ if (null === preamble || null === fallbackPreamble) return !1;
8018
+ switch (boundary.status) {
8019
+ case 1:
8020
+ hoistPreambleState(request.renderState, preamble);
8021
+ segment = boundary.completedSegments[0];
8022
+ if (!segment)
8023
+ throw Error(
8024
+ "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
8025
+ );
8026
+ return preparePreambleFromSubtree(
8027
+ request,
8028
+ segment,
8029
+ collectedPreambleSegments
8030
+ );
8031
+ case 5:
8032
+ if (null !== request.trackedPostpones) return !0;
8033
+ case 4:
8034
+ if (1 === segment.status)
8035
+ return (
8036
+ hoistPreambleState(request.renderState, fallbackPreamble),
8037
+ preparePreambleFromSubtree(
8038
+ request,
8039
+ segment,
8040
+ collectedPreambleSegments
8041
+ )
8042
+ );
8043
+ default:
8044
+ return !0;
8045
+ }
8046
+ }
8047
+ function preparePreamble(request) {
8048
+ if (
8049
+ request.completedRootSegment &&
8050
+ null === request.completedPreambleSegments
8051
+ ) {
8052
+ var collectedPreambleSegments = [],
8053
+ hasPendingPreambles = preparePreambleFromSegment(
8054
+ request,
8055
+ request.completedRootSegment,
8056
+ collectedPreambleSegments
8057
+ ),
8058
+ preamble = request.renderState.preamble;
8059
+ if (
8060
+ !1 === hasPendingPreambles ||
8061
+ (preamble.headChunks && preamble.bodyChunks)
8062
+ )
8063
+ request.completedPreambleSegments = collectedPreambleSegments;
8064
+ }
8065
+ }
7860
8066
  function flushSubtree(request, destination, segment, hoistableState) {
7861
8067
  segment.parentFlushed = !0;
7862
8068
  switch (segment.status) {
@@ -8071,6 +8277,8 @@ function flushCompletedQueues(request, destination) {
8071
8277
  completedRootSegment = request.completedRootSegment;
8072
8278
  if (null !== completedRootSegment) {
8073
8279
  if (5 === completedRootSegment.status) return;
8280
+ var completedPreambleSegments = request.completedPreambleSegments;
8281
+ if (null === completedPreambleSegments) return;
8074
8282
  var renderState = request.renderState;
8075
8283
  if (
8076
8284
  (0 !== request.allPendingTasks ||
@@ -8085,8 +8293,9 @@ function flushCompletedQueues(request, destination) {
8085
8293
  ((resumableState.scriptResources[src] = null),
8086
8294
  renderState.scripts.add(chunks));
8087
8295
  }
8088
- var htmlChunks = renderState.htmlChunks,
8089
- headChunks = renderState.headChunks,
8296
+ var preamble = renderState.preamble,
8297
+ htmlChunks = preamble.htmlChunks,
8298
+ headChunks = preamble.headChunks,
8090
8299
  i$jscomp$0;
8091
8300
  if (htmlChunks) {
8092
8301
  for (i$jscomp$0 = 0; i$jscomp$0 < htmlChunks.length; i$jscomp$0++)
@@ -8129,11 +8338,38 @@ function flushCompletedQueues(request, destination) {
8129
8338
  var hoistableChunks = renderState.hoistableChunks;
8130
8339
  for (i$jscomp$0 = 0; i$jscomp$0 < hoistableChunks.length; i$jscomp$0++)
8131
8340
  destination.push(hoistableChunks[i$jscomp$0]);
8132
- hoistableChunks.length = 0;
8133
- if (htmlChunks && null === headChunks) {
8341
+ for (
8342
+ renderState = hoistableChunks.length = 0;
8343
+ renderState < completedPreambleSegments.length;
8344
+ renderState++
8345
+ ) {
8346
+ var segments = completedPreambleSegments[renderState];
8347
+ for (
8348
+ _renderState$external = 0;
8349
+ _renderState$external < segments.length;
8350
+ _renderState$external++
8351
+ )
8352
+ flushSegment(
8353
+ request,
8354
+ destination,
8355
+ segments[_renderState$external],
8356
+ null
8357
+ );
8358
+ }
8359
+ var preamble$jscomp$0 = request.renderState.preamble,
8360
+ headChunks$jscomp$0 = preamble$jscomp$0.headChunks;
8361
+ if (preamble$jscomp$0.htmlChunks || headChunks$jscomp$0) {
8134
8362
  var chunk$jscomp$0 = endChunkForTag("head");
8135
8363
  destination.push(chunk$jscomp$0);
8136
8364
  }
8365
+ var bodyChunks = preamble$jscomp$0.bodyChunks;
8366
+ if (bodyChunks)
8367
+ for (
8368
+ completedPreambleSegments = 0;
8369
+ completedPreambleSegments < bodyChunks.length;
8370
+ completedPreambleSegments++
8371
+ )
8372
+ destination.push(bodyChunks[completedPreambleSegments]);
8137
8373
  flushSegment(request, destination, completedRootSegment, null);
8138
8374
  request.completedRootSegment = null;
8139
8375
  writeBootstrap(destination, request.renderState);
@@ -8638,4 +8874,4 @@ exports.experimental_renderToHTML = function (children, options) {
8638
8874
  });
8639
8875
  });
8640
8876
  };
8641
- exports.version = "19.1.0-experimental-d46b04a2-20250117";
8877
+ exports.version = "19.1.0-experimental-18eaf51b-20250118";