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.
@@ -815,21 +815,32 @@
815
815
  onHeaders,
816
816
  maxHeadersLength
817
817
  ) {
818
+ externalRuntimeConfig =
819
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
818
820
  var inlineScriptWithNonce =
819
- void 0 === nonce
821
+ void 0 === externalRuntimeConfig
820
822
  ? startInlineScript
821
823
  : stringToPrecomputedChunk(
822
- '<script nonce="' + escapeTextForBrowser(nonce) + '"'
824
+ '<script nonce="' +
825
+ escapeTextForBrowser(externalRuntimeConfig) +
826
+ '"'
823
827
  ),
824
- idPrefix = resumableState.idPrefix;
825
- externalRuntimeConfig = [];
826
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
828
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
829
+ inlineStyleWithNonce =
830
+ void 0 === nonceStyle
831
+ ? startInlineStyle
832
+ : stringToPrecomputedChunk(
833
+ '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"'
834
+ ),
835
+ idPrefix = resumableState.idPrefix,
836
+ bootstrapChunks = [],
837
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
827
838
  bootstrapScripts = resumableState.bootstrapScripts,
828
839
  bootstrapModules = resumableState.bootstrapModules;
829
840
  void 0 !== bootstrapScriptContent &&
830
- (externalRuntimeConfig.push(inlineScriptWithNonce),
831
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
832
- externalRuntimeConfig.push(
841
+ (bootstrapChunks.push(inlineScriptWithNonce),
842
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
843
+ bootstrapChunks.push(
833
844
  endOfStartTag,
834
845
  stringToChunk(
835
846
  escapeEntireInlineScriptContent(bootstrapScriptContent)
@@ -867,9 +878,10 @@
867
878
  segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"),
868
879
  boundaryPrefix: stringToPrecomputedChunk(idPrefix + "B:"),
869
880
  startInlineScript: inlineScriptWithNonce,
881
+ startInlineStyle: inlineStyleWithNonce,
870
882
  preamble: createPreambleState(),
871
883
  externalRuntimeScript: null,
872
- bootstrapChunks: externalRuntimeConfig,
884
+ bootstrapChunks: bootstrapChunks,
873
885
  importMapChunks: bootstrapScriptContent,
874
886
  onHeaders: onHeaders,
875
887
  headers: importMap,
@@ -896,127 +908,119 @@
896
908
  scripts: new Map(),
897
909
  moduleScripts: new Map()
898
910
  },
899
- nonce: nonce,
911
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
900
912
  hoistableState: null,
901
913
  stylesToHoist: !1
902
914
  };
903
915
  if (void 0 !== bootstrapScripts)
904
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
905
- maxHeadersLength = bootstrapScripts[importMap];
906
- bootstrapScriptContent = idPrefix = void 0;
907
- var props = {
908
- rel: "preload",
909
- as: "script",
910
- fetchPriority: "low",
911
- nonce: nonce
912
- };
913
- "string" === typeof maxHeadersLength
914
- ? (props.href = inlineScriptWithNonce = maxHeadersLength)
915
- : ((props.href = inlineScriptWithNonce = maxHeadersLength.src),
916
- (props.integrity = bootstrapScriptContent =
917
- "string" === typeof maxHeadersLength.integrity
918
- ? maxHeadersLength.integrity
919
- : void 0),
920
- (props.crossOrigin = idPrefix =
921
- "string" === typeof maxHeadersLength ||
922
- null == maxHeadersLength.crossOrigin
923
- ? void 0
924
- : "use-credentials" === maxHeadersLength.crossOrigin
925
- ? "use-credentials"
926
- : ""));
927
- preloadBootstrapScriptOrModule(
928
- resumableState,
929
- onHeaders,
930
- inlineScriptWithNonce,
931
- props
932
- );
933
- externalRuntimeConfig.push(
934
- startScriptSrc,
935
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
936
- attributeEnd
937
- );
938
- nonce &&
939
- externalRuntimeConfig.push(
940
- scriptNonce,
941
- stringToChunk(escapeTextForBrowser(nonce)),
942
- attributeEnd
943
- );
944
- "string" === typeof bootstrapScriptContent &&
945
- externalRuntimeConfig.push(
946
- scriptIntegirty,
947
- stringToChunk(escapeTextForBrowser(bootstrapScriptContent)),
948
- attributeEnd
949
- );
950
- "string" === typeof idPrefix &&
951
- externalRuntimeConfig.push(
952
- scriptCrossOrigin,
953
- stringToChunk(escapeTextForBrowser(idPrefix)),
916
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
917
+ (maxHeadersLength = bootstrapScripts[importMap]),
918
+ (inlineStyleWithNonce = nonceStyle = void 0),
919
+ (idPrefix = {
920
+ rel: "preload",
921
+ as: "script",
922
+ fetchPriority: "low",
923
+ nonce: nonce
924
+ }),
925
+ "string" === typeof maxHeadersLength
926
+ ? (idPrefix.href = inlineScriptWithNonce = maxHeadersLength)
927
+ : ((idPrefix.href = inlineScriptWithNonce = maxHeadersLength.src),
928
+ (idPrefix.integrity = inlineStyleWithNonce =
929
+ "string" === typeof maxHeadersLength.integrity
930
+ ? maxHeadersLength.integrity
931
+ : void 0),
932
+ (idPrefix.crossOrigin = nonceStyle =
933
+ "string" === typeof maxHeadersLength ||
934
+ null == maxHeadersLength.crossOrigin
935
+ ? void 0
936
+ : "use-credentials" === maxHeadersLength.crossOrigin
937
+ ? "use-credentials"
938
+ : "")),
939
+ preloadBootstrapScriptOrModule(
940
+ resumableState,
941
+ onHeaders,
942
+ inlineScriptWithNonce,
943
+ idPrefix
944
+ ),
945
+ bootstrapChunks.push(
946
+ startScriptSrc,
947
+ stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
954
948
  attributeEnd
955
- );
956
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState);
957
- externalRuntimeConfig.push(endAsyncScript);
958
- }
949
+ ),
950
+ externalRuntimeConfig &&
951
+ bootstrapChunks.push(
952
+ scriptNonce,
953
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
954
+ attributeEnd
955
+ ),
956
+ "string" === typeof inlineStyleWithNonce &&
957
+ bootstrapChunks.push(
958
+ scriptIntegirty,
959
+ stringToChunk(escapeTextForBrowser(inlineStyleWithNonce)),
960
+ attributeEnd
961
+ ),
962
+ "string" === typeof nonceStyle &&
963
+ bootstrapChunks.push(
964
+ scriptCrossOrigin,
965
+ stringToChunk(escapeTextForBrowser(nonceStyle)),
966
+ attributeEnd
967
+ ),
968
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
969
+ bootstrapChunks.push(endAsyncScript);
959
970
  if (void 0 !== bootstrapModules)
960
- for (
961
- bootstrapScripts = 0;
962
- bootstrapScripts < bootstrapModules.length;
963
- bootstrapScripts++
964
- )
965
- (importMap = bootstrapModules[bootstrapScripts]),
966
- (idPrefix = inlineScriptWithNonce = void 0),
967
- (bootstrapScriptContent = {
971
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
972
+ (bootstrapScripts = bootstrapModules[nonce]),
973
+ (inlineScriptWithNonce = maxHeadersLength = void 0),
974
+ (nonceStyle = {
968
975
  rel: "modulepreload",
969
976
  fetchPriority: "low",
970
- nonce: nonce
977
+ nonce: externalRuntimeConfig
971
978
  }),
972
- "string" === typeof importMap
973
- ? (bootstrapScriptContent.href = maxHeadersLength = importMap)
974
- : ((bootstrapScriptContent.href = maxHeadersLength =
975
- importMap.src),
976
- (bootstrapScriptContent.integrity = idPrefix =
977
- "string" === typeof importMap.integrity
978
- ? importMap.integrity
979
+ "string" === typeof bootstrapScripts
980
+ ? (nonceStyle.href = importMap = bootstrapScripts)
981
+ : ((nonceStyle.href = importMap = bootstrapScripts.src),
982
+ (nonceStyle.integrity = inlineScriptWithNonce =
983
+ "string" === typeof bootstrapScripts.integrity
984
+ ? bootstrapScripts.integrity
979
985
  : void 0),
980
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
981
- "string" === typeof importMap || null == importMap.crossOrigin
986
+ (nonceStyle.crossOrigin = maxHeadersLength =
987
+ "string" === typeof bootstrapScripts ||
988
+ null == bootstrapScripts.crossOrigin
982
989
  ? void 0
983
- : "use-credentials" === importMap.crossOrigin
990
+ : "use-credentials" === bootstrapScripts.crossOrigin
984
991
  ? "use-credentials"
985
992
  : "")),
986
993
  preloadBootstrapScriptOrModule(
987
994
  resumableState,
988
995
  onHeaders,
989
- maxHeadersLength,
990
- bootstrapScriptContent
996
+ importMap,
997
+ nonceStyle
991
998
  ),
992
- externalRuntimeConfig.push(
999
+ bootstrapChunks.push(
993
1000
  startModuleSrc,
994
- stringToChunk(escapeTextForBrowser(maxHeadersLength)),
1001
+ stringToChunk(escapeTextForBrowser(importMap)),
995
1002
  attributeEnd
996
1003
  ),
997
- nonce &&
998
- externalRuntimeConfig.push(
1004
+ externalRuntimeConfig &&
1005
+ bootstrapChunks.push(
999
1006
  scriptNonce,
1000
- stringToChunk(escapeTextForBrowser(nonce)),
1007
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
1001
1008
  attributeEnd
1002
1009
  ),
1003
- "string" === typeof idPrefix &&
1004
- externalRuntimeConfig.push(
1010
+ "string" === typeof inlineScriptWithNonce &&
1011
+ bootstrapChunks.push(
1005
1012
  scriptIntegirty,
1006
- stringToChunk(escapeTextForBrowser(idPrefix)),
1013
+ stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
1007
1014
  attributeEnd
1008
1015
  ),
1009
- "string" === typeof inlineScriptWithNonce &&
1010
- externalRuntimeConfig.push(
1016
+ "string" === typeof maxHeadersLength &&
1017
+ bootstrapChunks.push(
1011
1018
  scriptCrossOrigin,
1012
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
1019
+ stringToChunk(escapeTextForBrowser(maxHeadersLength)),
1013
1020
  attributeEnd
1014
1021
  ),
1015
- pushCompletedShellIdAttribute(
1016
- externalRuntimeConfig,
1017
- resumableState
1018
- ),
1019
- externalRuntimeConfig.push(endAsyncScript);
1022
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1023
+ bootstrapChunks.push(endAsyncScript);
1020
1024
  return onHeaders;
1021
1025
  }
1022
1026
  function createResumableState(
@@ -2764,7 +2768,8 @@
2764
2768
  );
2765
2769
  }
2766
2770
  var precedence$jscomp$0 = props.precedence,
2767
- href$jscomp$0 = props.href;
2771
+ href$jscomp$0 = props.href,
2772
+ nonce = props.nonce;
2768
2773
  if (
2769
2774
  formatContext.insertionMode === SVG_MODE ||
2770
2775
  noscriptTagInScope$jscomp$2 ||
@@ -2835,51 +2840,68 @@
2835
2840
  '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.',
2836
2841
  href$jscomp$0
2837
2842
  );
2838
- styleQueue$jscomp$0
2839
- ? styleQueue$jscomp$0.hrefs.push(
2840
- stringToChunk(escapeTextForBrowser(href$jscomp$0))
2841
- )
2842
- : ((styleQueue$jscomp$0 = {
2843
- precedence: stringToChunk(
2844
- escapeTextForBrowser(precedence$jscomp$0)
2845
- ),
2846
- rules: [],
2847
- hrefs: [stringToChunk(escapeTextForBrowser(href$jscomp$0))],
2848
- sheets: new Map()
2849
- }),
2850
- renderState.styles.set(
2843
+ styleQueue$jscomp$0 ||
2844
+ ((styleQueue$jscomp$0 = {
2845
+ precedence: stringToChunk(
2846
+ escapeTextForBrowser(precedence$jscomp$0)
2847
+ ),
2848
+ rules: [],
2849
+ hrefs: [],
2850
+ sheets: new Map()
2851
+ }),
2852
+ renderState.styles.set(
2853
+ precedence$jscomp$0,
2854
+ styleQueue$jscomp$0
2855
+ ));
2856
+ var nonceStyle = renderState.nonce.style;
2857
+ if (nonceStyle && nonceStyle !== nonce)
2858
+ console.error(
2859
+ '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.',
2860
+ precedence$jscomp$0,
2861
+ nonce,
2862
+ nonceStyle
2863
+ );
2864
+ else {
2865
+ !nonceStyle &&
2866
+ nonce &&
2867
+ console.error(
2868
+ '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.',
2851
2869
  precedence$jscomp$0,
2852
- styleQueue$jscomp$0
2853
- ));
2854
- var target = styleQueue$jscomp$0.rules,
2855
- children$jscomp$9 = null,
2856
- innerHTML$jscomp$6 = null,
2857
- propKey$jscomp$9;
2858
- for (propKey$jscomp$9 in props)
2859
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2860
- var propValue$jscomp$9 = props[propKey$jscomp$9];
2861
- if (null != propValue$jscomp$9)
2862
- switch (propKey$jscomp$9) {
2863
- case "children":
2864
- children$jscomp$9 = propValue$jscomp$9;
2865
- break;
2866
- case "dangerouslySetInnerHTML":
2867
- innerHTML$jscomp$6 = propValue$jscomp$9;
2868
- }
2869
- }
2870
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
2871
- ? 2 > children$jscomp$9.length
2872
- ? children$jscomp$9[0]
2873
- : null
2874
- : children$jscomp$9;
2875
- "function" !== typeof child$jscomp$2 &&
2876
- "symbol" !== typeof child$jscomp$2 &&
2877
- null !== child$jscomp$2 &&
2878
- void 0 !== child$jscomp$2 &&
2879
- target.push(
2880
- stringToChunk(escapeStyleTextContent(child$jscomp$2))
2870
+ nonce
2871
+ );
2872
+ styleQueue$jscomp$0.hrefs.push(
2873
+ stringToChunk(escapeTextForBrowser(href$jscomp$0))
2881
2874
  );
2882
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2875
+ var target = styleQueue$jscomp$0.rules,
2876
+ children$jscomp$9 = null,
2877
+ innerHTML$jscomp$6 = null,
2878
+ propKey$jscomp$9;
2879
+ for (propKey$jscomp$9 in props)
2880
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2881
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
2882
+ if (null != propValue$jscomp$9)
2883
+ switch (propKey$jscomp$9) {
2884
+ case "children":
2885
+ children$jscomp$9 = propValue$jscomp$9;
2886
+ break;
2887
+ case "dangerouslySetInnerHTML":
2888
+ innerHTML$jscomp$6 = propValue$jscomp$9;
2889
+ }
2890
+ }
2891
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
2892
+ ? 2 > children$jscomp$9.length
2893
+ ? children$jscomp$9[0]
2894
+ : null
2895
+ : children$jscomp$9;
2896
+ "function" !== typeof child$jscomp$2 &&
2897
+ "symbol" !== typeof child$jscomp$2 &&
2898
+ null !== child$jscomp$2 &&
2899
+ void 0 !== child$jscomp$2 &&
2900
+ target.push(
2901
+ stringToChunk(escapeStyleTextContent(child$jscomp$2))
2902
+ );
2903
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2904
+ }
2883
2905
  }
2884
2906
  styleQueue$jscomp$0 &&
2885
2907
  hoistableState &&
@@ -3371,6 +3393,7 @@
3371
3393
  );
3372
3394
  var i = 0;
3373
3395
  if (hrefs.length) {
3396
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3374
3397
  writeChunk(this, lateStyleTagResourceOpen1);
3375
3398
  writeChunk(this, styleQueue.precedence);
3376
3399
  for (
@@ -3403,7 +3426,9 @@
3403
3426
  ) {
3404
3427
  currentlyRenderingBoundaryHasStylesToHoist = !1;
3405
3428
  destinationHasCapacity = !0;
3429
+ currentlyFlushingRenderState = renderState;
3406
3430
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
3431
+ currentlyFlushingRenderState = null;
3407
3432
  hoistableState.stylesheets.forEach(hasStylesToHoist);
3408
3433
  currentlyRenderingBoundaryHasStylesToHoist &&
3409
3434
  (renderState.stylesToHoist = !0);
@@ -3427,6 +3452,7 @@
3427
3452
  var rules = styleQueue.rules,
3428
3453
  hrefs = styleQueue.hrefs;
3429
3454
  if (!hasStylesheets || hrefs.length) {
3455
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3430
3456
  writeChunk(this, styleTagResourceOpen1);
3431
3457
  writeChunk(this, styleQueue.precedence);
3432
3458
  styleQueue = 0;
@@ -7960,7 +7986,9 @@
7960
7986
  renderState.fontPreloads.clear();
7961
7987
  renderState.highImagePreloads.forEach(flushResource, destination);
7962
7988
  renderState.highImagePreloads.clear();
7989
+ currentlyFlushingRenderState = renderState;
7963
7990
  renderState.styles.forEach(flushStylesInPreamble, destination);
7991
+ currentlyFlushingRenderState = null;
7964
7992
  var importMapChunks = renderState.importMapChunks;
7965
7993
  for (
7966
7994
  i$jscomp$0 = 0;
@@ -8348,11 +8376,11 @@
8348
8376
  }
8349
8377
  function ensureCorrectIsomorphicReactVersion() {
8350
8378
  var isomorphicReactPackageVersion = React.version;
8351
- if ("19.2.0-canary-b07717d8-20250528" !== isomorphicReactPackageVersion)
8379
+ if ("19.2.0-canary-14094f80-20250529" !== isomorphicReactPackageVersion)
8352
8380
  throw Error(
8353
8381
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
8354
8382
  (isomorphicReactPackageVersion +
8355
- "\n - react-dom: 19.2.0-canary-b07717d8-20250528\nLearn more: https://react.dev/warnings/version-mismatch")
8383
+ "\n - react-dom: 19.2.0-canary-14094f80-20250529\nLearn more: https://react.dev/warnings/version-mismatch")
8356
8384
  );
8357
8385
  }
8358
8386
  var React = require("react"),
@@ -9446,6 +9474,7 @@
9446
9474
  EXISTS = null,
9447
9475
  PRELOAD_NO_CREDS = [];
9448
9476
  Object.freeze(PRELOAD_NO_CREDS);
9477
+ var currentlyFlushingRenderState = null;
9449
9478
  stringToPrecomputedChunk('"></template>');
9450
9479
  var startInlineScript = stringToPrecomputedChunk("<script"),
9451
9480
  endInlineScript = stringToPrecomputedChunk("\x3c/script>"),
@@ -9455,6 +9484,7 @@
9455
9484
  scriptIntegirty = stringToPrecomputedChunk(' integrity="'),
9456
9485
  scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin="'),
9457
9486
  endAsyncScript = stringToPrecomputedChunk(' async="">\x3c/script>'),
9487
+ startInlineStyle = stringToPrecomputedChunk("<style"),
9458
9488
  scriptRegex = /(<\/|<)(s)(cript)/gi,
9459
9489
  importMapScriptStart = stringToPrecomputedChunk(
9460
9490
  '<script type="importmap">'
@@ -9622,7 +9652,7 @@
9622
9652
  var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g,
9623
9653
  regexForJSStringsInScripts = /[&><\u2028\u2029]/g,
9624
9654
  lateStyleTagResourceOpen1 = stringToPrecomputedChunk(
9625
- '<style media="not all" data-precedence="'
9655
+ ' media="not all" data-precedence="'
9626
9656
  ),
9627
9657
  lateStyleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9628
9658
  lateStyleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -9630,9 +9660,7 @@
9630
9660
  currentlyRenderingBoundaryHasStylesToHoist = !1,
9631
9661
  destinationHasCapacity = !0,
9632
9662
  stylesheetFlushingQueue = [],
9633
- styleTagResourceOpen1 = stringToPrecomputedChunk(
9634
- '<style data-precedence="'
9635
- ),
9663
+ styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence="'),
9636
9664
  styleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9637
9665
  spaceSeparator = stringToPrecomputedChunk(" "),
9638
9666
  styleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -10039,5 +10067,5 @@
10039
10067
  startWork(request);
10040
10068
  });
10041
10069
  };
10042
- exports.version = "19.2.0-canary-b07717d8-20250528";
10070
+ exports.version = "19.2.0-canary-14094f80-20250529";
10043
10071
  })();