Skip to content

Commit b437e4d

Browse files
committed
[Float] Nonce preload support (#26939)
Some browsers, with some CSP configuration, will not preload a script if the prelaod link tag does not provide a valid nonce attribute. This change adds the ability to specify a nonce for `ReactDOM.preload(..., { as: "script" })` DiffTrain build for [86acc10](86acc10)
1 parent 1d94a43 commit b437e4d

21 files changed

+48
-32
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a7bf5ba614c6ddbd1eb3057c71f72efd1b6c21a9
1+
86acc10f2596e1a6fe2fd57a5b325de85175800b

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-180bd813";
30+
var ReactVersion = "18.3.0-www-modern-5fb44b73";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-0a8a0f8c";
72+
var ReactVersion = "18.3.0-www-modern-520e6c62";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;

compiled/facebook-www/ReactART-prod.modern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9858,7 +9858,7 @@ var slice = Array.prototype.slice,
98589858
return null;
98599859
},
98609860
bundleType: 0,
9861-
version: "18.3.0-www-modern-27da91db",
9861+
version: "18.3.0-www-modern-e8821afc",
98629862
rendererPackageName: "react-art"
98639863
};
98649864
var internals$jscomp$inline_1298 = {
@@ -9889,7 +9889,7 @@ var internals$jscomp$inline_1298 = {
98899889
scheduleRoot: null,
98909890
setRefreshHandler: null,
98919891
getCurrentFiber: null,
9892-
reconcilerVersion: "18.3.0-www-modern-27da91db"
9892+
reconcilerVersion: "18.3.0-www-modern-e8821afc"
98939893
};
98949894
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
98959895
var hook$jscomp$inline_1299 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34178,7 +34178,7 @@ function createFiberRoot(
3417834178
return root;
3417934179
}
3418034180

34181-
var ReactVersion = "18.3.0-www-classic-202be78c";
34181+
var ReactVersion = "18.3.0-www-classic-3dccae4a";
3418234182

3418334183
function createPortal$1(
3418434184
children,
@@ -43823,6 +43823,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
4382343823
crossOrigin: as === "font" ? "" : options.crossOrigin,
4382443824
integrity: options.integrity,
4382543825
type: options.type,
43826+
nonce: options.nonce,
4382643827
fetchPriority: options.fetchPriority
4382743828
};
4382843829
}

compiled/facebook-www/ReactDOM-dev.modern.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34023,7 +34023,7 @@ function createFiberRoot(
3402334023
return root;
3402434024
}
3402534025

34026-
var ReactVersion = "18.3.0-www-modern-0a8a0f8c";
34026+
var ReactVersion = "18.3.0-www-modern-520e6c62";
3402734027

3402834028
function createPortal$1(
3402934029
children,
@@ -44333,6 +44333,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
4433344333
crossOrigin: as === "font" ? "" : options.crossOrigin,
4433444334
integrity: options.integrity,
4433544335
type: options.type,
44336+
nonce: options.nonce,
4433644337
fetchPriority: options.fetchPriority
4433744338
};
4433844339
}

compiled/facebook-www/ReactDOM-prod.classic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15303,6 +15303,7 @@ function preload$1(href, options) {
1530315303
crossOrigin: "font" === as ? "" : options.crossOrigin,
1530415304
integrity: options.integrity,
1530515305
type: options.type,
15306+
nonce: options.nonce,
1530615307
fetchPriority: options.fetchPriority
1530715308
}),
1530815309
preloadPropsMap.set(key, href),
@@ -16643,7 +16644,7 @@ Internals.Events = [
1664316644
var devToolsConfig$jscomp$inline_1815 = {
1664416645
findFiberByHostInstance: getClosestInstanceFromNode,
1664516646
bundleType: 0,
16646-
version: "18.3.0-www-classic-a78c92e7",
16647+
version: "18.3.0-www-classic-c1034a44",
1664716648
rendererPackageName: "react-dom"
1664816649
};
1664916650
var internals$jscomp$inline_2184 = {
@@ -16673,7 +16674,7 @@ var internals$jscomp$inline_2184 = {
1667316674
scheduleRoot: null,
1667416675
setRefreshHandler: null,
1667516676
getCurrentFiber: null,
16676-
reconcilerVersion: "18.3.0-www-classic-a78c92e7"
16677+
reconcilerVersion: "18.3.0-www-classic-c1034a44"
1667716678
};
1667816679
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1667916680
var hook$jscomp$inline_2185 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16916,4 +16917,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1691616917
);
1691716918
};
1691816919
exports.unstable_runWithPriority = runWithPriority;
16919-
exports.version = "18.3.0-www-classic-a78c92e7";
16920+
exports.version = "18.3.0-www-classic-c1034a44";

