react-dom 19.2.0-canary-f9ae0a4c-20250527 → 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.
@@ -759,21 +759,32 @@
759
759
  onHeaders,
760
760
  maxHeadersLength
761
761
  ) {
762
+ externalRuntimeConfig =
763
+ "string" === typeof nonce ? nonce : nonce && nonce.script;
762
764
  var inlineScriptWithNonce =
763
- void 0 === nonce
765
+ void 0 === externalRuntimeConfig
764
766
  ? startInlineScript
765
767
  : stringToPrecomputedChunk(
766
- '<script nonce="' + escapeTextForBrowser(nonce) + '"'
768
+ '<script nonce="' +
769
+ escapeTextForBrowser(externalRuntimeConfig) +
770
+ '"'
767
771
  ),
768
- idPrefix = resumableState.idPrefix;
769
- externalRuntimeConfig = [];
770
- var bootstrapScriptContent = resumableState.bootstrapScriptContent,
772
+ nonceStyle = "string" === typeof nonce ? void 0 : nonce && nonce.style,
773
+ inlineStyleWithNonce =
774
+ void 0 === nonceStyle
775
+ ? startInlineStyle
776
+ : stringToPrecomputedChunk(
777
+ '<style nonce="' + escapeTextForBrowser(nonceStyle) + '"'
778
+ ),
779
+ idPrefix = resumableState.idPrefix,
780
+ bootstrapChunks = [],
781
+ bootstrapScriptContent = resumableState.bootstrapScriptContent,
771
782
  bootstrapScripts = resumableState.bootstrapScripts,
772
783
  bootstrapModules = resumableState.bootstrapModules;
773
784
  void 0 !== bootstrapScriptContent &&
774
- (externalRuntimeConfig.push(inlineScriptWithNonce),
775
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState),
776
- externalRuntimeConfig.push(
785
+ (bootstrapChunks.push(inlineScriptWithNonce),
786
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
787
+ bootstrapChunks.push(
777
788
  endOfStartTag,
778
789
  escapeEntireInlineScriptContent(bootstrapScriptContent),
779
790
  endInlineScript
@@ -807,9 +818,10 @@
807
818
  segmentPrefix: stringToPrecomputedChunk(idPrefix + "S:"),
808
819
  boundaryPrefix: stringToPrecomputedChunk(idPrefix + "B:"),
809
820
  startInlineScript: inlineScriptWithNonce,
821
+ startInlineStyle: inlineStyleWithNonce,
810
822
  preamble: createPreambleState(),
811
823
  externalRuntimeScript: null,
812
- bootstrapChunks: externalRuntimeConfig,
824
+ bootstrapChunks: bootstrapChunks,
813
825
  importMapChunks: bootstrapScriptContent,
814
826
  onHeaders: onHeaders,
815
827
  headers: importMap,
@@ -836,127 +848,119 @@
836
848
  scripts: new Map(),
837
849
  moduleScripts: new Map()
838
850
  },
839
- nonce: nonce,
851
+ nonce: { script: externalRuntimeConfig, style: nonceStyle },
840
852
  hoistableState: null,
841
853
  stylesToHoist: !1
842
854
  };
843
855
  if (void 0 !== bootstrapScripts)
844
- for (importMap = 0; importMap < bootstrapScripts.length; importMap++) {
845
- maxHeadersLength = bootstrapScripts[importMap];
846
- bootstrapScriptContent = idPrefix = void 0;
847
- var props = {
848
- rel: "preload",
849
- as: "script",
850
- fetchPriority: "low",
851
- nonce: nonce
852
- };
853
- "string" === typeof maxHeadersLength
854
- ? (props.href = inlineScriptWithNonce = maxHeadersLength)
855
- : ((props.href = inlineScriptWithNonce = maxHeadersLength.src),
856
- (props.integrity = bootstrapScriptContent =
857
- "string" === typeof maxHeadersLength.integrity
858
- ? maxHeadersLength.integrity
859
- : void 0),
860
- (props.crossOrigin = idPrefix =
861
- "string" === typeof maxHeadersLength ||
862
- null == maxHeadersLength.crossOrigin
863
- ? void 0
864
- : "use-credentials" === maxHeadersLength.crossOrigin
865
- ? "use-credentials"
866
- : ""));
867
- preloadBootstrapScriptOrModule(
868
- resumableState,
869
- onHeaders,
870
- inlineScriptWithNonce,
871
- props
872
- );
873
- externalRuntimeConfig.push(
874
- startScriptSrc,
875
- escapeTextForBrowser(inlineScriptWithNonce),
876
- attributeEnd
877
- );
878
- nonce &&
879
- externalRuntimeConfig.push(
880
- scriptNonce,
881
- escapeTextForBrowser(nonce),
882
- attributeEnd
883
- );
884
- "string" === typeof bootstrapScriptContent &&
885
- externalRuntimeConfig.push(
886
- scriptIntegirty,
887
- escapeTextForBrowser(bootstrapScriptContent),
888
- attributeEnd
889
- );
890
- "string" === typeof idPrefix &&
891
- externalRuntimeConfig.push(
892
- scriptCrossOrigin,
893
- escapeTextForBrowser(idPrefix),
856
+ for (importMap = 0; importMap < bootstrapScripts.length; importMap++)
857
+ (maxHeadersLength = bootstrapScripts[importMap]),
858
+ (inlineStyleWithNonce = nonceStyle = void 0),
859
+ (idPrefix = {
860
+ rel: "preload",
861
+ as: "script",
862
+ fetchPriority: "low",
863
+ nonce: nonce
864
+ }),
865
+ "string" === typeof maxHeadersLength
866
+ ? (idPrefix.href = inlineScriptWithNonce = maxHeadersLength)
867
+ : ((idPrefix.href = inlineScriptWithNonce = maxHeadersLength.src),
868
+ (idPrefix.integrity = inlineStyleWithNonce =
869
+ "string" === typeof maxHeadersLength.integrity
870
+ ? maxHeadersLength.integrity
871
+ : void 0),
872
+ (idPrefix.crossOrigin = nonceStyle =
873
+ "string" === typeof maxHeadersLength ||
874
+ null == maxHeadersLength.crossOrigin
875
+ ? void 0
876
+ : "use-credentials" === maxHeadersLength.crossOrigin
877
+ ? "use-credentials"
878
+ : "")),
879
+ preloadBootstrapScriptOrModule(
880
+ resumableState,
881
+ onHeaders,
882
+ inlineScriptWithNonce,
883
+ idPrefix
884
+ ),
885
+ bootstrapChunks.push(
886
+ startScriptSrc,
887
+ escapeTextForBrowser(inlineScriptWithNonce),
894
888
  attributeEnd
895
- );
896
- pushCompletedShellIdAttribute(externalRuntimeConfig, resumableState);
897
- externalRuntimeConfig.push(endAsyncScript);
898
- }
889
+ ),
890
+ externalRuntimeConfig &&
891
+ bootstrapChunks.push(
892
+ scriptNonce,
893
+ escapeTextForBrowser(externalRuntimeConfig),
894
+ attributeEnd
895
+ ),
896
+ "string" === typeof inlineStyleWithNonce &&
897
+ bootstrapChunks.push(
898
+ scriptIntegirty,
899
+ escapeTextForBrowser(inlineStyleWithNonce),
900
+ attributeEnd
901
+ ),
902
+ "string" === typeof nonceStyle &&
903
+ bootstrapChunks.push(
904
+ scriptCrossOrigin,
905
+ escapeTextForBrowser(nonceStyle),
906
+ attributeEnd
907
+ ),
908
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
909
+ bootstrapChunks.push(endAsyncScript);
899
910
  if (void 0 !== bootstrapModules)
900
- for (
901
- bootstrapScripts = 0;
902
- bootstrapScripts < bootstrapModules.length;
903
- bootstrapScripts++
904
- )
905
- (importMap = bootstrapModules[bootstrapScripts]),
906
- (idPrefix = inlineScriptWithNonce = void 0),
907
- (bootstrapScriptContent = {
911
+ for (nonce = 0; nonce < bootstrapModules.length; nonce++)
912
+ (bootstrapScripts = bootstrapModules[nonce]),
913
+ (inlineScriptWithNonce = maxHeadersLength = void 0),
914
+ (nonceStyle = {
908
915
  rel: "modulepreload",
909
916
  fetchPriority: "low",
910
- nonce: nonce
917
+ nonce: externalRuntimeConfig
911
918
  }),
912
- "string" === typeof importMap
913
- ? (bootstrapScriptContent.href = maxHeadersLength = importMap)
914
- : ((bootstrapScriptContent.href = maxHeadersLength =
915
- importMap.src),
916
- (bootstrapScriptContent.integrity = idPrefix =
917
- "string" === typeof importMap.integrity
918
- ? importMap.integrity
919
+ "string" === typeof bootstrapScripts
920
+ ? (nonceStyle.href = importMap = bootstrapScripts)
921
+ : ((nonceStyle.href = importMap = bootstrapScripts.src),
922
+ (nonceStyle.integrity = inlineScriptWithNonce =
923
+ "string" === typeof bootstrapScripts.integrity
924
+ ? bootstrapScripts.integrity
919
925
  : void 0),
920
- (bootstrapScriptContent.crossOrigin = inlineScriptWithNonce =
921
- "string" === typeof importMap || null == importMap.crossOrigin
926
+ (nonceStyle.crossOrigin = maxHeadersLength =
927
+ "string" === typeof bootstrapScripts ||
928
+ null == bootstrapScripts.crossOrigin
922
929
  ? void 0
923
- : "use-credentials" === importMap.crossOrigin
930
+ : "use-credentials" === bootstrapScripts.crossOrigin
924
931
  ? "use-credentials"
925
932
  : "")),
926
933
  preloadBootstrapScriptOrModule(
927
934
  resumableState,
928
935
  onHeaders,
929
- maxHeadersLength,
930
- bootstrapScriptContent
936
+ importMap,
937
+ nonceStyle
931
938
  ),
932
- externalRuntimeConfig.push(
939
+ bootstrapChunks.push(
933
940
  startModuleSrc,
934
- escapeTextForBrowser(maxHeadersLength),
941
+ escapeTextForBrowser(importMap),
935
942
  attributeEnd
936
943
  ),
937
- nonce &&
938
- externalRuntimeConfig.push(
944
+ externalRuntimeConfig &&
945
+ bootstrapChunks.push(
939
946
  scriptNonce,
940
- escapeTextForBrowser(nonce),
947
+ escapeTextForBrowser(externalRuntimeConfig),
941
948
  attributeEnd
942
949
  ),
943
- "string" === typeof idPrefix &&
944
- externalRuntimeConfig.push(
950
+ "string" === typeof inlineScriptWithNonce &&
951
+ bootstrapChunks.push(
945
952
  scriptIntegirty,
946
- escapeTextForBrowser(idPrefix),
953
+ escapeTextForBrowser(inlineScriptWithNonce),
947
954
  attributeEnd
948
955
  ),
949
- "string" === typeof inlineScriptWithNonce &&
950
- externalRuntimeConfig.push(
956
+ "string" === typeof maxHeadersLength &&
957
+ bootstrapChunks.push(
951
958
  scriptCrossOrigin,
952
- escapeTextForBrowser(inlineScriptWithNonce),
959
+ escapeTextForBrowser(maxHeadersLength),
953
960
  attributeEnd
954
961
  ),
955
- pushCompletedShellIdAttribute(
956
- externalRuntimeConfig,
957
- resumableState
958
- ),
959
- externalRuntimeConfig.push(endAsyncScript);
962
+ pushCompletedShellIdAttribute(bootstrapChunks, resumableState),
963
+ bootstrapChunks.push(endAsyncScript);
960
964
  return onHeaders;
961
965
  }
962
966
  function createResumableState(
@@ -2681,7 +2685,8 @@
2681
2685
  );
2682
2686
  }
2683
2687
  var precedence$jscomp$0 = props.precedence,
2684
- href$jscomp$0 = props.href;
2688
+ href$jscomp$0 = props.href,
2689
+ nonce = props.nonce;
2685
2690
  if (
2686
2691
  formatContext.insertionMode === SVG_MODE ||
2687
2692
  noscriptTagInScope$jscomp$2 ||
@@ -2750,47 +2755,64 @@
2750
2755
  '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.',
2751
2756
  href$jscomp$0
2752
2757
  );
2753
- styleQueue$jscomp$0
2754
- ? styleQueue$jscomp$0.hrefs.push(
2755
- escapeTextForBrowser(href$jscomp$0)
2756
- )
2757
- : ((styleQueue$jscomp$0 = {
2758
- precedence: escapeTextForBrowser(precedence$jscomp$0),
2759
- rules: [],
2760
- hrefs: [escapeTextForBrowser(href$jscomp$0)],
2761
- sheets: new Map()
2762
- }),
2763
- renderState.styles.set(
2758
+ styleQueue$jscomp$0 ||
2759
+ ((styleQueue$jscomp$0 = {
2760
+ precedence: escapeTextForBrowser(precedence$jscomp$0),
2761
+ rules: [],
2762
+ hrefs: [],
2763
+ sheets: new Map()
2764
+ }),
2765
+ renderState.styles.set(
2766
+ precedence$jscomp$0,
2767
+ styleQueue$jscomp$0
2768
+ ));
2769
+ var nonceStyle = renderState.nonce.style;
2770
+ if (nonceStyle && nonceStyle !== nonce)
2771
+ console.error(
2772
+ '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.',
2773
+ precedence$jscomp$0,
2774
+ nonce,
2775
+ nonceStyle
2776
+ );
2777
+ else {
2778
+ !nonceStyle &&
2779
+ nonce &&
2780
+ console.error(
2781
+ '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.',
2764
2782
  precedence$jscomp$0,
2765
- styleQueue$jscomp$0
2766
- ));
2767
- var target = styleQueue$jscomp$0.rules,
2768
- children$jscomp$9 = null,
2769
- innerHTML$jscomp$6 = null,
2770
- propKey$jscomp$9;
2771
- for (propKey$jscomp$9 in props)
2772
- if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2773
- var propValue$jscomp$9 = props[propKey$jscomp$9];
2774
- if (null != propValue$jscomp$9)
2775
- switch (propKey$jscomp$9) {
2776
- case "children":
2777
- children$jscomp$9 = propValue$jscomp$9;
2778
- break;
2779
- case "dangerouslySetInnerHTML":
2780
- innerHTML$jscomp$6 = propValue$jscomp$9;
2781
- }
2782
- }
2783
- var child$jscomp$2 = Array.isArray(children$jscomp$9)
2784
- ? 2 > children$jscomp$9.length
2785
- ? children$jscomp$9[0]
2786
- : null
2787
- : children$jscomp$9;
2788
- "function" !== typeof child$jscomp$2 &&
2789
- "symbol" !== typeof child$jscomp$2 &&
2790
- null !== child$jscomp$2 &&
2791
- void 0 !== child$jscomp$2 &&
2792
- target.push(escapeStyleTextContent(child$jscomp$2));
2793
- pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2783
+ nonce
2784
+ );
2785
+ styleQueue$jscomp$0.hrefs.push(
2786
+ escapeTextForBrowser(href$jscomp$0)
2787
+ );
2788
+ var target = styleQueue$jscomp$0.rules,
2789
+ children$jscomp$9 = null,
2790
+ innerHTML$jscomp$6 = null,
2791
+ propKey$jscomp$9;
2792
+ for (propKey$jscomp$9 in props)
2793
+ if (hasOwnProperty.call(props, propKey$jscomp$9)) {
2794
+ var propValue$jscomp$9 = props[propKey$jscomp$9];
2795
+ if (null != propValue$jscomp$9)
2796
+ switch (propKey$jscomp$9) {
2797
+ case "children":
2798
+ children$jscomp$9 = propValue$jscomp$9;
2799
+ break;
2800
+ case "dangerouslySetInnerHTML":
2801
+ innerHTML$jscomp$6 = propValue$jscomp$9;
2802
+ }
2803
+ }
2804
+ var child$jscomp$2 = Array.isArray(children$jscomp$9)
2805
+ ? 2 > children$jscomp$9.length
2806
+ ? children$jscomp$9[0]
2807
+ : null
2808
+ : children$jscomp$9;
2809
+ "function" !== typeof child$jscomp$2 &&
2810
+ "symbol" !== typeof child$jscomp$2 &&
2811
+ null !== child$jscomp$2 &&
2812
+ void 0 !== child$jscomp$2 &&
2813
+ target.push(escapeStyleTextContent(child$jscomp$2));
2814
+ pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$9);
2815
+ }
2794
2816
  }
2795
2817
  styleQueue$jscomp$0 &&
2796
2818
  hoistableState &&
@@ -3280,6 +3302,7 @@
3280
3302
  );
3281
3303
  var i = 0;
3282
3304
  if (hrefs.length) {
3305
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3283
3306
  writeChunk(this, lateStyleTagResourceOpen1);
3284
3307
  writeChunk(this, styleQueue.precedence);
3285
3308
  for (
@@ -3312,7 +3335,9 @@
3312
3335
  ) {
3313
3336
  currentlyRenderingBoundaryHasStylesToHoist = !1;
3314
3337
  destinationHasCapacity = !0;
3338
+ currentlyFlushingRenderState = renderState;
3315
3339
  hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);
3340
+ currentlyFlushingRenderState = null;
3316
3341
  hoistableState.stylesheets.forEach(hasStylesToHoist);
3317
3342
  currentlyRenderingBoundaryHasStylesToHoist &&
3318
3343
  (renderState.stylesToHoist = !0);
@@ -3336,6 +3361,7 @@
3336
3361
  var rules = styleQueue.rules,
3337
3362
  hrefs = styleQueue.hrefs;
3338
3363
  if (!hasStylesheets || hrefs.length) {
3364
+ writeChunk(this, currentlyFlushingRenderState.startInlineStyle);
3339
3365
  writeChunk(this, styleTagResourceOpen1);
3340
3366
  writeChunk(this, styleQueue.precedence);
3341
3367
  styleQueue = 0;
@@ -7861,7 +7887,9 @@
7861
7887
  renderState.fontPreloads.clear();
7862
7888
  renderState.highImagePreloads.forEach(flushResource, destination);
7863
7889
  renderState.highImagePreloads.clear();
7890
+ currentlyFlushingRenderState = renderState;
7864
7891
  renderState.styles.forEach(flushStylesInPreamble, destination);
7892
+ currentlyFlushingRenderState = null;
7865
7893
  var importMapChunks = renderState.importMapChunks;
7866
7894
  for (
7867
7895
  i$jscomp$0 = 0;
@@ -8246,11 +8274,11 @@
8246
8274
  }
8247
8275
  function ensureCorrectIsomorphicReactVersion() {
8248
8276
  var isomorphicReactPackageVersion = React.version;
8249
- if ("19.2.0-canary-f9ae0a4c-20250527" !== isomorphicReactPackageVersion)
8277
+ if ("19.2.0-canary-14094f80-20250529" !== isomorphicReactPackageVersion)
8250
8278
  throw Error(
8251
8279
  'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
8252
8280
  (isomorphicReactPackageVersion +
8253
- "\n - react-dom: 19.2.0-canary-f9ae0a4c-20250527\nLearn more: https://react.dev/warnings/version-mismatch")
8281
+ "\n - react-dom: 19.2.0-canary-14094f80-20250529\nLearn more: https://react.dev/warnings/version-mismatch")
8254
8282
  );
8255
8283
  }
8256
8284
  function createDrainHandler(destination, request) {
@@ -9389,6 +9417,7 @@
9389
9417
  EXISTS = null,
9390
9418
  PRELOAD_NO_CREDS = [];
9391
9419
  Object.freeze(PRELOAD_NO_CREDS);
9420
+ var currentlyFlushingRenderState = null;
9392
9421
  stringToPrecomputedChunk('"></template>');
9393
9422
  var startInlineScript = stringToPrecomputedChunk("<script"),
9394
9423
  endInlineScript = stringToPrecomputedChunk("\x3c/script>"),
@@ -9398,6 +9427,7 @@
9398
9427
  scriptIntegirty = stringToPrecomputedChunk(' integrity="'),
9399
9428
  scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin="'),
9400
9429
  endAsyncScript = stringToPrecomputedChunk(' async="">\x3c/script>'),
9430
+ startInlineStyle = stringToPrecomputedChunk("<style"),
9401
9431
  scriptRegex = /(<\/|<)(s)(cript)/gi,
9402
9432
  importMapScriptStart = stringToPrecomputedChunk(
9403
9433
  '<script type="importmap">'
@@ -9565,7 +9595,7 @@
9565
9595
  var regexForJSStringsInInstructionScripts = /[<\u2028\u2029]/g,
9566
9596
  regexForJSStringsInScripts = /[&><\u2028\u2029]/g,
9567
9597
  lateStyleTagResourceOpen1 = stringToPrecomputedChunk(
9568
- '<style media="not all" data-precedence="'
9598
+ ' media="not all" data-precedence="'
9569
9599
  ),
9570
9600
  lateStyleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9571
9601
  lateStyleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -9573,9 +9603,7 @@
9573
9603
  currentlyRenderingBoundaryHasStylesToHoist = !1,
9574
9604
  destinationHasCapacity = !0,
9575
9605
  stylesheetFlushingQueue = [],
9576
- styleTagResourceOpen1 = stringToPrecomputedChunk(
9577
- '<style data-precedence="'
9578
- ),
9606
+ styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence="'),
9579
9607
  styleTagResourceOpen2 = stringToPrecomputedChunk('" data-href="'),
9580
9608
  spaceSeparator = stringToPrecomputedChunk(" "),
9581
9609
  styleTagResourceOpen3 = stringToPrecomputedChunk('">'),
@@ -9932,5 +9960,5 @@
9932
9960
  }
9933
9961
  };
9934
9962
  };
9935
- exports.version = "19.2.0-canary-f9ae0a4c-20250527";
9963
+ exports.version = "19.2.0-canary-14094f80-20250529";
9936
9964
  })();