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.
@@ -2045,6 +2045,7 @@
2045
2045
  function serializeErrorValue(request, error) {
2046
2046
  var env = (0, request.environmentName)();
2047
2047
  try {
2048
+ var name = error.name;
2048
2049
  var message = String(error.message);
2049
2050
  var stack = filterStackTrace(request, error, 0);
2050
2051
  var errorEnv = error.environmentName;
@@ -2057,6 +2058,7 @@
2057
2058
  return (
2058
2059
  "$Z" +
2059
2060
  outlineModel(request, {
2061
+ name: name,
2060
2062
  message: message,
2061
2063
  stack: stack,
2062
2064
  env: env
@@ -4277,7 +4279,8 @@
4277
4279
  response.reason.close("" === row ? '"$undefined"' : row);
4278
4280
  }
4279
4281
  function resolveErrorDev(response, errorInfo) {
4280
- var env = errorInfo.env;
4282
+ var name = errorInfo.name,
4283
+ env = errorInfo.env;
4281
4284
  errorInfo = buildFakeCallStack(
4282
4285
  response,
4283
4286
  errorInfo.stack,
@@ -4290,6 +4293,7 @@
4290
4293
  );
4291
4294
  response = getRootTask(response, env);
4292
4295
  response = null != response ? response.run(errorInfo) : errorInfo();
4296
+ response.name = name;
4293
4297
  response.environmentName = env;
4294
4298
  return response;
4295
4299
  }
@@ -5356,27 +5360,27 @@
5356
5360
  "React expected a positive non-zero `maxHeadersLength` option but found %s instead. When using the `onHeaders` option you may supply an optional `maxHeadersLength` option as well however, when setting this value to zero or less no headers will be captured.",
5357
5361
  0 === maxHeadersLength ? "zero" : maxHeadersLength
5358
5362
  );
5359
- importMap = {
5363
+ importMap = onHeaders
5364
+ ? {
5365
+ preconnects: "",
5366
+ fontPreloads: "",
5367
+ highImagePreloads: "",
5368
+ remainingCapacity:
5369
+ 2 +
5370
+ ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
5371
+ }
5372
+ : null;
5373
+ onHeaders = {
5360
5374
  placeholderPrefix: idPrefix + "P:",
5361
5375
  segmentPrefix: idPrefix + "S:",
5362
5376
  boundaryPrefix: idPrefix + "B:",
5363
5377
  startInlineScript: inlineScriptWithNonce,
5364
- htmlChunks: null,
5365
- headChunks: null,
5378
+ preamble: createPreambleState(),
5366
5379
  externalRuntimeScript: externalRuntimeScript,
5367
5380
  bootstrapChunks: bootstrapChunks,
5368
5381
  importMapChunks: externalRuntimeConfig,
5369
5382
  onHeaders: onHeaders,
5370
- headers: onHeaders
5371
- ? {
5372
- preconnects: "",
5373
- fontPreloads: "",
5374
- highImagePreloads: "",
5375
- remainingCapacity:
5376
- 2 +
5377
- ("number" === typeof maxHeadersLength ? maxHeadersLength : 2e3)
5378
- }
5379
- : null,
5383
+ headers: importMap,
5380
5384
  resets: {
5381
5385
  font: {},
5382
5386
  dns: {},
@@ -5405,52 +5409,54 @@
5405
5409
  stylesToHoist: !1
5406
5410
  };
5407
5411
  if (void 0 !== bootstrapScripts)
5408
- for (onHeaders = 0; onHeaders < bootstrapScripts.length; onHeaders++)
5409
- (maxHeadersLength = bootstrapScripts[onHeaders]),
5410
- (externalRuntimeScript = idPrefix = void 0),
5412
+ for (
5413
+ inlineScriptWithNonce = 0;
5414
+ inlineScriptWithNonce < bootstrapScripts.length;
5415
+ inlineScriptWithNonce++
5416
+ )
5417
+ (idPrefix = bootstrapScripts[inlineScriptWithNonce]),
5418
+ (maxHeadersLength = importMap = void 0),
5411
5419
  (externalRuntimeConfig = {
5412
5420
  rel: "preload",
5413
5421
  as: "script",
5414
5422
  fetchPriority: "low",
5415
5423
  nonce: nonce
5416
5424
  }),
5417
- "string" === typeof maxHeadersLength
5418
- ? (externalRuntimeConfig.href = inlineScriptWithNonce =
5419
- maxHeadersLength)
5420
- : ((externalRuntimeConfig.href = inlineScriptWithNonce =
5421
- maxHeadersLength.src),
5422
- (externalRuntimeConfig.integrity = externalRuntimeScript =
5423
- "string" === typeof maxHeadersLength.integrity
5424
- ? maxHeadersLength.integrity
5425
+ "string" === typeof idPrefix
5426
+ ? (externalRuntimeConfig.href = externalRuntimeScript = idPrefix)
5427
+ : ((externalRuntimeConfig.href = externalRuntimeScript =
5428
+ idPrefix.src),
5429
+ (externalRuntimeConfig.integrity = maxHeadersLength =
5430
+ "string" === typeof idPrefix.integrity
5431
+ ? idPrefix.integrity
5425
5432
  : void 0),
5426
- (externalRuntimeConfig.crossOrigin = idPrefix =
5427
- "string" === typeof maxHeadersLength ||
5428
- null == maxHeadersLength.crossOrigin
5433
+ (externalRuntimeConfig.crossOrigin = importMap =
5434
+ "string" === typeof idPrefix || null == idPrefix.crossOrigin
5429
5435
  ? void 0
5430
- : "use-credentials" === maxHeadersLength.crossOrigin
5436
+ : "use-credentials" === idPrefix.crossOrigin
5431
5437
  ? "use-credentials"
5432
5438
  : "")),
5433
5439
  preloadBootstrapScriptOrModule(
5434
5440
  resumableState,
5435
- importMap,
5436
- inlineScriptWithNonce,
5441
+ onHeaders,
5442
+ externalRuntimeScript,
5437
5443
  externalRuntimeConfig
5438
5444
  ),
5439
5445
  bootstrapChunks.push(
5440
5446
  '<script src="',
5441
- escapeTextForBrowser(inlineScriptWithNonce)
5447
+ escapeTextForBrowser(externalRuntimeScript)
5442
5448
  ),
5443
5449
  nonce &&
5444
5450
  bootstrapChunks.push('" nonce="', escapeTextForBrowser(nonce)),
5445
- "string" === typeof externalRuntimeScript &&
5451
+ "string" === typeof maxHeadersLength &&
5446
5452
  bootstrapChunks.push(
5447
5453
  '" integrity="',
5448
- escapeTextForBrowser(externalRuntimeScript)
5454
+ escapeTextForBrowser(maxHeadersLength)
5449
5455
  ),
5450
- "string" === typeof idPrefix &&
5456
+ "string" === typeof importMap &&
5451
5457
  bootstrapChunks.push(
5452
5458
  '" crossorigin="',
5453
- escapeTextForBrowser(idPrefix)
5459
+ escapeTextForBrowser(importMap)
5454
5460
  ),
5455
5461
  bootstrapChunks.push('" async="">\x3c/script>');
5456
5462
  if (void 0 !== bootstrapModules)
@@ -5459,51 +5465,51 @@
5459
5465
  bootstrapScripts < bootstrapModules.length;
5460
5466
  bootstrapScripts++
5461
5467
  )
5462
- (onHeaders = bootstrapModules[bootstrapScripts]),
5463
- (idPrefix = inlineScriptWithNonce = void 0),
5464
- (externalRuntimeScript = {
5468
+ (inlineScriptWithNonce = bootstrapModules[bootstrapScripts]),
5469
+ (importMap = externalRuntimeScript = void 0),
5470
+ (maxHeadersLength = {
5465
5471
  rel: "modulepreload",
5466
5472
  fetchPriority: "low",
5467
5473
  nonce: nonce
5468
5474
  }),
5469
- "string" === typeof onHeaders
5470
- ? (externalRuntimeScript.href = maxHeadersLength = onHeaders)
5471
- : ((externalRuntimeScript.href = maxHeadersLength =
5472
- onHeaders.src),
5473
- (externalRuntimeScript.integrity = idPrefix =
5474
- "string" === typeof onHeaders.integrity
5475
- ? onHeaders.integrity
5475
+ "string" === typeof inlineScriptWithNonce
5476
+ ? (maxHeadersLength.href = idPrefix = inlineScriptWithNonce)
5477
+ : ((maxHeadersLength.href = idPrefix = inlineScriptWithNonce.src),
5478
+ (maxHeadersLength.integrity = importMap =
5479
+ "string" === typeof inlineScriptWithNonce.integrity
5480
+ ? inlineScriptWithNonce.integrity
5476
5481
  : void 0),
5477
- (externalRuntimeScript.crossOrigin = inlineScriptWithNonce =
5478
- "string" === typeof onHeaders || null == onHeaders.crossOrigin
5482
+ (maxHeadersLength.crossOrigin = externalRuntimeScript =
5483
+ "string" === typeof inlineScriptWithNonce ||
5484
+ null == inlineScriptWithNonce.crossOrigin
5479
5485
  ? void 0
5480
- : "use-credentials" === onHeaders.crossOrigin
5486
+ : "use-credentials" === inlineScriptWithNonce.crossOrigin
5481
5487
  ? "use-credentials"
5482
5488
  : "")),
5483
5489
  preloadBootstrapScriptOrModule(
5484
5490
  resumableState,
5485
- importMap,
5486
- maxHeadersLength,
5487
- externalRuntimeScript
5491
+ onHeaders,
5492
+ idPrefix,
5493
+ maxHeadersLength
5488
5494
  ),
5489
5495
  bootstrapChunks.push(
5490
5496
  '<script type="module" src="',
5491
- escapeTextForBrowser(maxHeadersLength)
5497
+ escapeTextForBrowser(idPrefix)
5492
5498
  ),
5493
5499
  nonce &&
5494
5500
  bootstrapChunks.push('" nonce="', escapeTextForBrowser(nonce)),
5495
- "string" === typeof idPrefix &&
5501
+ "string" === typeof importMap &&
5496
5502
  bootstrapChunks.push(
5497
5503
  '" integrity="',
5498
- escapeTextForBrowser(idPrefix)
5504
+ escapeTextForBrowser(importMap)
5499
5505
  ),
5500
- "string" === typeof inlineScriptWithNonce &&
5506
+ "string" === typeof externalRuntimeScript &&
5501
5507
  bootstrapChunks.push(
5502
5508
  '" crossorigin="',
5503
- escapeTextForBrowser(inlineScriptWithNonce)
5509
+ escapeTextForBrowser(externalRuntimeScript)
5504
5510
  ),
5505
5511
  bootstrapChunks.push('" async="">\x3c/script>');
5506
- return importMap;
5512
+ return onHeaders;
5507
5513
  }
5508
5514
  function createResumableState(
5509
5515
  identifierPrefix,
@@ -5534,6 +5540,9 @@
5534
5540
  moduleScriptResources: {}
5535
5541
  };
5536
5542
  }
5543
+ function createPreambleState() {
5544
+ return { htmlChunks: null, headChunks: null, bodyChunks: null };
5545
+ }
5537
5546
  function createFormatContext(insertionMode, selectedValue, tagScope) {
5538
5547
  return {
5539
5548
  insertionMode: insertionMode,
@@ -5552,33 +5561,34 @@
5552
5561
  parentContext.tagScope
5553
5562
  );
5554
5563
  case "svg":
5555
- return createFormatContext(3, null, parentContext.tagScope);
5564
+ return createFormatContext(4, null, parentContext.tagScope);
5556
5565
  case "picture":
5557
5566
  return createFormatContext(2, null, parentContext.tagScope | 2);
5558
5567
  case "math":
5559
- return createFormatContext(4, null, parentContext.tagScope);
5568
+ return createFormatContext(5, null, parentContext.tagScope);
5560
5569
  case "foreignObject":
5561
5570
  return createFormatContext(2, null, parentContext.tagScope);
5562
5571
  case "table":
5563
- return createFormatContext(5, null, parentContext.tagScope);
5572
+ return createFormatContext(6, null, parentContext.tagScope);
5564
5573
  case "thead":
5565
5574
  case "tbody":
5566
5575
  case "tfoot":
5567
- return createFormatContext(6, null, parentContext.tagScope);
5576
+ return createFormatContext(7, null, parentContext.tagScope);
5568
5577
  case "colgroup":
5569
- return createFormatContext(8, null, parentContext.tagScope);
5578
+ return createFormatContext(9, null, parentContext.tagScope);
5570
5579
  case "tr":
5571
- return createFormatContext(7, null, parentContext.tagScope);
5580
+ return createFormatContext(8, null, parentContext.tagScope);
5581
+ case "head":
5582
+ if (2 > parentContext.insertionMode)
5583
+ return createFormatContext(3, null, parentContext.tagScope);
5584
+ break;
5585
+ case "html":
5586
+ if (0 === parentContext.insertionMode)
5587
+ return createFormatContext(1, null, parentContext.tagScope);
5572
5588
  }
5573
- return 5 <= parentContext.insertionMode
5589
+ return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode
5574
5590
  ? createFormatContext(2, null, parentContext.tagScope)
5575
- : 0 === parentContext.insertionMode
5576
- ? "html" === type
5577
- ? createFormatContext(1, null, parentContext.tagScope)
5578
- : createFormatContext(2, null, parentContext.tagScope)
5579
- : 1 === parentContext.insertionMode
5580
- ? createFormatContext(2, null, parentContext.tagScope)
5581
- : parentContext;
5591
+ : parentContext;
5582
5592
  }
5583
5593
  function pushStyleAttribute(target, style) {
5584
5594
  if ("object" !== typeof style)
@@ -6247,6 +6257,7 @@
6247
6257
  props,
6248
6258
  resumableState,
6249
6259
  renderState,
6260
+ preambleState,
6250
6261
  hoistableState,
6251
6262
  formatContext,
6252
6263
  textEmbedded,
@@ -6292,8 +6303,8 @@
6292
6303
  console.error(
6293
6304
  "A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."
6294
6305
  );
6295
- 3 !== formatContext.insertionMode &&
6296
- 4 !== formatContext.insertionMode &&
6306
+ 4 !== formatContext.insertionMode &&
6307
+ 5 !== formatContext.insertionMode &&
6297
6308
  -1 === type.indexOf("-") &&
6298
6309
  type.toLowerCase() !== type &&
6299
6310
  console.error(
@@ -6901,7 +6912,7 @@
6901
6912
  ));
6902
6913
  }
6903
6914
  if (
6904
- 3 === insertionMode ||
6915
+ 4 === insertionMode ||
6905
6916
  noscriptTagInScope ||
6906
6917
  null != props.itemProp
6907
6918
  )
@@ -6920,7 +6931,7 @@
6920
6931
  href = props.href,
6921
6932
  precedence = props.precedence;
6922
6933
  if (
6923
- 3 === formatContext.insertionMode ||
6934
+ 4 === formatContext.insertionMode ||
6924
6935
  formatContext.tagScope & 1 ||
6925
6936
  null != props.itemProp ||
6926
6937
  "string" !== typeof rel ||
@@ -7036,7 +7047,7 @@
7036
7047
  "symbol" === typeof asyncProp ||
7037
7048
  props.onLoad ||
7038
7049
  props.onError ||
7039
- 3 === formatContext.insertionMode ||
7050
+ 4 === formatContext.insertionMode ||
7040
7051
  formatContext.tagScope & 1 ||
7041
7052
  null != props.itemProp
7042
7053
  )
@@ -7099,7 +7110,7 @@
7099
7110
  var precedence$jscomp$0 = props.precedence,
7100
7111
  href$jscomp$0 = props.href;
7101
7112
  if (
7102
- 3 === insertionMode$jscomp$0 ||
7113
+ 4 === insertionMode$jscomp$0 ||
7103
7114
  noscriptTagInScope$jscomp$0 ||
7104
7115
  null != props.itemProp ||
7105
7116
  "string" !== typeof precedence$jscomp$0 ||
@@ -7217,7 +7228,7 @@
7217
7228
  return JSCompiler_inline_result$jscomp$7;
7218
7229
  case "meta":
7219
7230
  if (
7220
- 3 === formatContext.insertionMode ||
7231
+ 4 === formatContext.insertionMode ||
7221
7232
  formatContext.tagScope & 1 ||
7222
7233
  null != props.itemProp
7223
7234
  )
@@ -7401,13 +7412,13 @@
7401
7412
  case "missing-glyph":
7402
7413
  break;
7403
7414
  case "head":
7404
- if (
7405
- 2 > formatContext.insertionMode &&
7406
- null === renderState.headChunks
7407
- ) {
7408
- renderState.headChunks = [];
7415
+ if (2 > formatContext.insertionMode) {
7416
+ var preamble = preambleState || renderState.preamble;
7417
+ if (preamble.headChunks)
7418
+ throw Error("The `<head>` tag may only be rendered once.");
7419
+ preamble.headChunks = [];
7409
7420
  var JSCompiler_inline_result$jscomp$9 = pushStartGenericElement(
7410
- renderState.headChunks,
7421
+ preamble.headChunks,
7411
7422
  props,
7412
7423
  "head"
7413
7424
  );
@@ -7418,24 +7429,42 @@
7418
7429
  "head"
7419
7430
  );
7420
7431
  return JSCompiler_inline_result$jscomp$9;
7421
- case "html":
7422
- if (
7423
- 0 === formatContext.insertionMode &&
7424
- null === renderState.htmlChunks
7425
- ) {
7426
- renderState.htmlChunks = [doctypeChunk];
7432
+ case "body":
7433
+ if (2 > formatContext.insertionMode) {
7434
+ var preamble$jscomp$0 = preambleState || renderState.preamble;
7435
+ if (preamble$jscomp$0.bodyChunks)
7436
+ throw Error("The `<body>` tag may only be rendered once.");
7437
+ preamble$jscomp$0.bodyChunks = [];
7427
7438
  var JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
7428
- renderState.htmlChunks,
7439
+ preamble$jscomp$0.bodyChunks,
7429
7440
  props,
7430
- "html"
7441
+ "body"
7431
7442
  );
7432
7443
  } else
7433
7444
  JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(
7434
7445
  target$jscomp$0,
7435
7446
  props,
7436
- "html"
7447
+ "body"
7437
7448
  );
7438
7449
  return JSCompiler_inline_result$jscomp$10;
7450
+ case "html":
7451
+ if (0 === formatContext.insertionMode) {
7452
+ var preamble$jscomp$1 = preambleState || renderState.preamble;
7453
+ if (preamble$jscomp$1.htmlChunks)
7454
+ throw Error("The `<html>` tag may only be rendered once.");
7455
+ preamble$jscomp$1.htmlChunks = [doctypeChunk];
7456
+ var JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
7457
+ preamble$jscomp$1.htmlChunks,
7458
+ props,
7459
+ "html"
7460
+ );
7461
+ } else
7462
+ JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(
7463
+ target$jscomp$0,
7464
+ props,
7465
+ "html"
7466
+ );
7467
+ return JSCompiler_inline_result$jscomp$11;
7439
7468
  default:
7440
7469
  if (-1 !== type.indexOf("-")) {
7441
7470
  target$jscomp$0.push(startChunkForTag(type));
@@ -7502,6 +7531,15 @@
7502
7531
  ((chunk = "</" + tag + ">"), endTagCache.set(tag, chunk));
7503
7532
  return chunk;
7504
7533
  }
7534
+ function hoistPreambleState(renderState, preambleState) {
7535
+ renderState = renderState.preamble;
7536
+ null === renderState.htmlChunks &&
7537
+ (renderState.htmlChunks = preambleState.htmlChunks);
7538
+ null === renderState.headChunks &&
7539
+ (renderState.headChunks = preambleState.headChunks);
7540
+ null === renderState.bodyChunks &&
7541
+ (renderState.bodyChunks = preambleState.bodyChunks);
7542
+ }
7505
7543
  function writeBootstrap(destination, renderState) {
7506
7544
  renderState = renderState.bootstrapChunks;
7507
7545
  for (var i = 0; i < renderState.length - 1; i++)
@@ -7525,6 +7563,7 @@
7525
7563
  switch (formatContext.insertionMode) {
7526
7564
  case 0:
7527
7565
  case 1:
7566
+ case 3:
7528
7567
  case 2:
7529
7568
  return (
7530
7569
  destination.push('<div hidden id="'),
@@ -7533,7 +7572,7 @@
7533
7572
  destination.push(renderState),
7534
7573
  destination.push('">')
7535
7574
  );
7536
- case 3:
7575
+ case 4:
7537
7576
  return (
7538
7577
  destination.push(
7539
7578
  '<svg aria-hidden="true" style="display:none" id="'
@@ -7543,7 +7582,7 @@
7543
7582
  destination.push(renderState),
7544
7583
  destination.push('">')
7545
7584
  );
7546
- case 4:
7585
+ case 5:
7547
7586
  return (
7548
7587
  destination.push(
7549
7588
  '<math aria-hidden="true" style="display:none" id="'
@@ -7553,7 +7592,7 @@
7553
7592
  destination.push(renderState),
7554
7593
  destination.push('">')
7555
7594
  );
7556
- case 5:
7595
+ case 6:
7557
7596
  return (
7558
7597
  destination.push('<table hidden id="'),
7559
7598
  destination.push(renderState.segmentPrefix),
@@ -7561,7 +7600,7 @@
7561
7600
  destination.push(renderState),
7562
7601
  destination.push('">')
7563
7602
  );
7564
- case 6:
7603
+ case 7:
7565
7604
  return (
7566
7605
  destination.push('<table hidden><tbody id="'),
7567
7606
  destination.push(renderState.segmentPrefix),
@@ -7569,7 +7608,7 @@
7569
7608
  destination.push(renderState),
7570
7609
  destination.push('">')
7571
7610
  );
7572
- case 7:
7611
+ case 8:
7573
7612
  return (
7574
7613
  destination.push('<table hidden><tr id="'),
7575
7614
  destination.push(renderState.segmentPrefix),
@@ -7577,7 +7616,7 @@
7577
7616
  destination.push(renderState),
7578
7617
  destination.push('">')
7579
7618
  );
7580
- case 8:
7619
+ case 9:
7581
7620
  return (
7582
7621
  destination.push('<table hidden><colgroup id="'),
7583
7622
  destination.push(renderState.segmentPrefix),
@@ -7593,19 +7632,20 @@
7593
7632
  switch (formatContext.insertionMode) {
7594
7633
  case 0:
7595
7634
  case 1:
7635
+ case 3:
7596
7636
  case 2:
7597
7637
  return destination.push("</div>");
7598
- case 3:
7599
- return destination.push("</svg>");
7600
7638
  case 4:
7601
- return destination.push("</math>");
7639
+ return destination.push("</svg>");
7602
7640
  case 5:
7603
- return destination.push("</table>");
7641
+ return destination.push("</math>");
7604
7642
  case 6:
7605
- return destination.push("</tbody></table>");
7643
+ return destination.push("</table>");
7606
7644
  case 7:
7607
- return destination.push("</tr></table>");
7645
+ return destination.push("</tbody></table>");
7608
7646
  case 8:
7647
+ return destination.push("</tr></table>");
7648
+ case 9:
7609
7649
  return destination.push("</colgroup></table>");
7610
7650
  default:
7611
7651
  throw Error("Unknown insertion mode. This is a bug in React.");
@@ -8512,7 +8552,7 @@
8512
8552
  this.status = 10;
8513
8553
  this.fatalError = null;
8514
8554
  this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;
8515
- this.completedRootSegment = null;
8555
+ this.completedPreambleSegments = this.completedRootSegment = null;
8516
8556
  this.abortableTasks = abortSet;
8517
8557
  this.pingedTasks = [];
8518
8558
  this.clientRenderedBoundaries = [];
@@ -8572,6 +8612,7 @@
8572
8612
  null,
8573
8613
  renderState,
8574
8614
  null,
8615
+ null,
8575
8616
  resumableState.abortableTasks,
8576
8617
  null,
8577
8618
  rootFormatContext,
@@ -8592,7 +8633,12 @@
8592
8633
  ((request.flushScheduled = null !== request.destination),
8593
8634
  performWork(request));
8594
8635
  }
8595
- function createSuspenseBoundary(request, fallbackAbortableTasks) {
8636
+ function createSuspenseBoundary(
8637
+ request,
8638
+ fallbackAbortableTasks,
8639
+ contentPreamble,
8640
+ fallbackPreamble
8641
+ ) {
8596
8642
  return {
8597
8643
  status: 0,
8598
8644
  rootSegmentID: -1,
@@ -8604,6 +8650,8 @@
8604
8650
  errorDigest: null,
8605
8651
  contentState: createHoistableState(),
8606
8652
  fallbackState: createHoistableState(),
8653
+ contentPreamble: contentPreamble,
8654
+ fallbackPreamble: fallbackPreamble,
8607
8655
  trackedContentKeyPath: null,
8608
8656
  trackedFallbackNode: null,
8609
8657
  errorMessage: null,
@@ -8618,6 +8666,7 @@
8618
8666
  childIndex,
8619
8667
  blockedBoundary,
8620
8668
  blockedSegment,
8669
+ blockedPreamble,
8621
8670
  hoistableState,
8622
8671
  abortSet,
8623
8672
  keyPath,
@@ -8642,6 +8691,7 @@
8642
8691
  },
8643
8692
  blockedBoundary: blockedBoundary,
8644
8693
  blockedSegment: blockedSegment,
8694
+ blockedPreamble: blockedPreamble,
8645
8695
  hoistableState: hoistableState,
8646
8696
  abortSet: abortSet,
8647
8697
  keyPath: keyPath,
@@ -8688,6 +8738,7 @@
8688
8738
  },
8689
8739
  blockedBoundary: blockedBoundary,
8690
8740
  blockedSegment: null,
8741
+ blockedPreamble: null,
8691
8742
  hoistableState: hoistableState,
8692
8743
  abortSet: abortSet,
8693
8744
  keyPath: keyPath,
@@ -8712,11 +8763,12 @@
8712
8763
  ) {
8713
8764
  return {
8714
8765
  status: 0,
8766
+ parentFlushed: !1,
8715
8767
  id: -1,
8716
8768
  index: index,
8717
- parentFlushed: !1,
8718
8769
  chunks: [],
8719
8770
  children: [],
8771
+ preambleChildren: [],
8720
8772
  parentFormatContext: parentFormatContext,
8721
8773
  boundary: boundary,
8722
8774
  lastPushedText: lastPushedText,
@@ -9416,6 +9468,7 @@
9416
9468
  var target = segment.chunks,
9417
9469
  resumableState = request.resumableState,
9418
9470
  renderState = request.renderState,
9471
+ preambleState = task.blockedPreamble,
9419
9472
  hoistableState = task.hoistableState,
9420
9473
  formatContext = task.formatContext,
9421
9474
  textEmbedded = segment.lastPushedText,
@@ -9441,6 +9494,7 @@
9441
9494
  props,
9442
9495
  resumableState,
9443
9496
  renderState,
9497
+ preambleState,
9444
9498
  hoistableState,
9445
9499
  formatContext,
9446
9500
  textEmbedded,
@@ -9449,9 +9503,46 @@
9449
9503
  segment.lastPushedText = !1;
9450
9504
  var _prevContext = task.formatContext,
9451
9505
  _prevKeyPath2 = task.keyPath;
9452
- task.formatContext = getChildFormatContext(_prevContext, type, props);
9453
9506
  task.keyPath = keyPath;
9454
- renderNode(request, task, _children, -1);
9507
+ if (
9508
+ 3 ===
9509
+ (task.formatContext = getChildFormatContext(
9510
+ _prevContext,
9511
+ type,
9512
+ props
9513
+ )).insertionMode
9514
+ ) {
9515
+ var preambleSegment = createPendingSegment(
9516
+ request,
9517
+ 0,
9518
+ null,
9519
+ task.formatContext,
9520
+ !1,
9521
+ !1
9522
+ );
9523
+ segment.preambleChildren.push(preambleSegment);
9524
+ var preambleTask = createRenderTask(
9525
+ request,
9526
+ null,
9527
+ _children,
9528
+ -1,
9529
+ task.blockedBoundary,
9530
+ preambleSegment,
9531
+ task.blockedPreamble,
9532
+ task.hoistableState,
9533
+ request.abortableTasks,
9534
+ task.keyPath,
9535
+ task.formatContext,
9536
+ task.context,
9537
+ task.treeContext,
9538
+ task.componentStack,
9539
+ task.isFallback,
9540
+ emptyContextObject,
9541
+ task.debugTask
9542
+ );
9543
+ pushComponentStack(preambleTask);
9544
+ request.pingedTasks.push(preambleTask);
9545
+ } else renderNode(request, task, _children, -1);
9455
9546
  task.formatContext = _prevContext;
9456
9547
  task.keyPath = _prevKeyPath2;
9457
9548
  a: {
@@ -9488,6 +9579,9 @@
9488
9579
  resumableState$jscomp$0.hasHtml = !0;
9489
9580
  break a;
9490
9581
  }
9582
+ break;
9583
+ case "head":
9584
+ if (1 >= _prevContext.insertionMode) break a;
9491
9585
  }
9492
9586
  target$jscomp$0.push(endChunkForTag(type));
9493
9587
  }
@@ -9541,12 +9635,26 @@
9541
9635
  } else {
9542
9636
  var prevKeyPath$jscomp$3 = task.keyPath,
9543
9637
  parentBoundary = task.blockedBoundary,
9638
+ parentPreamble = task.blockedPreamble,
9544
9639
  parentHoistableState = task.hoistableState,
9545
9640
  parentSegment = task.blockedSegment,
9546
9641
  fallback = props.fallback,
9547
9642
  content = props.children,
9548
- fallbackAbortSet = new Set(),
9549
- newBoundary = createSuspenseBoundary(request, fallbackAbortSet);
9643
+ fallbackAbortSet = new Set();
9644
+ var newBoundary =
9645
+ 2 > task.formatContext.insertionMode
9646
+ ? createSuspenseBoundary(
9647
+ request,
9648
+ fallbackAbortSet,
9649
+ createPreambleState(),
9650
+ createPreambleState()
9651
+ )
9652
+ : createSuspenseBoundary(
9653
+ request,
9654
+ fallbackAbortSet,
9655
+ null,
9656
+ null
9657
+ );
9550
9658
  null !== request.trackedPostpones &&
9551
9659
  (newBoundary.trackedContentKeyPath = keyPath);
9552
9660
  var boundarySegment = createPendingSegment(
@@ -9586,6 +9694,7 @@
9586
9694
  );
9587
9695
  newBoundary.trackedFallbackNode = fallbackReplayNode;
9588
9696
  task.blockedSegment = boundarySegment;
9697
+ task.blockedPreamble = newBoundary.fallbackPreamble;
9589
9698
  task.keyPath = fallbackKeyPath;
9590
9699
  boundarySegment.status = 6;
9591
9700
  try {
@@ -9598,6 +9707,7 @@
9598
9707
  );
9599
9708
  } finally {
9600
9709
  (task.blockedSegment = parentSegment),
9710
+ (task.blockedPreamble = parentPreamble),
9601
9711
  (task.keyPath = prevKeyPath$jscomp$3);
9602
9712
  }
9603
9713
  var suspendedPrimaryTask = createRenderTask(
@@ -9607,6 +9717,7 @@
9607
9717
  -1,
9608
9718
  newBoundary,
9609
9719
  contentRootSegment,
9720
+ newBoundary.contentPreamble,
9610
9721
  newBoundary.contentState,
9611
9722
  task.abortSet,
9612
9723
  keyPath,
@@ -9622,6 +9733,7 @@
9622
9733
  request.pingedTasks.push(suspendedPrimaryTask);
9623
9734
  } else {
9624
9735
  task.blockedBoundary = newBoundary;
9736
+ task.blockedPreamble = newBoundary.contentPreamble;
9625
9737
  task.hoistableState = newBoundary.contentState;
9626
9738
  task.blockedSegment = contentRootSegment;
9627
9739
  task.keyPath = keyPath;
@@ -9634,6 +9746,9 @@
9634
9746
  0 === newBoundary.pendingTasks && 0 === newBoundary.status)
9635
9747
  ) {
9636
9748
  newBoundary.status = 1;
9749
+ 0 === request.pendingRootTasks &&
9750
+ task.blockedPreamble &&
9751
+ preparePreamble(request);
9637
9752
  break a;
9638
9753
  }
9639
9754
  } catch (thrownValue$6) {
@@ -9673,6 +9788,7 @@
9673
9788
  untrackBoundary(request, newBoundary);
9674
9789
  } finally {
9675
9790
  (task.blockedBoundary = parentBoundary),
9791
+ (task.blockedPreamble = parentPreamble),
9676
9792
  (task.hoistableState = parentHoistableState),
9677
9793
  (task.blockedSegment = parentSegment),
9678
9794
  (task.keyPath = prevKeyPath$jscomp$3);
@@ -9684,6 +9800,7 @@
9684
9800
  -1,
9685
9801
  parentBoundary,
9686
9802
  boundarySegment,
9803
+ newBoundary.fallbackPreamble,
9687
9804
  newBoundary.fallbackState,
9688
9805
  fallbackAbortSet,
9689
9806
  [keyPath[0], "Suspense Fallback", keyPath[2]],
@@ -9922,17 +10039,27 @@
9922
10039
  previousReplaySet = task.replay,
9923
10040
  parentBoundary = task.blockedBoundary,
9924
10041
  parentHoistableState = task.hoistableState,
9925
- content = props.children;
9926
- props = props.fallback;
9927
- var fallbackAbortSet = new Set(),
9928
- resumedBoundary = createSuspenseBoundary(
9929
- request,
9930
- fallbackAbortSet
9931
- );
9932
- resumedBoundary.parentFlushed = !0;
9933
- resumedBoundary.rootSegmentID = type;
9934
- task.blockedBoundary = resumedBoundary;
9935
- task.hoistableState = resumedBoundary.contentState;
10042
+ content = props.children,
10043
+ fallback = props.fallback,
10044
+ fallbackAbortSet = new Set();
10045
+ props =
10046
+ 2 > task.formatContext.insertionMode
10047
+ ? createSuspenseBoundary(
10048
+ request,
10049
+ fallbackAbortSet,
10050
+ createPreambleState(),
10051
+ createPreambleState()
10052
+ )
10053
+ : createSuspenseBoundary(
10054
+ request,
10055
+ fallbackAbortSet,
10056
+ null,
10057
+ null
10058
+ );
10059
+ props.parentFlushed = !0;
10060
+ props.rootSegmentID = type;
10061
+ task.blockedBoundary = props;
10062
+ task.hoistableState = props.contentState;
9936
10063
  task.keyPath = keyPath;
9937
10064
  task.replay = { nodes: ref, slots: name, pendingTasks: 1 };
9938
10065
  try {
@@ -9945,16 +10072,13 @@
9945
10072
  "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
9946
10073
  );
9947
10074
  task.replay.pendingTasks--;
9948
- if (
9949
- 0 === resumedBoundary.pendingTasks &&
9950
- 0 === resumedBoundary.status
9951
- ) {
9952
- resumedBoundary.status = 1;
9953
- request.completedBoundaries.push(resumedBoundary);
10075
+ if (0 === props.pendingTasks && 0 === props.status) {
10076
+ props.status = 1;
10077
+ request.completedBoundaries.push(props);
9954
10078
  break a;
9955
10079
  }
9956
10080
  } catch (error) {
9957
- (resumedBoundary.status = 4),
10081
+ (props.status = 4),
9958
10082
  (childNodes = getThrownInfo(task.componentStack)),
9959
10083
  "object" === typeof error &&
9960
10084
  null !== error &&
@@ -9972,15 +10096,9 @@
9972
10096
  childNodes,
9973
10097
  task.debugTask
9974
10098
  )),
9975
- encodeErrorForBoundary(
9976
- resumedBoundary,
9977
- replay,
9978
- error,
9979
- childNodes,
9980
- !1
9981
- ),
10099
+ encodeErrorForBoundary(props, replay, error, childNodes, !1),
9982
10100
  task.replay.pendingTasks--,
9983
- request.clientRenderedBoundaries.push(resumedBoundary);
10101
+ request.clientRenderedBoundaries.push(props);
9984
10102
  } finally {
9985
10103
  (task.blockedBoundary = parentBoundary),
9986
10104
  (task.hoistableState = parentHoistableState),
@@ -9991,10 +10109,10 @@
9991
10109
  request,
9992
10110
  null,
9993
10111
  { nodes: keyOrIndex, slots: node, pendingTasks: 0 },
9994
- props,
10112
+ fallback,
9995
10113
  -1,
9996
10114
  parentBoundary,
9997
- resumedBoundary.fallbackState,
10115
+ props.fallbackState,
9998
10116
  fallbackAbortSet,
9999
10117
  [keyPath[0], "Suspense Fallback", keyPath[2]],
10000
10118
  task.formatContext,
@@ -10526,6 +10644,7 @@
10526
10644
  task.childIndex,
10527
10645
  task.blockedBoundary,
10528
10646
  newSegment,
10647
+ task.blockedPreamble,
10529
10648
  task.hoistableState,
10530
10649
  task.abortSet,
10531
10650
  task.keyPath,
@@ -10743,7 +10862,12 @@
10743
10862
  errorDigest = errorDigest$jscomp$0,
10744
10863
  errorInfo = errorInfo$jscomp$0,
10745
10864
  wasAborted = aborted,
10746
- resumedBoundary = createSuspenseBoundary(request, new Set());
10865
+ resumedBoundary = createSuspenseBoundary(
10866
+ request,
10867
+ new Set(),
10868
+ null,
10869
+ null
10870
+ );
10747
10871
  resumedBoundary.parentFlushed = !0;
10748
10872
  resumedBoundary.rootSegmentID = node;
10749
10873
  resumedBoundary.status = 4;
@@ -10953,6 +11077,7 @@
10953
11077
  }
10954
11078
  function completeShell(request) {
10955
11079
  null === request.trackedPostpones && safelyEmitEarlyPreloads(request, !0);
11080
+ null === request.trackedPostpones && preparePreamble(request);
10956
11081
  request.onShellError = noop;
10957
11082
  request = request.onShellReady;
10958
11083
  request();
@@ -10965,6 +11090,7 @@
10965
11090
  : null === request.completedRootSegment ||
10966
11091
  5 !== request.completedRootSegment.status
10967
11092
  );
11093
+ preparePreamble(request);
10968
11094
  request = request.onAllReady;
10969
11095
  request();
10970
11096
  }
@@ -11009,7 +11135,11 @@
11009
11135
  abortTaskSoft,
11010
11136
  request
11011
11137
  ),
11012
- boundary.fallbackAbortableTasks.clear()))
11138
+ boundary.fallbackAbortableTasks.clear(),
11139
+ 0 === request.pendingRootTasks &&
11140
+ null === request.trackedPostpones &&
11141
+ null !== boundary.contentPreamble &&
11142
+ preparePreamble(request)))
11013
11143
  : null !== segment &&
11014
11144
  segment.parentFlushed &&
11015
11145
  1 === segment.status &&
@@ -11256,7 +11386,11 @@
11256
11386
  ),
11257
11387
  untrackBoundary(request, boundary),
11258
11388
  boundary.parentFlushed &&
11259
- request.clientRenderedBoundaries.push(boundary)));
11389
+ request.clientRenderedBoundaries.push(boundary),
11390
+ 0 === request.pendingRootTasks &&
11391
+ null === request.trackedPostpones &&
11392
+ null !== boundary.contentPreamble &&
11393
+ preparePreamble(request)));
11260
11394
  request.allPendingTasks--;