compiled/facebook-www/ReactDOM-prod.modern.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15533,6 +15533,7 @@ function preload$1(href, options) {
1553315533
crossOrigin: "font" === as ? "" : options.crossOrigin,
1553415534
integrity: options.integrity,
1553515535
type: options.type,
15536+
nonce: options.nonce,
1553615537
fetchPriority: options.fetchPriority
1553715538
}),
1553815539
preloadPropsMap.set(key, href),
@@ -16172,7 +16173,7 @@ Internals.Events = [
1617216173
var devToolsConfig$jscomp$inline_1774 = {
1617316174
findFiberByHostInstance: getClosestInstanceFromNode,
1617416175
bundleType: 0,
16175-
version: "18.3.0-www-modern-27da91db",
16176+
version: "18.3.0-www-modern-e8821afc",
1617616177
rendererPackageName: "react-dom"
1617716178
};
1617816179
var internals$jscomp$inline_2148 = {
@@ -16203,7 +16204,7 @@ var internals$jscomp$inline_2148 = {
1620316204
scheduleRoot: null,
1620416205
setRefreshHandler: null,
1620516206
getCurrentFiber: null,
16206-
reconcilerVersion: "18.3.0-www-modern-27da91db"
16207+
reconcilerVersion: "18.3.0-www-modern-e8821afc"
1620716208
};
1620816209
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1620916210
var hook$jscomp$inline_2149 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16374,4 +16375,4 @@ exports.unstable_createEventHandle = function (type, options) {
1637416375
return eventHandle;
1637516376
};
1637616377
exports.unstable_runWithPriority = runWithPriority;
16377-
exports.version = "18.3.0-www-modern-27da91db";
16378+
exports.version = "18.3.0-www-modern-e8821afc";

compiled/facebook-www/ReactDOM-profiling.classic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16078,6 +16078,7 @@ function preload$1(href, options) {
1607816078
crossOrigin: "font" === as ? "" : options.crossOrigin,
1607916079
integrity: options.integrity,
1608016080
type: options.type,
16081+
nonce: options.nonce,
1608116082
fetchPriority: options.fetchPriority
1608216083
}),
1608316084
preloadPropsMap.set(key, href),
@@ -17418,7 +17419,7 @@ Internals.Events = [
1741817419
var devToolsConfig$jscomp$inline_1900 = {
1741917420
findFiberByHostInstance: getClosestInstanceFromNode,
1742017421
bundleType: 0,
17421-
version: "18.3.0-www-classic-6cc31d50",
17422+
version: "18.3.0-www-classic-1233fa25",
1742217423
rendererPackageName: "react-dom"
1742317424
};
1742417425
(function (internals) {
@@ -17462,7 +17463,7 @@ var devToolsConfig$jscomp$inline_1900 = {
1746217463
scheduleRoot: null,
1746317464
setRefreshHandler: null,
1746417465
getCurrentFiber: null,
17465-
reconcilerVersion: "18.3.0-www-classic-6cc31d50"
17466+
reconcilerVersion: "18.3.0-www-classic-1233fa25"
1746617467
});
1746717468
assign(Internals, {
1746817469
ReactBrowserEventEmitter: {
@@ -17692,7 +17693,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
1769217693
);
1769317694
};
1769417695
exports.unstable_runWithPriority = runWithPriority;
17695-
exports.version = "18.3.0-www-classic-6cc31d50";
17696+
exports.version = "18.3.0-www-classic-1233fa25";
1769617697

1769717698
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1769817699
if (

compiled/facebook-www/ReactDOM-profiling.modern.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16302,6 +16302,7 @@ function preload$1(href, options) {
1630216302
crossOrigin: "font" === as ? "" : options.crossOrigin,
1630316303
integrity: options.integrity,
1630416304
type: options.type,
16305+
nonce: options.nonce,
1630516306
fetchPriority: options.fetchPriority
1630616307
}),
1630716308
preloadPropsMap.set(key, href),
@@ -16941,7 +16942,7 @@ Internals.Events = [
1694116942
var devToolsConfig$jscomp$inline_1859 = {
1694216943
findFiberByHostInstance: getClosestInstanceFromNode,
1694316944
bundleType: 0,
16944-
version: "18.3.0-www-modern-2704a18e",
16945+
version: "18.3.0-www-modern-d08e2742",
1694516946
rendererPackageName: "react-dom"
1694616947
};
1694716948
(function (internals) {
@@ -16986,7 +16987,7 @@ var devToolsConfig$jscomp$inline_1859 = {
1698616987
scheduleRoot: null,
1698716988
setRefreshHandler: null,
1698816989
getCurrentFiber: null,
16989-
reconcilerVersion: "18.3.0-www-modern-2704a18e"
16990+
reconcilerVersion: "18.3.0-www-modern-d08e2742"
1699016991
});
1699116992
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
1699216993
exports.createPortal = function (children, container) {
@@ -17144,7 +17145,7 @@ exports.unstable_createEventHandle = function (type, options) {
1714417145
return eventHandle;
1714517146
};
1714617147
exports.unstable_runWithPriority = runWithPriority;
17147-
exports.version = "18.3.0-www-modern-2704a18e";
17148+
exports.version = "18.3.0-www-modern-d08e2742";
1714817149

1714917150
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1715017151
if (

compiled/facebook-www/ReactDOMServer-dev.classic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-classic-22ab72ab";
22+
var ReactVersion = "18.3.0-www-classic-4d7a4acb";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -7521,6 +7521,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
75217521
crossOrigin: as === "font" ? "" : options.crossOrigin,
75227522
integrity: options.integrity,
75237523
type: options.type,
7524+
nonce: options.nonce,
75247525
fetchPriority: options.fetchPriority
75257526
};
75267527
}

compiled/facebook-www/ReactDOMServer-dev.modern.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-modern-27b3679a";
22+
var ReactVersion = "18.3.0-www-modern-18f0b486";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -7521,6 +7521,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
75217521
crossOrigin: as === "font" ? "" : options.crossOrigin,
75227522
integrity: options.integrity,
75237523
type: options.type,
7524+
nonce: options.nonce,
75247525
fetchPriority: options.fetchPriority
75257526
};
75267527
}

compiled/facebook-www/ReactDOMServer-prod.classic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,7 @@ function preload(href, options) {
18551855
crossOrigin: "font" === as ? "" : options.crossOrigin,
18561856
integrity: options.integrity,
18571857
type: options.type,
1858+
nonce: options.nonce,
18581859
fetchPriority: options.fetchPriority
18591860
}
18601861
}),
@@ -4001,4 +4002,4 @@ exports.renderToString = function (children, options) {
40014002
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
40024003
);
40034004
};
4004-
exports.version = "18.3.0-www-classic-43b0ed5e";
4005+
exports.version = "18.3.0-www-classic-99c1dfc7";

compiled/facebook-www/ReactDOMServer-prod.modern.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,7 @@ function preload(href, options) {
18541854
crossOrigin: "font" === as ? "" : options.crossOrigin,
18551855
integrity: options.integrity,
18561856
type: options.type,
1857+
nonce: options.nonce,
18571858
fetchPriority: options.fetchPriority
18581859
}
18591860
}),
@@ -3899,4 +3900,4 @@ exports.renderToString = function (children, options) {
38993900
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
39003901
);
39013902
};
3902-
exports.version = "18.3.0-www-modern-0fa0d6a8";
3903+
exports.version = "18.3.0-www-modern-7d85fe51";

compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7528,6 +7528,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
75287528
crossOrigin: as === "font" ? "" : options.crossOrigin,
75297529
integrity: options.integrity,
75307530
type: options.type,
7531+
nonce: options.nonce,
75317532
fetchPriority: options.fetchPriority
75327533
};
75337534
}

compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ function preload(href, options) {
19041904
crossOrigin: "font" === as ? "" : options.crossOrigin,
19051905
integrity: options.integrity,
19061906
type: options.type,
1907+
nonce: options.nonce,
19071908
fetchPriority: options.fetchPriority
19081909
}
19091910
}),

compiled/facebook-www/ReactDOMTesting-dev.classic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34795,7 +34795,7 @@ function createFiberRoot(
3479534795
return root;
3479634796
}
3479734797

34798-
var ReactVersion = "18.3.0-www-classic-a43be0aa";
34798+
var ReactVersion = "18.3.0-www-classic-4a9fda08";
3479934799

3480034800
function createPortal$1(
3480134801
children,
@@ -44572,6 +44572,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
4457244572
crossOrigin: as === "font" ? "" : options.crossOrigin,
4457344573
integrity: options.integrity,
4457444574
type: options.type,
44575+
nonce: options.nonce,
4457544576
fetchPriority: options.fetchPriority
4457644577
};
4457744578
}

compiled/facebook-www/ReactDOMTesting-dev.modern.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34640,7 +34640,7 @@ function createFiberRoot(
3464034640
return root;
3464134641
}
3464234642

