react-dom 19.2.0-canary-b07717d8-20250528 → 19.2.0-canary-14094f80-20250529

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.
@@ -1386,7 +1386,8 @@ var NothingSent = 0,
1386
1386
  EXISTS = null,
1387
1387
  PRELOAD_NO_CREDS = [];
1388
1388
  Object.freeze(PRELOAD_NO_CREDS);
1389
- var endInlineScript = "\x3c/script>";
1389
+ var currentlyFlushingRenderState = null,
1390
+ endInlineScript = "\x3c/script>";
1390
1391
  function escapeEntireInlineScriptContent(scriptText) {
1391
1392
  checkHtmlStringCoercion(scriptText);
1392
1393
  return ("" + scriptText).replace(scriptRegex, scriptReplacer);
@@ -1405,19 +1406,26 @@ function createRenderState(
1405
1406
  onHeaders,
1406
1407
  maxHeadersLength
1407
1408
  ) {
1409
+ externalRuntimeConfig =
1410
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
1408
1411
  var inlineScriptWithNonce =
1409
- void 0 === nonce
1412
+ void 0 === externalRuntimeConfig
1410
1413
  ? "<script"
1411
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
1412
- idPrefix = resumableState.idPrefix;
1413
- externalRuntimeConfig = [];
1414
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
1414
+ : '<script nonce="' + escapeTextForBrowser(externalRuntimeConfig) + '"',
1415
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
1416
+ inlineStyleWithNonce =
1417
+ void 0 === nonceStyle
1418
+ ? "<style"
1419
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
1420
+ idPrefix = resumableState.idPrefix,
1421
+ bootstrapChunks = [],
1422
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
1415
1423
  bootstrapScripts = resumableState.bootstrapScripts,
1416
1424
  bootstrapModules = resumableState.bootstrapModules;
1417
1425
  void 0 !== bootstrapScriptContent &&
1418
- (externalRuntimeConfig.push(inlineScriptWithNonce),
1419
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
1420
- externalRuntimeConfig.push(
1426
+ (bootstrapChunks.push(inlineScriptWithNonce),
1427
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1428
+ bootstrapChunks.push(
1421
1429
  endOfStartTag,
1422
1430
  escapeEntireInlineScriptContent(bootstrapScriptContent),
1423
1431
  endInlineScript
@@ -1450,9 +1458,10 @@ function createRenderState(
1450
1458
  segmentPrefix: idPrefix + "S:",
1451
1459
  boundaryPrefix: idPrefix + "B:",
1452
1460
  startInlineScript: inlineScriptWithNonce,
1461
+ startInlineStyle: inlineStyleWithNonce,
1453
1462
  preamble: createPreambleState(),
1454
1463
  externalRuntimeScript: null,
1455
- bootstrapChunks: externalRuntimeConfig,
1464
+ bootstrapChunks: bootstrapChunks,
1456
1465
  importMapChunks: bootstrapScriptContent,
1457
1466
  onHeaders: onHeaders,
1458
1467
  headers: importMap,
@@ -1479,123 +1488,119 @@ function createRenderState(
1479
1488
  scripts: new Map(),
1480
1489
  moduleScripts: new Map()
1481
1490
  },
1482
- nonce: nonce,
1491
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
1483
1492
  hoistableState: null,
1484
1493
  stylesToHoist: !1
1485
1494
  };
1486
1495
  if (void 0 !== bootstrapScripts)
1487
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
1488
- maxHeadersLength = bootstrapScripts[importMap];
1489
- bootstrapScriptContent = idPrefix = void 0;
1490
- var props = {
1491
- rel: "preload",
1492
- as: "script",
1493
- fetchPriority: "low",
1494
- nonce: nonce
1495
- };
1496
- "string" === typeof maxHeadersLength
1497
- ? (props.href = inlineScriptWithNonce = maxHeadersLength)
1498
- : ((props.href = inlineScriptWithNonce = maxHeadersLength.src),
1499
- (props.integrity = bootstrapScriptContent =
1500
- "string" === typeof maxHeadersLength.integrity
1501
- ? maxHeadersLength.integrity
1502
- : void 0),
1503
- (props.crossOrigin = idPrefix =
1504
- "string" === typeof maxHeadersLength ||
1505
- null == maxHeadersLength.crossOrigin
1506
- ? void 0
1507
- : "use-credentials" === maxHeadersLength.crossOrigin
1508
- ? "use-credentials"
1509
- : ""));
1510
- preloadBootstrapScriptOrModule(
1511
- resumableState,
1512
- onHeaders,
1513
- inlineScriptWithNonce,
1514
- props
1515
- );
1516
- externalRuntimeConfig.push(
1517
- '<script src="',
1518
- escapeTextForBrowser(inlineScriptWithNonce),
1519
- attributeEnd
1520
- );
1521
- nonce &&
1522
- externalRuntimeConfig.push(
1523
- ' nonce="',
1524
- escapeTextForBrowser(nonce),
1525
- attributeEnd
1526
- );
1527
- "string" === typeof bootstrapScriptContent &&
1528
- externalRuntimeConfig.push(
1529
- ' integrity="',
1530
- escapeTextForBrowser(bootstrapScriptContent),
1531
- attributeEnd
1532
- );
1533
- "string" === typeof idPrefix &&
1534
- externalRuntimeConfig.push(
1535
- ' crossorigin="',
1536
- escapeTextForBrowser(idPrefix),
1496
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
1497
+ (maxHeadersLength = bootstrapScripts[importMap]),
1498
+ (inlineStyleWithNonce = nonceStyle = void 0),
1499
+ (idPrefix = {
1500
+ rel: "preload",
1501
+ as: "script",
1502
+ fetchPriority: "low",
1503
+ nonce: nonce
1504
+ }),
1505
+ "string" === typeof maxHeadersLength
1506
+ ? (idPrefix.href = inlineScriptWithNonce = maxHeadersLength)
1507
+ : ((idPrefix.href = inlineScriptWithNonce = maxHeadersLength.src),
1508
+ (idPrefix.integrity = inlineStyleWithNonce =
1509
+ "string" === typeof maxHeadersLength.integrity
1510
+ ? maxHeadersLength.integrity
1511
+ : void 0),
1512
+ (idPrefix.crossOrigin = nonceStyle =
1513
+ "string" === typeof maxHeadersLength ||
1514
+ null == maxHeadersLength.crossOrigin
1515
+ ? void 0
1516
+ : "use-credentials" === maxHeadersLength.crossOrigin
1517
+ ? "use-credentials"
1518
+ : "")),
1519
+ preloadBootstrapScriptOrModule(
1520
+ resumableState,
1521
+ onHeaders,
1522
+ inlineScriptWithNonce,
1523
+ idPrefix
1524
+ ),
1525
+ bootstrapChunks.push(
1526
+ '<script src="',
1527
+ escapeTextForBrowser(inlineScriptWithNonce),
1537
1528
  attributeEnd
1538
- );
1539
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState);
1540
- externalRuntimeConfig.push(' async="">\x3c/script>');
1541
- }
1529
+ ),
1530
+ externalRuntimeConfig &&
1531
+ bootstrapChunks.push(
1532
+ ' nonce="',
1533
+ escapeTextForBrowser(externalRuntimeConfig),
1534
+ attributeEnd
1535
+ ),
1536
+ "string" === typeof inlineStyleWithNonce &&
1537
+ bootstrapChunks.push(
1538
+ ' integrity="',
1539
+ escapeTextForBrowser(inlineStyleWithNonce),
1540
+ attributeEnd
1541
+ ),
1542
+ "string" === typeof nonceStyle &&
1543
+ bootstrapChunks.push(
1544
+ ' crossorigin="',
1545
+ escapeTextForBrowser(nonceStyle),
1546
+ attributeEnd
1547
+ ),
1548
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1549
+ bootstrapChunks.push(' async="">\x3c/script>');
1542
1550
  if (void 0 !== bootstrapModules)
1543
- for (
1544
- bootstrapScripts = 0;
1545
- bootstrapScripts < bootstrapModules.length;
1546
- bootstrapScripts++
1547
- )
1548
- (importMap = bootstrapModules[bootstrapScripts]),
1549
- (idPrefix = inlineScriptWithNonce = void 0),
1550
- (bootstrapScriptContent = {
1551
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
1552
+ (bootstrapScripts = bootstrapModules[nonce]),
1553
+ (inlineScriptWithNonce = maxHeadersLength = void 0),
1554
+ (nonceStyle = {
1551
1555
  rel: "modulepreload",
1552
1556
  fetchPriority: "low",
1553
- nonce: nonce
1557
+ nonce: externalRuntimeConfig
1554
1558
  }),
1555
- "string" === typeof importMap
1556
- ? (bootstrapScriptContent.href = maxHeadersLength = importMap)
1557
- : ((bootstrapScriptContent.href = maxHeadersLength = importMap.src),
1558
- (bootstrapScriptContent.integrity = idPrefix =
1559
- "string" === typeof importMap.integrity
1560
- ? importMap.integrity
1559
+ "string" === typeof bootstrapScripts
1560
+ ? (nonceStyle.href = importMap = bootstrapScripts)
1561
+ : ((nonceStyle.href = importMap = bootstrapScripts.src),
1562
+ (nonceStyle.integrity = inlineScriptWithNonce =
1563
+ "string" === typeof bootstrapScripts.integrity
1564
+ ? bootstrapScripts.integrity
1561
1565
  : void 0),
1562
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
1563
- "string" === typeof importMap || null == importMap.crossOrigin
1566
+ (nonceStyle.crossOrigin = maxHeadersLength =
1567
+ "string" === typeof bootstrapScripts ||
1568
+ null == bootstrapScripts.crossOrigin
1564
1569
  ? void 0
1565
- : "use-credentials" === importMap.crossOrigin
1570
+ : "use-credentials" === bootstrapScripts.crossOrigin
1566
1571
  ? "use-credentials"
1567
1572
  : "")),
1568
1573
  preloadBootstrapScriptOrModule(
1569
1574
  resumableState,
1570
1575
  onHeaders,
1571
- maxHeadersLength,
1572
- bootstrapScriptContent
1576
+ importMap,
1577
+ nonceStyle
1573
1578
  ),
1574
- externalRuntimeConfig.push(
1579
+ bootstrapChunks.push(
1575
1580
  '<script type="module" src="',
1576
- escapeTextForBrowser(maxHeadersLength),
1581
+ escapeTextForBrowser(importMap),
1577
1582
  attributeEnd
1578
1583
  ),
1579
- nonce &&
1580
- externalRuntimeConfig.push(
1584
+ externalRuntimeConfig &&
1585
+ bootstrapChunks.push(
1581
1586
  ' nonce="',
1582
- escapeTextForBrowser(nonce),
1587
+ escapeTextForBrowser(externalRuntimeConfig),
1583
1588
  attributeEnd
1584
1589
  ),
1585
- "string" === typeof idPrefix &&
1586
- externalRuntimeConfig.push(
1590
+ "string" === typeof inlineScriptWithNonce &&
1591
+ bootstrapChunks.push(
1587
1592
  ' integrity="',
1588
- escapeTextForBrowser(idPrefix),
1593
+ escapeTextForBrowser(inlineScriptWithNonce),
1589
1594
  attributeEnd
1590
1595
  ),
1591
- "string" === typeof inlineScriptWithNonce &&
1592
- externalRuntimeConfig.push(
1596
+ "string" === typeof maxHeadersLength &&
1597
+ bootstrapChunks.push(
1593
1598
  ' crossorigin="',
1594
- escapeTextForBrowser(inlineScriptWithNonce),
1599
+ escapeTextForBrowser(maxHeadersLength),
1595
1600
  attributeEnd
1596
1601
  ),
1597
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
1598
- externalRuntimeConfig.push(' async="">\x3c/script>');
1602
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1603
+ bootstrapChunks.push(' async="">\x3c/script>');
1599
1604
  return onHeaders;
1600
1605
  }
1601
1606
  function createResumableState(
@@ -3323,7 +3328,8 @@ function pushStartInstance(
3323
3328
  );
3324
3329
  }
3325
3330
  var precedence$jscomp$0 = props.precedence,
3326
- href$jscomp$0 = props.href;
3331
+ href$jscomp$0 = props.href,
3332
+ nonce = props.nonce;
3327
3333
  if (
3328
3334
  formatContext.insertionMode === SVG_MODE ||
3329
3335
  noscriptTagInScope$jscomp$2 ||
@@ -3388,44 +3394,59 @@ function pushStartInstance(
3388
3394
  'React encountered a hoistable style tag for the same href as a preload: "%s". When using a style tag to inline styles you should not also preload it as a stylsheet.',
3389
3395
  href$jscomp$0
3390
3396
  );
3391
- styleQueue$jscomp$0
3392
- ? styleQueue$jscomp$0.hrefs.push(
3393
- escapeTextForBrowser(href$jscomp$0)
3394
- )
3395
- : ((styleQueue$jscomp$0 = {
3396
- precedence: escapeTextForBrowser(precedence$jscomp$0),
3397
- rules: [],
3398
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
3399
- sheets: new Map()
3400
- }),
3401
- renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
3402
- var target = styleQueue$jscomp$0.rules,
3403
- children$jscomp$9 = null,
3404
- innerHTML$jscomp$6 = null,
3405
- propKey$jscomp$9;
3406
- for (propKey$jscomp$9 in props)
3407
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
3408
- var propValue$jscomp$9 = props[propKey$jscomp$9];
3409
- if (null != propValue$jscomp$9)
3410
- switch (propKey$jscomp$9) {
3411
- case "children":
3412
- children$jscomp$9 = propValue$jscomp$9;
3413
- break;
3414
- case "dangerouslySetInnerHTML":
3415
- innerHTML$jscomp$6 = propValue$jscomp$9;
3416
- }
3417
- }
3418
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
3419
- ? 2 > children$jscomp$9.length
3420
- ? children$jscomp$9[0]
3421
- : null
3422
- : children$jscomp$9;
3423
- "function" !== typeof child$jscomp$2 &&
3424
- "symbol" !== typeof child$jscomp$2 &&
3425
- null !== child$jscomp$2 &&
3426
- void 0 !== child$jscomp$2 &&
3427
- target.push(escapeStyleTextContent(child$jscomp$2));
3428
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
3397
+ styleQueue$jscomp$0 ||
3398
+ ((styleQueue$jscomp$0 = {
3399
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
3400
+ rules: [],
3401
+ hrefs: [],
3402
+ sheets: new Map()
3403
+ }),
3404
+ renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
3405
+ var nonceStyle = renderState.nonce.style;
3406
+ if (nonceStyle && nonceStyle !== nonce)
3407
+ console.error(
3408
+ 'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include rules if the nonce matches the style nonce "%s" that was included with this render.',
3409
+ precedence$jscomp$0,
3410
+ nonce,
3411
+ nonceStyle
3412
+ );
3413
+ else {
3414
+ !nonceStyle &&
3415
+ nonce &&
3416
+ console.error(
3417
+ 'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include a nonce attributes if you also provide the same style nonce value as a render option.',
3418
+ precedence$jscomp$0,
3419
+ nonce
3420
+ );
3421
+ styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
3422
+ var target = styleQueue$jscomp$0.rules,
3423
+ children$jscomp$9 = null,
3424
+ innerHTML$jscomp$6 = null,
3425
+ propKey$jscomp$9;
3426
+ for (propKey$jscomp$9 in props)
3427
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
3428
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
3429
+ if (null != propValue$jscomp$9)
3430
+ switch (propKey$jscomp$9) {
3431
+ case "children":
3432
+ children$jscomp$9 = propValue$jscomp$9;
3433
+ break;
3434
+ case "dangerouslySetInnerHTML":
3435
+ innerHTML$jscomp$6 = propValue$jscomp$9;
3436
+ }
3437
+ }
3438
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
3439
+ ? 2 > children$jscomp$9.length
3440
+ ? children$jscomp$9[0]
3441
+ : null
3442
+ : children$jscomp$9;
3443
+ "function" !== typeof child$jscomp$2 &&
3444
+ "symbol" !== typeof child$jscomp$2 &&
3445
+ null !== child$jscomp$2 &&
3446
+ void 0 !== child$jscomp$2 &&
3447
+ target.push(escapeStyleTextContent(child$jscomp$2));
3448
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
3449
+ }
3429
3450
  }
3430
3451
  styleQueue$jscomp$0 &&
3431
3452
  hoistableState &&
@@ -3949,7 +3970,7 @@ function escapeJSObjectForInstructionScripts(input) {
3949
3970
  }
3950
3971
  );
3951
3972
  }
3952
- var lateStyleTagResourceOpen1 = '<style media="not all" data-precedence="',
3973
+ var lateStyleTagResourceOpen1 = ' media="not all" data-precedence="',
3953
3974
  lateStyleTagResourceOpen2 = '" data-href="',
3954
3975
  lateStyleTagResourceOpen3 = '">',
3955
3976
  lateStyleTagTemplateClose = "</style>",
@@ -3965,6 +3986,7 @@ function flushStyleTagsLateForBoundary(styleQueue) {
3965
3986
  );
3966
3987
  var i = 0;
3967
3988
  if (hrefs.length) {
3989
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3968
3990
  writeChunk(this, lateStyleTagResourceOpen1);
3969
3991
  writeChunk(this, styleQueue.precedence);
3970
3992
  for (writeChunk(this, lateStyleTagResourceOpen2); i < hrefs.length - 1; i++)
@@ -3986,7 +4008,9 @@ function hasStylesToHoist(stylesheet) {
3986
4008
  function writeHoistablesForBoundary(destination, hoistableState, renderState) {
3987
4009
  currentlyRenderingBoundaryHasStylesToHoist = !1;
3988
4010
  destinationHasCapacity = !0;
4011
+ currentlyFlushingRenderState = renderState;
3989
4012
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
4013
+ currentlyFlushingRenderState = null;
3990
4014
  hoistableState.stylesheets.forEach(hasStylesToHoist);
3991
4015
  currentlyRenderingBoundaryHasStylesToHoist &&
3992
4016
  (renderState.stylesToHoist = !0);
@@ -4004,7 +4028,7 @@ function flushStyleInPreamble(stylesheet) {
4004
4028
  stylesheetFlushingQueue.length = 0;
4005
4029
  stylesheet.state = PREAMBLE;
4006
4030
  }
4007
- var styleTagResourceOpen1 = '<style data-precedence="',
4031
+ var styleTagResourceOpen1 = ' data-precedence="',
4008
4032
  styleTagResourceOpen2 = '" data-href="',
4009
4033
  spaceSeparator = " ",
4010
4034
  styleTagResourceOpen3 = '">',
@@ -4016,6 +4040,7 @@ function flushStylesInPreamble(styleQueue) {
4016
4040
  var rules = styleQueue.rules,
4017
4041
  hrefs = styleQueue.hrefs;
4018
4042
  if (!hasStylesheets || hrefs.length) {
4043
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
4019
4044
  writeChunk(this, styleTagResourceOpen1);
4020
4045
  writeChunk(this, styleQueue.precedence);
4021
4046
  styleQueue = 0;
@@ -8895,7 +8920,9 @@ function flushCompletedQueues(request, destination) {
8895
8920
  renderState.fontPreloads.clear();
8896
8921
  renderState.highImagePreloads.forEach(flushResource, destination);
8897
8922
  renderState.highImagePreloads.clear();
8923
+ currentlyFlushingRenderState = renderState;
8898
8924
  renderState.styles.forEach(flushStylesInPreamble, destination);
8925
+ currentlyFlushingRenderState = null;
8899
8926
  var importMapChunks = renderState.importMapChunks;
8900
8927
  for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
8901
8928
  writeChunk(destination, importMapChunks[i$jscomp$0]);
@@ -9221,15 +9248,15 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) {
9221
9248
  parentNode[2].push(node);
9222
9249
  }
9223
9250
  }
9224
- var isomorphicReactPackageVersion$jscomp$inline_759 = React.version;
9251
+ var isomorphicReactPackageVersion$jscomp$inline_761 = React.version;
9225
9252
  if (
9226
- "19.2.0-canary-b07717d8-20250528" !==
9227
- isomorphicReactPackageVersion$jscomp$inline_759
9253
+ "19.2.0-canary-14094f80-20250529" !==
9254
+ isomorphicReactPackageVersion$jscomp$inline_761
9228
9255
  )
9229
9256
  throw Error(
9230
9257
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
9231
- (isomorphicReactPackageVersion$jscomp$inline_759 +
9232
- "\n - react-dom: 19.2.0-canary-b07717d8-20250528\nLearn more: https://react.dev/warnings/version-mismatch")
9258
+ (isomorphicReactPackageVersion$jscomp$inline_761 +
9259
+ "\n - react-dom: 19.2.0-canary-14094f80-20250529\nLearn more: https://react.dev/warnings/version-mismatch")
9233
9260
  );
9234
9261
  exports.renderToReadableStream = function (children, options) {
9235
9262
  return new Promise(function (resolve, reject) {
@@ -9322,4 +9349,4 @@ exports.renderToReadableStream = function (children, options) {
9322
9349
  startWork(request$jscomp$0);
9323
9350
  });
9324
9351
  };
9325
- exports.version = "19.2.0-canary-b07717d8-20250528";
9352
+ exports.version = "19.2.0-canary-14094f80-20250529";