11261
11395
  0 === request.allPendingTasks && completeAll(request);
11262
11396
  }
@@ -11285,6 +11419,85 @@
11285
11419
  }
11286
11420
  }
11287
11421
  }
11422
+ function preparePreambleFromSubtree(
11423
+ request,
11424
+ segment,
11425
+ collectedPreambleSegments
11426
+ ) {
11427
+ segment.preambleChildren.length &&
11428
+ collectedPreambleSegments.push(segment.preambleChildren);
11429
+ for (var pendingPreambles = !1, i = 0; i < segment.children.length; i++)
11430
+ pendingPreambles =
11431
+ preparePreambleFromSegment(
11432
+ request,
11433
+ segment.children[i],
11434
+ collectedPreambleSegments
11435
+ ) || pendingPreambles;
11436
+ return pendingPreambles;
11437
+ }
11438
+ function preparePreambleFromSegment(
11439
+ request,
11440
+ segment,
11441
+ collectedPreambleSegments
11442
+ ) {
11443
+ var boundary = segment.boundary;
11444
+ if (null === boundary)
11445
+ return preparePreambleFromSubtree(
11446
+ request,
11447
+ segment,
11448
+ collectedPreambleSegments
11449
+ );
11450
+ var preamble = boundary.contentPreamble,
11451
+ fallbackPreamble = boundary.fallbackPreamble;
11452
+ if (null === preamble || null === fallbackPreamble) return !1;
11453
+ switch (boundary.status) {
11454
+ case 1:
11455
+ hoistPreambleState(request.renderState, preamble);
11456
+ segment = boundary.completedSegments[0];
11457
+ if (!segment)
11458
+ throw Error(
11459
+ "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
11460
+ );
11461
+ return preparePreambleFromSubtree(
11462
+ request,
11463
+ segment,
11464
+ collectedPreambleSegments
11465
+ );
11466
+ case 5:
11467
+ if (null !== request.trackedPostpones) return !0;
11468
+ case 4:
11469
+ if (1 === segment.status)
11470
+ return (
11471
+ hoistPreambleState(request.renderState, fallbackPreamble),
11472
+ preparePreambleFromSubtree(
11473
+ request,
11474
+ segment,
11475
+ collectedPreambleSegments
11476
+ )
11477
+ );
11478
+ default:
11479
+ return !0;
11480
+ }
11481
+ }
11482
+ function preparePreamble(request) {
11483
+ if (
11484
+ request.completedRootSegment &&
11485
+ null === request.completedPreambleSegments
11486
+ ) {
11487
+ var collectedPreambleSegments = [],
11488
+ hasPendingPreambles = preparePreambleFromSegment(
11489
+ request,
11490
+ request.completedRootSegment,
11491
+ collectedPreambleSegments
11492
+ ),
11493
+ preamble = request.renderState.preamble;
11494
+ if (
11495
+ !1 === hasPendingPreambles ||
11496
+ (preamble.headChunks && preamble.bodyChunks)
11497
+ )
11498
+ request.completedPreambleSegments = collectedPreambleSegments;
11499
+ }
11500
+ }
11288
11501
  function flushSubtree(request, destination, segment, hoistableState) {
11289
11502
  segment.parentFlushed = !0;
11290
11503
  switch (segment.status) {
@@ -11514,6 +11727,8 @@
11514
11727
  completedRootSegment = request.completedRootSegment;
11515
11728
  if (null !== completedRootSegment) {
11516
11729
  if (5 === completedRootSegment.status) return;
11730
+ var completedPreambleSegments = request.completedPreambleSegments;
11731
+ if (null === completedPreambleSegments) return;
11517
11732
  var renderState = request.renderState;
11518
11733
  if (
11519
11734
  (0 !== request.allPendingTasks ||
@@ -11528,8 +11743,9 @@
11528
11743
  ((resumableState.scriptResources[src] = null),
11529
11744
  renderState.scripts.add(chunks));
11530
11745
  }
11531
- var htmlChunks = renderState.htmlChunks,
11532
- headChunks = renderState.headChunks,
11746
+ var preamble = renderState.preamble,
11747
+ htmlChunks = preamble.htmlChunks,
11748
+ headChunks = preamble.headChunks,
11533
11749
  i$jscomp$0;
11534
11750
  if (htmlChunks) {
11535
11751
  for (i$jscomp$0 = 0; i$jscomp$0 < htmlChunks.length; i$jscomp$0++)
@@ -11592,11 +11808,38 @@
11592
11808
  i$jscomp$0++
11593
11809
  )
11594
11810
  destination.push(hoistableChunks[i$jscomp$0]);
11595
- hoistableChunks.length = 0;
11596
- if (htmlChunks && null === headChunks) {
11811
+ for (
11812
+ renderState = hoistableChunks.length = 0;
11813
+ renderState < completedPreambleSegments.length;
11814
+ renderState++
11815
+ ) {
11816
+ var segments = completedPreambleSegments[renderState];
11817
+ for (
11818
+ _renderState$external = 0;
11819
+ _renderState$external < segments.length;
11820
+ _renderState$external++
11821
+ )
11822
+ flushSegment(
11823
+ request,
11824
+ destination,
11825
+ segments[_renderState$external],
11826
+ null
11827
+ );
11828
+ }
11829
+ var preamble$jscomp$0 = request.renderState.preamble,
11830
+ headChunks$jscomp$0 = preamble$jscomp$0.headChunks;
11831
+ if (preamble$jscomp$0.htmlChunks || headChunks$jscomp$0) {
11597
11832
  var chunk$jscomp$0 = endChunkForTag("head");
11598
11833
  destination.push(chunk$jscomp$0);
11599
11834
  }
11835
+ var bodyChunks = preamble$jscomp$0.bodyChunks;
11836
+ if (bodyChunks)
11837
+ for (
11838
+ completedPreambleSegments = 0;
11839
+ completedPreambleSegments < bodyChunks.length;
11840
+ completedPreambleSegments++
11841
+ )
11842
+ destination.push(bodyChunks[completedPreambleSegments]);
11600
11843
  flushSegment(request, destination, completedRootSegment, null);
11601
11844
  request.completedRootSegment = null;
11602
11845
  writeBootstrap(destination, request.renderState);
@@ -13354,5 +13597,5 @@
13354
13597
  });
13355
13598
  });
13356
13599
  };
13357
- exports.version = "19.1.0-experimental-d46b04a2-20250117";
13600
+ exports.version = "19.1.0-experimental-18eaf51b-20250118";
13358
13601
  })();