34643-
var ReactVersion = "18.3.0-www-modern-dd1ac991";
34643+
var ReactVersion = "18.3.0-www-modern-6dec7344";
3464434644

3464534645
function createPortal$1(
3464634646
children,
@@ -45082,6 +45082,7 @@ function preloadPropsFromPreloadOptions(href, as, options) {
4508245082
crossOrigin: as === "font" ? "" : options.crossOrigin,
4508345083
integrity: options.integrity,
4508445084
type: options.type,
45085+
nonce: options.nonce,
4508545086
fetchPriority: options.fetchPriority
4508645087
};
4508745088
}

compiled/facebook-www/ReactDOMTesting-prod.classic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15632,6 +15632,7 @@ function preload$1(href, options) {
1563215632
crossOrigin: "font" === as ? "" : options.crossOrigin,
1563315633
integrity: options.integrity,
1563415634
type: options.type,
15635+
nonce: options.nonce,
1563515636
fetchPriority: options.fetchPriority
1563615637
}),
1563715638
preloadPropsMap.set(key, href),
@@ -16972,7 +16973,7 @@ Internals.Events = [
1697216973
var devToolsConfig$jscomp$inline_1844 = {
1697316974
findFiberByHostInstance: getClosestInstanceFromNode,
1697416975
bundleType: 0,
16975-
version: "18.3.0-www-classic-2d5fcb75",
16976+
version: "18.3.0-www-classic-1f937379",
1697616977
rendererPackageName: "react-dom"
1697716978
};
1697816979
var internals$jscomp$inline_2218 = {
@@ -17002,7 +17003,7 @@ var internals$jscomp$inline_2218 = {
1700217003
scheduleRoot: null,
1700317004
setRefreshHandler: null,
1700417005
getCurrentFiber: null,
17005-
reconcilerVersion: "18.3.0-www-classic-2d5fcb75"
17006+
reconcilerVersion: "18.3.0-www-classic-1f937379"
1700617007
};
1700717008
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1700817009
var hook$jscomp$inline_2219 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17396,4 +17397,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1739617397
);
1739717398
};
1739817399
exports.unstable_runWithPriority = runWithPriority;
17399-
exports.version = "18.3.0-www-classic-2d5fcb75";
17400+
exports.version = "18.3.0-www-classic-1f937379";

compiled/facebook-www/ReactDOMTesting-prod.modern.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15917,6 +15917,7 @@ function preload$1(href, options) {
1591715917
crossOrigin: "font" === as ? "" : options.crossOrigin,
1591815918
integrity: options.integrity,
1591915919
type: options.type,
15920+
nonce: options.nonce,
1592015921
fetchPriority: options.fetchPriority
1592115922
}),
1592215923
preloadPropsMap.set(key, href),
@@ -16556,7 +16557,7 @@ Internals.Events = [
1655616557
var devToolsConfig$jscomp$inline_1803 = {
1655716558
findFiberByHostInstance: getClosestInstanceFromNode,
1655816559
bundleType: 0,
16559-
version: "18.3.0-www-modern-180bd813",
16560+
version: "18.3.0-www-modern-5fb44b73",
1656016561
rendererPackageName: "react-dom"
1656116562
};
1656216563
var internals$jscomp$inline_2182 = {
@@ -16587,7 +16588,7 @@ var internals$jscomp$inline_2182 = {
1658716588
scheduleRoot: null,
1658816589
setRefreshHandler: null,
1658916590
getCurrentFiber: null,
16590-
reconcilerVersion: "18.3.0-www-modern-180bd813"
16591+
reconcilerVersion: "18.3.0-www-modern-5fb44b73"
1659116592
};
1659216593
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1659316594
var hook$jscomp$inline_2183 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16909,4 +16910,4 @@ exports.unstable_createEventHandle = function (type, options) {
1690916910
return eventHandle;
1691016911
};
1691116912
exports.unstable_runWithPriority = runWithPriority;
16912-
exports.version = "18.3.0-www-modern-180bd813";
16913+
exports.version = "18.3.0-www-modern-5fb44b73";

compiled/facebook-www/ReactTestRenderer-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24553,7 +24553,7 @@ function createFiberRoot(
2455324553
return root;
2455424554
}
2455524555

24556-
var ReactVersion = "18.3.0-www-classic-a43be0aa";
24556+
var ReactVersion = "18.3.0-www-classic-4a9fda08";
2455724557

2455824558
// Might add PROFILE later.
2455924559

0 commit comments

Comments
 (0)