react-dom 19.2.0-canary-b07717d8-20250528 → 19.2.0-canary-526dd340-20250602

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.
@@ -228,6 +228,7 @@ ReactDOMSharedInternals.d = {
228
228
  M: preinitModuleScript
229
229
  };
230
230
  var PRELOAD_NO_CREDS = [],
231
+ currentlyFlushingRenderState = null,
231
232
  scriptRegex = /(<\/|<)(s)(cript)/gi;
232
233
  function scriptReplacer(match, prefix, s, suffix) {
233
234
  return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix;
@@ -240,19 +241,26 @@ function createRenderState(
240
241
  onHeaders,
241
242
  maxHeadersLength
242
243
  ) {
244
+ externalRuntimeConfig =
245
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
243
246
  var inlineScriptWithNonce =
244
- void 0 === nonce
247
+ void 0 === externalRuntimeConfig
245
248
  ? "<script"
246
- : '<script nonce="' + escapeTextForBrowser(nonce) + '"',
247
- idPrefix = resumableState.idPrefix;
248
- externalRuntimeConfig = [];
249
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
249
+ : '<script nonce="' + escapeTextForBrowser(externalRuntimeConfig) + '"',
250
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
251
+ inlineStyleWithNonce =
252
+ void 0 === nonceStyle
253
+ ? "<style"
254
+ : '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"',
255
+ idPrefix = resumableState.idPrefix,
256
+ bootstrapChunks = [],
257
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
250
258
  bootstrapScripts = resumableState.bootstrapScripts,
251
259
  bootstrapModules = resumableState.bootstrapModules;
252
260
  void 0 !== bootstrapScriptContent &&
253
- (externalRuntimeConfig.push(inlineScriptWithNonce),
254
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
255
- externalRuntimeConfig.push(
261
+ (bootstrapChunks.push(inlineScriptWithNonce),
262
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
263
+ bootstrapChunks.push(
256
264
  ">",
257
265
  ("" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer),
258
266
  "\x3c/script>"
@@ -278,9 +286,10 @@ function createRenderState(
278
286
  segmentPrefix: idPrefix + "S:",
279
287
  boundaryPrefix: idPrefix + "B:",
280
288
  startInlineScript: inlineScriptWithNonce,
289
+ startInlineStyle: inlineStyleWithNonce,
281
290
  preamble: createPreambleState(),
282
291
  externalRuntimeScript: null,
283
- bootstrapChunks: externalRuntimeConfig,
292
+ bootstrapChunks: bootstrapChunks,
284
293
  importMapChunks: bootstrapScriptContent,
285
294
  onHeaders: onHeaders,
286
295
  headers: importMap,
@@ -307,125 +316,119 @@ function createRenderState(
307
316
  scripts: new Map(),
308
317
  moduleScripts: new Map()
309
318
  },
310
- nonce: nonce,
319
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
311
320
  hoistableState: null,
312
321
  stylesToHoist: !1
313
322
  };
314
323
  if (void 0 !== bootstrapScripts)
315
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
316
- var scriptConfig = bootstrapScripts[importMap];
317
- idPrefix = inlineScriptWithNonce = void 0;
318
- bootstrapScriptContent = {
319
- rel: "preload",
320
- as: "script",
321
- fetchPriority: "low",
322
- nonce: nonce
323
- };
324
- "string" === typeof scriptConfig
325
- ? (bootstrapScriptContent.href = maxHeadersLength = scriptConfig)
326
- : ((bootstrapScriptContent.href = maxHeadersLength = scriptConfig.src),
327
- (bootstrapScriptContent.integrity = idPrefix =
328
- "string" === typeof scriptConfig.integrity
329
- ? scriptConfig.integrity
330
- : void 0),
331
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
332
- "string" === typeof scriptConfig || null == scriptConfig.crossOrigin
333
- ? void 0
334
- : "use-credentials" === scriptConfig.crossOrigin
335
- ? "use-credentials"
336
- : ""));
337
- scriptConfig = resumableState;
338
- var href = maxHeadersLength;
339
- scriptConfig.scriptResources[href] = null;
340
- scriptConfig.moduleScriptResources[href] = null;
341
- scriptConfig = [];
342
- pushLinkImpl(scriptConfig, bootstrapScriptContent);
343
- onHeaders.bootstrapScripts.add(scriptConfig);
344
- externalRuntimeConfig.push(
345
- '<script src="',
346
- escapeTextForBrowser(maxHeadersLength),
347
- '"'
348
- );
349
- nonce &&
350
- externalRuntimeConfig.push(
351
- ' nonce="',
352
- escapeTextForBrowser(nonce),
353
- '"'
354
- );
355
- "string" === typeof idPrefix &&
356
- externalRuntimeConfig.push(
357
- ' integrity="',
358
- escapeTextForBrowser(idPrefix),
359
- '"'
360
- );
361
- "string" === typeof inlineScriptWithNonce &&
362
- externalRuntimeConfig.push(
363
- ' crossorigin="',
364
- escapeTextForBrowser(inlineScriptWithNonce),
324
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
325
+ (idPrefix = bootstrapScripts[importMap]),
326
+ (nonceStyle = inlineScriptWithNonce = void 0),
327
+ (inlineStyleWithNonce = {
328
+ rel: "preload",
329
+ as: "script",
330
+ fetchPriority: "low",
331
+ nonce: nonce
332
+ }),
333
+ "string" === typeof idPrefix
334
+ ? (inlineStyleWithNonce.href = maxHeadersLength = idPrefix)
335
+ : ((inlineStyleWithNonce.href = maxHeadersLength = idPrefix.src),
336
+ (inlineStyleWithNonce.integrity = nonceStyle =
337
+ "string" === typeof idPrefix.integrity
338
+ ? idPrefix.integrity
339
+ : void 0),
340
+ (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =
341
+ "string" === typeof idPrefix || null == idPrefix.crossOrigin
342
+ ? void 0
343
+ : "use-credentials" === idPrefix.crossOrigin
344
+ ? "use-credentials"
345
+ : "")),
346
+ (idPrefix = resumableState),
347
+ (bootstrapScriptContent = maxHeadersLength),
348
+ (idPrefix.scriptResources[bootstrapScriptContent] = null),
349
+ (idPrefix.moduleScriptResources[bootstrapScriptContent] = null),
350
+ (idPrefix = []),
351
+ pushLinkImpl(idPrefix, inlineStyleWithNonce),
352
+ onHeaders.bootstrapScripts.add(idPrefix),
353
+ bootstrapChunks.push(
354
+ '<script src="',
355
+ escapeTextForBrowser(maxHeadersLength),
365
356
  '"'
366
- );
367
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState);
368
- externalRuntimeConfig.push(' async="">\x3c/script>');
369
- }
357
+ ),
358
+ externalRuntimeConfig &&
359
+ bootstrapChunks.push(
360
+ ' nonce="',
361
+ escapeTextForBrowser(externalRuntimeConfig),
362
+ '"'
363
+ ),
364
+ "string" === typeof nonceStyle &&
365
+ bootstrapChunks.push(
366
+ ' integrity="',
367
+ escapeTextForBrowser(nonceStyle),
368
+ '"'
369
+ ),
370
+ "string" === typeof inlineScriptWithNonce &&
371
+ bootstrapChunks.push(
372
+ ' crossorigin="',
373
+ escapeTextForBrowser(inlineScriptWithNonce),
374
+ '"'
375
+ ),
376
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
377
+ bootstrapChunks.push(' async="">\x3c/script>');
370
378
  if (void 0 !== bootstrapModules)
371
- for (
372
- bootstrapScripts = 0;
373
- bootstrapScripts < bootstrapModules.length;
374
- bootstrapScripts++
375
- )
376
- (bootstrapScriptContent = bootstrapModules[bootstrapScripts]),
377
- (inlineScriptWithNonce = maxHeadersLength = void 0),
378
- (idPrefix = {
379
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
380
+ (nonceStyle = bootstrapModules[nonce]),
381
+ (maxHeadersLength = importMap = void 0),
382
+ (inlineScriptWithNonce = {
379
383
  rel: "modulepreload",
380
384
  fetchPriority: "low",
381
- nonce: nonce
385
+ nonce: externalRuntimeConfig
382
386
  }),
383
- "string" === typeof bootstrapScriptContent
384
- ? (idPrefix.href = importMap = bootstrapScriptContent)
385
- : ((idPrefix.href = importMap = bootstrapScriptContent.src),
386
- (idPrefix.integrity = inlineScriptWithNonce =
387
- "string" === typeof bootstrapScriptContent.integrity
388
- ? bootstrapScriptContent.integrity
387
+ "string" === typeof nonceStyle
388
+ ? (inlineScriptWithNonce.href = bootstrapScripts = nonceStyle)
389
+ : ((inlineScriptWithNonce.href = bootstrapScripts = nonceStyle.src),
390
+ (inlineScriptWithNonce.integrity = maxHeadersLength =
391
+ "string" === typeof nonceStyle.integrity
392
+ ? nonceStyle.integrity
389
393
  : void 0),
390
- (idPrefix.crossOrigin = maxHeadersLength =
391
- "string" === typeof bootstrapScriptContent ||
392
- null == bootstrapScriptContent.crossOrigin
394
+ (inlineScriptWithNonce.crossOrigin = importMap =
395
+ "string" === typeof nonceStyle || null == nonceStyle.crossOrigin
393
396
  ? void 0
394
- : "use-credentials" === bootstrapScriptContent.crossOrigin
397
+ : "use-credentials" === nonceStyle.crossOrigin
395
398
  ? "use-credentials"
396
399
  : "")),
397
- (bootstrapScriptContent = resumableState),
398
- (scriptConfig = importMap),
399
- (bootstrapScriptContent.scriptResources[scriptConfig] = null),
400
- (bootstrapScriptContent.moduleScriptResources[scriptConfig] = null),
401
- (bootstrapScriptContent = []),
402
- pushLinkImpl(bootstrapScriptContent, idPrefix),
403
- onHeaders.bootstrapScripts.add(bootstrapScriptContent),
404
- externalRuntimeConfig.push(
400
+ (nonceStyle = resumableState),
401
+ (inlineStyleWithNonce = bootstrapScripts),
402
+ (nonceStyle.scriptResources[inlineStyleWithNonce] = null),
403
+ (nonceStyle.moduleScriptResources[inlineStyleWithNonce] = null),
404
+ (nonceStyle = []),
405
+ pushLinkImpl(nonceStyle, inlineScriptWithNonce),
406
+ onHeaders.bootstrapScripts.add(nonceStyle),
407
+ bootstrapChunks.push(
405
408
  '<script type="module" src="',
406
- escapeTextForBrowser(importMap),
409
+ escapeTextForBrowser(bootstrapScripts),
407
410
  '"'
408
411
  ),
409
- nonce &&
410
- externalRuntimeConfig.push(
412
+ externalRuntimeConfig &&
413
+ bootstrapChunks.push(
411
414
  ' nonce="',
412
- escapeTextForBrowser(nonce),
415
+ escapeTextForBrowser(externalRuntimeConfig),
413
416
  '"'
414
417
  ),
415
- "string" === typeof inlineScriptWithNonce &&
416
- externalRuntimeConfig.push(
418
+ "string" === typeof maxHeadersLength &&
419
+ bootstrapChunks.push(
417
420
  ' integrity="',
418
- escapeTextForBrowser(inlineScriptWithNonce),
421
+ escapeTextForBrowser(maxHeadersLength),
419
422
  '"'
420
423
  ),
421
- "string" === typeof maxHeadersLength &&
422
- externalRuntimeConfig.push(
424
+ "string" === typeof importMap &&
425
+ bootstrapChunks.push(
423
426
  ' crossorigin="',
424
- escapeTextForBrowser(maxHeadersLength),
427
+ escapeTextForBrowser(importMap),
425
428
  '"'
426
429
  ),
427
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
428
- externalRuntimeConfig.push(' async="">\x3c/script>');
430
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
431
+ bootstrapChunks.push(' async="">\x3c/script>');
429
432
  return onHeaders;
430
433
  }
431
434
  function createResumableState(
@@ -1695,7 +1698,8 @@ function pushStartInstance(
1695
1698
  case "style":
1696
1699
  var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,
1697
1700
  precedence$jscomp$0 = props.precedence,
1698
- href$jscomp$0 = props.href;
1701
+ href$jscomp$0 = props.href,
1702
+ nonce = props.nonce;
1699
1703
  if (
1700
1704
  4 === formatContext.insertionMode ||
1701
1705
  noscriptTagInScope$jscomp$2 ||
@@ -1750,46 +1754,47 @@ function pushStartInstance(
1750
1754
  : void 0)
1751
1755
  ) {
1752
1756
  resumableState.styleResources[href$jscomp$0] = null;
1753
- styleQueue$jscomp$0
1754
- ? styleQueue$jscomp$0.hrefs.push(
1755
- escapeTextForBrowser(href$jscomp$0)
1756
- )
1757
- : ((styleQueue$jscomp$0 = {
1758
- precedence: escapeTextForBrowser(precedence$jscomp$0),
1759
- rules: [],
1760
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
1761
- sheets: new Map()
1762
- }),
1763
- renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
1764
- var target = styleQueue$jscomp$0.rules,
1765
- children$jscomp$7 = null,
1766
- innerHTML$jscomp$6 = null,
1767
- propKey$jscomp$9;
1768
- for (propKey$jscomp$9 in props)
1769
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
1770
- var propValue$jscomp$9 = props[propKey$jscomp$9];
1771
- if (null != propValue$jscomp$9)
1772
- switch (propKey$jscomp$9) {
1773
- case "children":
1774
- children$jscomp$7 = propValue$jscomp$9;
1775
- break;
1776
- case "dangerouslySetInnerHTML":
1777
- innerHTML$jscomp$6 = propValue$jscomp$9;
1778
- }
1779
- }
1780
- var child$jscomp$0 = Array.isArray(children$jscomp$7)
1781
- ? 2 > children$jscomp$7.length
1782
- ? children$jscomp$7[0]
1783
- : null
1784
- : children$jscomp$7;
1785
- "function" !== typeof child$jscomp$0 &&
1786
- "symbol" !== typeof child$jscomp$0 &&
1787
- null !== child$jscomp$0 &&
1788
- void 0 !== child$jscomp$0 &&
1789
- target.push(
1790
- ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
1791
- );
1792
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
1757
+ styleQueue$jscomp$0 ||
1758
+ ((styleQueue$jscomp$0 = {
1759
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
1760
+ rules: [],
1761
+ hrefs: [],
1762
+ sheets: new Map()
1763
+ }),
1764
+ renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));
1765
+ var nonceStyle = renderState.nonce.style;
1766
+ if (!nonceStyle || nonceStyle === nonce) {
1767
+ styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));
1768
+ var target = styleQueue$jscomp$0.rules,
1769
+ children$jscomp$7 = null,
1770
+ innerHTML$jscomp$6 = null,
1771
+ propKey$jscomp$9;
1772
+ for (propKey$jscomp$9 in props)
1773
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
1774
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
1775
+ if (null != propValue$jscomp$9)
1776
+ switch (propKey$jscomp$9) {
1777
+ case "children":
1778
+ children$jscomp$7 = propValue$jscomp$9;
1779
+ break;
1780
+ case "dangerouslySetInnerHTML":
1781
+ innerHTML$jscomp$6 = propValue$jscomp$9;
1782
+ }
1783
+ }
1784
+ var child$jscomp$0 = Array.isArray(children$jscomp$7)
1785
+ ? 2 > children$jscomp$7.length
1786
+ ? children$jscomp$7[0]
1787
+ : null
1788
+ : children$jscomp$7;
1789
+ "function" !== typeof child$jscomp$0 &&
1790
+ "symbol" !== typeof child$jscomp$0 &&
1791
+ null !== child$jscomp$0 &&
1792
+ void 0 !== child$jscomp$0 &&
1793
+ target.push(
1794
+ ("" + child$jscomp$0).replace(styleRegex, styleReplacer)
1795
+ );
1796
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);
1797
+ }
1793
1798
  }
1794
1799
  styleQueue$jscomp$0 &&
1795
1800
  hoistableState &&
@@ -2266,7 +2271,8 @@ function flushStyleTagsLateForBoundary(styleQueue) {
2266
2271
  hrefs = styleQueue.hrefs,
2267
2272
  i = 0;
2268
2273
  if (hrefs.length) {
2269
- writeChunk(this, '<style media="not all" data-precedence="');
2274
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
2275
+ writeChunk(this, ' media="not all" data-precedence="');
2270
2276
  writeChunk(this, styleQueue.precedence);
2271
2277
  for (writeChunk(this, '" data-href="'); i < hrefs.length - 1; i++)
2272
2278
  writeChunk(this, hrefs[i]), writeChunk(this, " ");
@@ -2287,7 +2293,9 @@ function hasStylesToHoist(stylesheet) {
2287
2293
  function writeHoistablesForBoundary(destination, hoistableState, renderState) {
2288
2294
  currentlyRenderingBoundaryHasStylesToHoist = !1;
2289
2295
  destinationHasCapacity = !0;
2296
+ currentlyFlushingRenderState = renderState;
2290
2297
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
2298
+ currentlyFlushingRenderState = null;
2291
2299
  hoistableState.stylesheets.forEach(hasStylesToHoist);
2292
2300
  currentlyRenderingBoundaryHasStylesToHoist &&
2293
2301
  (renderState.stylesToHoist = !0);
@@ -2312,7 +2320,8 @@ function flushStylesInPreamble(styleQueue) {
2312
2320
  var rules = styleQueue.rules,
2313
2321
  hrefs = styleQueue.hrefs;
2314
2322
  if (!hasStylesheets || hrefs.length) {
2315
- writeChunk(this, '<style data-precedence="');
2323
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
2324
+ writeChunk(this, ' data-precedence="');
2316
2325
  writeChunk(this, styleQueue.precedence);
2317
2326
  styleQueue = 0;
2318
2327
  if (hrefs.length) {
@@ -6139,7 +6148,9 @@ function flushCompletedQueues(request, destination) {
6139
6148
  renderState.fontPreloads.clear();
6140
6149
  renderState.highImagePreloads.forEach(flushResource, destination);
6141
6150
  renderState.highImagePreloads.clear();
6151
+ currentlyFlushingRenderState = renderState;
6142
6152
  renderState.styles.forEach(flushStylesInPreamble, destination);
6153
+ currentlyFlushingRenderState = null;
6143
6154
  var importMapChunks = renderState.importMapChunks;
6144
6155
  for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)
6145
6156
  writeChunk(destination, importMapChunks[i$jscomp$0]);
@@ -6424,15 +6435,15 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) {
6424
6435
  parentNode[2].push(node);
6425
6436
  }
6426
6437
  }
6427
- var isomorphicReactPackageVersion$jscomp$inline_810 = React.version;
6438
+ var isomorphicReactPackageVersion$jscomp$inline_812 = React.version;
6428
6439
  if (
6429
- "19.2.0-canary-b07717d8-20250528" !==
6430
- isomorphicReactPackageVersion$jscomp$inline_810
6440
+ "19.2.0-canary-526dd340-20250602" !==
6441
+ isomorphicReactPackageVersion$jscomp$inline_812
6431
6442
  )
6432
6443
  throw Error(
6433
6444
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
6434
- (isomorphicReactPackageVersion$jscomp$inline_810 +
6435
- "\n - react-dom: 19.2.0-canary-b07717d8-20250528\nLearn more: https://react.dev/warnings/version-mismatch")
6445
+ (isomorphicReactPackageVersion$jscomp$inline_812 +
6446
+ "\n - react-dom: 19.2.0-canary-526dd340-20250602\nLearn more: https://react.dev/warnings/version-mismatch")
6436
6447
  );
6437
6448
  exports.renderToReadableStream = function (children, options) {
6438
6449
  return new Promise(function (resolve, reject) {
@@ -6523,4 +6534,4 @@ exports.renderToReadableStream = function (children, options) {
6523
6534
  startWork(request);
6524
6535
  });
6525
6536
  };
6526
- exports.version = "19.2.0-canary-b07717d8-20250528";
6537
+ exports.version = "19.2.0-canary-526dd340-20250602";