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.
@@ -811,21 +811,32 @@
811
811
  onHeaders,
812
812
  maxHeadersLength
813
813
  ) {
814
+ externalRuntimeConfig =
815
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
814
816
  var inlineScriptWithNonce =
815
- void 0 === nonce
817
+ void 0 === externalRuntimeConfig
816
818
  ? startInlineScript
817
819
  : stringToPrecomputedChunk(
818
- '<script nonce="' + escapeTextForBrowser(nonce) + '"'
820
+ '<script nonce="' +
821
+ escapeTextForBrowser(externalRuntimeConfig) +
822
+ '"'
819
823
  ),
820
- idPrefix = resumableState.idPrefix;
821
- externalRuntimeConfig = [];
822
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
824
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
825
+ inlineStyleWithNonce =
826
+ void 0 === nonceStyle
827
+ ? startInlineStyle
828
+ : stringToPrecomputedChunk(
829
+ '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"'
830
+ ),
831
+ idPrefix = resumableState.idPrefix,
832
+ bootstrapChunks = [],
833
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
823
834
  bootstrapScripts = resumableState.bootstrapScripts,
824
835
  bootstrapModules = resumableState.bootstrapModules;
825
836
  void 0 !== bootstrapScriptContent &&
826
- (externalRuntimeConfig.push(inlineScriptWithNonce),
827
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
828
- externalRuntimeConfig.push(
837
+ (bootstrapChunks.push(inlineScriptWithNonce),
838
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
839
+ bootstrapChunks.push(
829
840
  endOfStartTag,
830
841
  stringToChunk(
831
842
  escapeEntireInlineScriptContent(bootstrapScriptContent)
@@ -863,9 +874,10 @@
863
874
  segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"),
864
875
  boundaryPrefix: stringToPrecomputedChunk(idPrefix + "B:"),
865
876
  startInlineScript: inlineScriptWithNonce,
877
+ startInlineStyle: inlineStyleWithNonce,
866
878
  preamble: createPreambleState(),
867
879
  externalRuntimeScript: null,
868
- bootstrapChunks: externalRuntimeConfig,
880
+ bootstrapChunks: bootstrapChunks,
869
881
  importMapChunks: bootstrapScriptContent,
870
882
  onHeaders: onHeaders,
871
883
  headers: importMap,
@@ -892,127 +904,119 @@
892
904
  scripts: new Map(),
893
905
  moduleScripts: new Map()
894
906
  },
895
- nonce: nonce,
907
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
896
908
  hoistableState: null,
897
909
  stylesToHoist: !1
898
910
  };
899
911
  if (void 0 !== bootstrapScripts)
900
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
901
- maxHeadersLength = bootstrapScripts[importMap];
902
- bootstrapScriptContent = idPrefix = void 0;
903
- var props = {
904
- rel: "preload",
905
- as: "script",
906
- fetchPriority: "low",
907
- nonce: nonce
908
- };
909
- "string" === typeof maxHeadersLength
910
- ? (props.href = inlineScriptWithNonce = maxHeadersLength)
911
- : ((props.href = inlineScriptWithNonce = maxHeadersLength.src),
912
- (props.integrity = bootstrapScriptContent =
913
- "string" === typeof maxHeadersLength.integrity
914
- ? maxHeadersLength.integrity
915
- : void 0),
916
- (props.crossOrigin = idPrefix =
917
- "string" === typeof maxHeadersLength ||
918
- null == maxHeadersLength.crossOrigin
919
- ? void 0
920
- : "use-credentials" === maxHeadersLength.crossOrigin
921
- ? "use-credentials"
922
- : ""));
923
- preloadBootstrapScriptOrModule(
924
- resumableState,
925
- onHeaders,
926
- inlineScriptWithNonce,
927
- props
928
- );
929
- externalRuntimeConfig.push(
930
- startScriptSrc,
931
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
932
- attributeEnd
933
- );
934
- nonce &&
935
- externalRuntimeConfig.push(
936
- scriptNonce,
937
- stringToChunk(escapeTextForBrowser(nonce)),
938
- attributeEnd
939
- );
940
- "string" === typeof bootstrapScriptContent &&
941
- externalRuntimeConfig.push(
942
- scriptIntegirty,
943
- stringToChunk(escapeTextForBrowser(bootstrapScriptContent)),
944
- attributeEnd
945
- );
946
- "string" === typeof idPrefix &&
947
- externalRuntimeConfig.push(
948
- scriptCrossOrigin,
949
- stringToChunk(escapeTextForBrowser(idPrefix)),
912
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
913
+ (maxHeadersLength = bootstrapScripts[importMap]),
914
+ (inlineStyleWithNonce = nonceStyle = void 0),
915
+ (idPrefix = {
916
+ rel: "preload",
917
+ as: "script",
918
+ fetchPriority: "low",
919
+ nonce: nonce
920
+ }),
921
+ "string" === typeof maxHeadersLength
922
+ ? (idPrefix.href = inlineScriptWithNonce = maxHeadersLength)
923
+ : ((idPrefix.href = inlineScriptWithNonce = maxHeadersLength.src),
924
+ (idPrefix.integrity = inlineStyleWithNonce =
925
+ "string" === typeof maxHeadersLength.integrity
926
+ ? maxHeadersLength.integrity
927
+ : void 0),
928
+ (idPrefix.crossOrigin = nonceStyle =
929
+ "string" === typeof maxHeadersLength ||
930
+ null == maxHeadersLength.crossOrigin
931
+ ? void 0
932
+ : "use-credentials" === maxHeadersLength.crossOrigin
933
+ ? "use-credentials"
934
+ : "")),
935
+ preloadBootstrapScriptOrModule(
936
+ resumableState,
937
+ onHeaders,
938
+ inlineScriptWithNonce,
939
+ idPrefix
940
+ ),
941
+ bootstrapChunks.push(
942
+ startScriptSrc,
943
+ stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
950
944
  attributeEnd
951
- );
952
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState);
953
- externalRuntimeConfig.push(endAsyncScript);
954
- }
945
+ ),
946
+ externalRuntimeConfig &&
947
+ bootstrapChunks.push(
948
+ scriptNonce,
949
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
950
+ attributeEnd
951
+ ),
952
+ "string" === typeof inlineStyleWithNonce &&
953
+ bootstrapChunks.push(
954
+ scriptIntegirty,
955
+ stringToChunk(escapeTextForBrowser(inlineStyleWithNonce)),
956
+ attributeEnd
957
+ ),
958
+ "string" === typeof nonceStyle &&
959
+ bootstrapChunks.push(
960
+ scriptCrossOrigin,
961
+ stringToChunk(escapeTextForBrowser(nonceStyle)),
962
+ attributeEnd
963
+ ),
964
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
965
+ bootstrapChunks.push(endAsyncScript);
955
966
  if (void 0 !== bootstrapModules)
956
- for (
957
- bootstrapScripts = 0;
958
- bootstrapScripts < bootstrapModules.length;
959
- bootstrapScripts++
960
- )
961
- (importMap = bootstrapModules[bootstrapScripts]),
962
- (idPrefix = inlineScriptWithNonce = void 0),
963
- (bootstrapScriptContent = {
967
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
968
+ (bootstrapScripts = bootstrapModules[nonce]),
969
+ (inlineScriptWithNonce = maxHeadersLength = void 0),
970
+ (nonceStyle = {
964
971
  rel: "modulepreload",
965
972
  fetchPriority: "low",
966
- nonce: nonce
973
+ nonce: externalRuntimeConfig
967
974
  }),
968
- "string" === typeof importMap
969
- ? (bootstrapScriptContent.href = maxHeadersLength = importMap)
970
- : ((bootstrapScriptContent.href = maxHeadersLength =
971
- importMap.src),
972
- (bootstrapScriptContent.integrity = idPrefix =
973
- "string" === typeof importMap.integrity
974
- ? importMap.integrity
975
+ "string" === typeof bootstrapScripts
976
+ ? (nonceStyle.href = importMap = bootstrapScripts)
977
+ : ((nonceStyle.href = importMap = bootstrapScripts.src),
978
+ (nonceStyle.integrity = inlineScriptWithNonce =
979
+ "string" === typeof bootstrapScripts.integrity
980
+ ? bootstrapScripts.integrity
975
981
  : void 0),
976
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
977
- "string" === typeof importMap || null == importMap.crossOrigin
982
+ (nonceStyle.crossOrigin = maxHeadersLength =
983
+ "string" === typeof bootstrapScripts ||
984
+ null == bootstrapScripts.crossOrigin
978
985
  ? void 0
979
- : "use-credentials" === importMap.crossOrigin
986
+ : "use-credentials" === bootstrapScripts.crossOrigin
980
987
  ? "use-credentials"
981
988
  : "")),
982
989
  preloadBootstrapScriptOrModule(
983
990
  resumableState,
984
991
  onHeaders,
985
- maxHeadersLength,
986
- bootstrapScriptContent
992
+ importMap,
993
+ nonceStyle
987
994
  ),
988
- externalRuntimeConfig.push(
995
+ bootstrapChunks.push(
989
996
  startModuleSrc,
990
- stringToChunk(escapeTextForBrowser(maxHeadersLength)),
997
+ stringToChunk(escapeTextForBrowser(importMap)),
991
998
  attributeEnd
992
999
  ),
993
- nonce &&
994
- externalRuntimeConfig.push(
1000
+ externalRuntimeConfig &&
1001
+ bootstrapChunks.push(
995
1002
  scriptNonce,
996
- stringToChunk(escapeTextForBrowser(nonce)),
1003
+ stringToChunk(escapeTextForBrowser(externalRuntimeConfig)),
997
1004
  attributeEnd
998
1005
  ),
999
- "string" === typeof idPrefix &&
1000
- externalRuntimeConfig.push(
1006
+ "string" === typeof inlineScriptWithNonce &&
1007
+ bootstrapChunks.push(
1001
1008
  scriptIntegirty,
1002
- stringToChunk(escapeTextForBrowser(idPrefix)),
1009
+ stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
1003
1010
  attributeEnd
1004
1011
  ),
1005
- "string" === typeof inlineScriptWithNonce &&
1006
- externalRuntimeConfig.push(
1012
+ "string" === typeof maxHeadersLength &&
1013
+ bootstrapChunks.push(
1007
1014
  scriptCrossOrigin,
1008
- stringToChunk(escapeTextForBrowser(inlineScriptWithNonce)),
1015
+ stringToChunk(escapeTextForBrowser(maxHeadersLength)),
1009
1016
  attributeEnd
1010
1017
  ),
1011
- pushCompletedShellIdAttribute(
1012
- externalRuntimeConfig,
1013
- resumableState
1014
- ),
1015
- externalRuntimeConfig.push(endAsyncScript);
1018
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
1019
+ bootstrapChunks.push(endAsyncScript);
1016
1020
  return onHeaders;
1017
1021
  }
1018
1022
  function createResumableState(
@@ -2760,7 +2764,8 @@
2760
2764
  );
2761
2765
  }
2762
2766
  var precedence$jscomp$0 = props.precedence,
2763
- href$jscomp$0 = props.href;
2767
+ href$jscomp$0 = props.href,
2768
+ nonce = props.nonce;
2764
2769
  if (
2765
2770
  formatContext.insertionMode === SVG_MODE ||
2766
2771
  noscriptTagInScope$jscomp$2 ||
@@ -2831,51 +2836,68 @@
2831
2836
  '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.',
2832
2837
  href$jscomp$0
2833
2838
  );
2834
- styleQueue$jscomp$0
2835
- ? styleQueue$jscomp$0.hrefs.push(
2836
- stringToChunk(escapeTextForBrowser(href$jscomp$0))
2837
- )
2838
- : ((styleQueue$jscomp$0 = {
2839
- precedence: stringToChunk(
2840
- escapeTextForBrowser(precedence$jscomp$0)
2841
- ),
2842
- rules: [],
2843
- hrefs: [stringToChunk(escapeTextForBrowser(href$jscomp$0))],
2844
- sheets: new Map()
2845
- }),
2846
- renderState.styles.set(
2839
+ styleQueue$jscomp$0 ||
2840
+ ((styleQueue$jscomp$0 = {
2841
+ precedence: stringToChunk(
2842
+ escapeTextForBrowser(precedence$jscomp$0)
2843
+ ),
2844
+ rules: [],
2845
+ hrefs: [],
2846
+ sheets: new Map()
2847
+ }),
2848
+ renderState.styles.set(
2849
+ precedence$jscomp$0,
2850
+ styleQueue$jscomp$0
2851
+ ));
2852
+ var nonceStyle = renderState.nonce.style;
2853
+ if (nonceStyle && nonceStyle !== nonce)
2854
+ console.error(
2855
+ '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.',
2856
+ precedence$jscomp$0,
2857
+ nonce,
2858
+ nonceStyle
2859
+ );
2860
+ else {
2861
+ !nonceStyle &&
2862
+ nonce &&
2863
+ console.error(
2864
+ '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.',
2847
2865
  precedence$jscomp$0,
2848
- styleQueue$jscomp$0
2849
- ));
2850
- var target = styleQueue$jscomp$0.rules,
2851
- children$jscomp$9 = null,
2852
- innerHTML$jscomp$6 = null,
2853
- propKey$jscomp$9;
2854
- for (propKey$jscomp$9 in props)
2855
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2856
- var propValue$jscomp$9 = props[propKey$jscomp$9];
2857
- if (null != propValue$jscomp$9)
2858
- switch (propKey$jscomp$9) {
2859
- case "children":
2860
- children$jscomp$9 = propValue$jscomp$9;
2861
- break;
2862
- case "dangerouslySetInnerHTML":
2863
- innerHTML$jscomp$6 = propValue$jscomp$9;
2864
- }
2865
- }
2866
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
2867
- ? 2 > children$jscomp$9.length
2868
- ? children$jscomp$9[0]
2869
- : null
2870
- : children$jscomp$9;
2871
- "function" !== typeof child$jscomp$2 &&
2872
- "symbol" !== typeof child$jscomp$2 &&
2873
- null !== child$jscomp$2 &&
2874
- void 0 !== child$jscomp$2 &&
2875
- target.push(
2876
- stringToChunk(escapeStyleTextContent(child$jscomp$2))
2866
+ nonce
2867
+ );
2868
+ styleQueue$jscomp$0.hrefs.push(
2869
+ stringToChunk(escapeTextForBrowser(href$jscomp$0))
2877
2870
  );
2878
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2871
+ var target = styleQueue$jscomp$0.rules,
2872
+ children$jscomp$9 = null,
2873
+ innerHTML$jscomp$6 = null,
2874
+ propKey$jscomp$9;
2875
+ for (propKey$jscomp$9 in props)
2876
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2877
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
2878
+ if (null != propValue$jscomp$9)
2879
+ switch (propKey$jscomp$9) {
2880
+ case "children":
2881
+ children$jscomp$9 = propValue$jscomp$9;
2882
+ break;
2883
+ case "dangerouslySetInnerHTML":
2884
+ innerHTML$jscomp$6 = propValue$jscomp$9;
2885
+ }
2886
+ }
2887
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
2888
+ ? 2 > children$jscomp$9.length
2889
+ ? children$jscomp$9[0]
2890
+ : null
2891
+ : children$jscomp$9;
2892
+ "function" !== typeof child$jscomp$2 &&
2893
+ "symbol" !== typeof child$jscomp$2 &&
2894
+ null !== child$jscomp$2 &&
2895
+ void 0 !== child$jscomp$2 &&
2896
+ target.push(
2897
+ stringToChunk(escapeStyleTextContent(child$jscomp$2))
2898
+ );
2899
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2900
+ }
2879
2901
  }
2880
2902
  styleQueue$jscomp$0 &&
2881
2903
  hoistableState &&
@@ -3367,6 +3389,7 @@
3367
3389
  );
3368
3390
  var i = 0;
3369
3391
  if (hrefs.length) {
3392
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3370
3393
  writeChunk(this, lateStyleTagResourceOpen1);
3371
3394
  writeChunk(this, styleQueue.precedence);
3372
3395
  for (
@@ -3399,7 +3422,9 @@
3399
3422
  ) {
3400
3423
  currentlyRenderingBoundaryHasStylesToHoist = !1;
3401
3424
  destinationHasCapacity = !0;
3425
+ currentlyFlushingRenderState = renderState;
3402
3426
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
3427
+ currentlyFlushingRenderState = null;
3403
3428
  hoistableState.stylesheets.forEach(hasStylesToHoist);
3404
3429
  currentlyRenderingBoundaryHasStylesToHoist &&
3405
3430
  (renderState.stylesToHoist = !0);
@@ -3423,6 +3448,7 @@
3423
3448
  var rules = styleQueue.rules,
3424
3449
  hrefs = styleQueue.hrefs;
3425
3450
  if (!hasStylesheets || hrefs.length) {
3451
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3426
3452
  writeChunk(this, styleTagResourceOpen1);
3427
3453
  writeChunk(this, styleQueue.precedence);
3428
3454
  styleQueue = 0;
@@ -7970,7 +7996,9 @@
7970
7996
  renderState.fontPreloads.clear();
7971
7997
  renderState.highImagePreloads.forEach(flushResource, destination);
7972
7998
  renderState.highImagePreloads.clear();
7999
+ currentlyFlushingRenderState = renderState;
7973
8000
  renderState.styles.forEach(flushStylesInPreamble, destination);
8001
+ currentlyFlushingRenderState = null;
7974
8002
  var importMapChunks = renderState.importMapChunks;
7975
8003
  for (
7976
8004
  i$jscomp$0 = 0;
@@ -8371,11 +8399,11 @@
8371
8399
  }
8372
8400
  function ensureCorrectIsomorphicReactVersion() {
8373
8401
  var isomorphicReactPackageVersion = React.version;
8374
- if ("19.2.0-canary-b07717d8-20250528" !== isomorphicReactPackageVersion)
8402
+ if ("19.2.0-canary-526dd340-20250602" !== isomorphicReactPackageVersion)
8375
8403
  throw Error(
8376
8404
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
8377
8405
  (isomorphicReactPackageVersion +
8378
- "\n - react-dom: 19.2.0-canary-b07717d8-20250528\nLearn more: https://react.dev/warnings/version-mismatch")
8406
+ "\n - react-dom: 19.2.0-canary-526dd340-20250602\nLearn more: https://react.dev/warnings/version-mismatch")
8379
8407
  );
8380
8408
  }
8381
8409
  var React = require("react"),
@@ -9463,6 +9491,7 @@
9463
9491
  EXISTS = null,
9464
9492
  PRELOAD_NO_CREDS = [];
9465
9493
  Object.freeze(PRELOAD_NO_CREDS);
9494
+ var currentlyFlushingRenderState = null;
9466
9495
  stringToPrecomputedChunk('"></template>');
9467
9496
  var startInlineScript = stringToPrecomputedChunk("<script"),
9468
9497
  endInlineScript = stringToPrecomputedChunk("\x3c/script>"),
@@ -9472,6 +9501,7 @@
9472
9501
  scriptIntegirty = stringToPrecomputedChunk(' integrity="'),
9473
9502
  scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin="'),
9474
9503
  endAsyncScript = stringToPrecomputedChunk(' async="">\x3c/script>'),
9504
+ startInlineStyle = stringToPrecomputedChunk("<style"),
9475
9505
  scriptRegex = /(<\/|<)(s)(cript)/gi,
9476
9506
  importMapScriptStart = stringToPrecomputedChunk(
9477
9507
  '<script type="importmap">'
@@ -9639,7 +9669,7 @@
9639
9669
  var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g,
9640
9670
  regexForJSStringsInScripts = /[&><\u2028\u2029]/g,
9641
9671
  lateStyleTagResourceOpen1 = stringToPrecomputedChunk(
9642
- '<style media="not all" data-precedence="'
9672
+ ' media="not all" data-precedence="'
9643
9673
  ),
9644
9674
  lateStyleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9645
9675
  lateStyleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -9647,9 +9677,7 @@
9647
9677
  currentlyRenderingBoundaryHasStylesToHoist = !1,
9648
9678
  destinationHasCapacity = !0,
9649
9679
  stylesheetFlushingQueue = [],
9650
- styleTagResourceOpen1 = stringToPrecomputedChunk(
9651
- '<style data-precedence="'
9652
- ),
9680
+ styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence="'),
9653
9681
  styleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9654
9682
  spaceSeparator = stringToPrecomputedChunk(" "),
9655
9683
  styleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -10058,5 +10086,5 @@
10058
10086
  startWork(request);
10059
10087
  });
10060
10088
  };
10061
- exports.version = "19.2.0-canary-b07717d8-20250528";
10089
+ exports.version = "19.2.0-canary-526dd340-20250602";
10062
10090
  })();