Skip to content

Commit

Permalink
Preinits should support a nonce option (#26744)
Browse files Browse the repository at this point in the history
Currently there is no way to provide a nonce when using
`ReactDOM.preinit(..., { as: 'script' })`

This PR adds `nonce?: string` as an option

While implementing this PR I added a test to also show you can pass
`integrity`. This test isn't directly related to the nonce change.

DiffTrain build for commit b12bea6.
  • Loading branch information
gnoff committed Apr 28, 2023
1 parent 9d8942f commit 1ef6880
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23894,7 +23894,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-efbd68511-20230428";
var ReactVersion = "18.3.0-next-b12bea62d-20230428";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8608,7 +8608,7 @@ var devToolsConfig$jscomp$inline_1024 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1209 = {
Expand Down Expand Up @@ -8639,7 +8639,7 @@ var internals$jscomp$inline_1209 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1210 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9034,7 +9034,7 @@ var devToolsConfig$jscomp$inline_1066 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1250 = {
Expand Down Expand Up @@ -9065,7 +9065,7 @@ var internals$jscomp$inline_1250 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1251 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-next-efbd68511-20230428";
var ReactVersion = "18.3.0-next-b12bea62d-20230428";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-efbd68511-20230428";
exports.version = "18.3.0-next-b12bea62d-20230428";
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-efbd68511-20230428";
exports.version = "18.3.0-next-b12bea62d-20230428";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
efbd68511db472120afa0f3eba78a7462f25ed30
b12bea62d9cfd9a925f28cb2c93daeda3865a64e
Original file line number Diff line number Diff line change
Expand Up @@ -27204,7 +27204,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-efbd68511-20230428";
var ReactVersion = "18.3.0-next-b12bea62d-20230428";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9479,7 +9479,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1048 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9521,7 +9521,7 @@ var internals$jscomp$inline_1279 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1280 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10188,7 +10188,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1126 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10243,7 +10243,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27717,7 +27717,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-efbd68511-20230428";
var ReactVersion = "18.3.0-next-b12bea62d-20230428";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9738,7 +9738,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1103 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9780,7 +9780,7 @@ var internals$jscomp$inline_1348 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1349 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10447,7 +10447,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1181 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-efbd68511-20230428",
version: "18.3.0-next-b12bea62d-20230428",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10502,7 +10502,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-efbd68511-20230428"
reconcilerVersion: "18.3.0-next-b12bea62d-20230428"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 1ef6880

Please sign in to comment.