Skip to content

Commit 605ae6d

Browse files
committed
Convert ReactDOMTestSelectors-test.js to createRoot (#27993)
Straightforward adding createRoot and act DiffTrain build for [4217d32](4217d32)
1 parent d703a87 commit 605ae6d

File tree

6 files changed

+155
-103
lines changed

6 files changed

+155
-103
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b3003047101b4c7a643788a8faf576f7e370fb45
1+
4217d324ae5766b3201e682bb4d67b8855652694

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-classic-b3341fd5";
27+
var ReactVersion = "18.3.0-www-classic-9a4a2139";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

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

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35592,7 +35592,7 @@ if (__DEV__) {
3559235592
return root;
3559335593
}
3559435594

35595-
var ReactVersion = "18.3.0-www-classic-34ed23b6";
35595+
var ReactVersion = "18.3.0-www-classic-83debab5";
3559635596

3559735597
function createPortal$1(
3559835598
children,
@@ -47411,7 +47411,7 @@ if (__DEV__) {
4741147411
}
4741247412
};
4741347413

47414-
function createRoot$1(container, options) {
47414+
function createRoot$2(container, options) {
4741547415
if (!isValidContainer(container)) {
4741647416
throw new Error(
4741747417
"createRoot(...): Target container is not a DOM element."
@@ -47500,7 +47500,7 @@ if (__DEV__) {
4750047500

4750147501
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration =
4750247502
scheduleHydration;
47503-
function hydrateRoot$1(container, initialChildren, options) {
47503+
function hydrateRoot$2(container, initialChildren, options) {
4750447504
if (!isValidContainer(container)) {
4750547505
throw new Error(
4750647506
"hydrateRoot(...): Target container is not a DOM element."
@@ -48568,7 +48568,7 @@ if (__DEV__) {
4856848568
);
4856948569
}
4857048570

48571-
function createRoot(container, options) {
48571+
function createRoot$1(container, options) {
4857248572
{
4857348573
if (!Internals.usingClientEntryPoint && !false) {
4857448574
error(
@@ -48578,10 +48578,10 @@ if (__DEV__) {
4857848578
}
4857948579
}
4858048580

48581-
return createRoot$1(container, options);
48581+
return createRoot$2(container, options);
4858248582
}
4858348583

48584-
function hydrateRoot(container, initialChildren, options) {
48584+
function hydrateRoot$1(container, initialChildren, options) {
4858548585
{
4858648586
if (!Internals.usingClientEntryPoint && !false) {
4858748587
error(
@@ -48591,7 +48591,7 @@ if (__DEV__) {
4859148591
}
4859248592
}
4859348593

48594-
return hydrateRoot$1(container, initialChildren, options);
48594+
return hydrateRoot$2(container, initialChildren, options);
4859548595
} // Overload the definition to the two valid signatures.
4859648596
// Warning, this opts-out of checking the function body.
4859748597
// eslint-disable-next-line no-redeclare
@@ -48660,6 +48660,33 @@ if (__DEV__) {
4866048660
}
4866148661
});
4866248662

48663+
function createRoot(container, options) {
48664+
{
48665+
Internals.usingClientEntryPoint = true;
48666+
}
48667+
48668+
try {
48669+
return createRoot$1(container, options);
48670+
} finally {
48671+
{
48672+
Internals.usingClientEntryPoint = false;
48673+
}
48674+
}
48675+
}
48676+
function hydrateRoot(container, children, options) {
48677+
{
48678+
Internals.usingClientEntryPoint = true;
48679+
}
48680+
48681+
try {
48682+
return hydrateRoot$1(container, children, options);
48683+
} finally {
48684+
{
48685+
Internals.usingClientEntryPoint = false;
48686+
}
48687+
}
48688+
}
48689+
4866348690
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
4866448691
exports.createComponentSelector = createComponentSelector;
4866548692
exports.createHasPseudoClassSelector = createHasPseudoClassSelector;

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

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35413,7 +35413,7 @@ if (__DEV__) {
3541335413
return root;
3541435414
}
3541535415

35416-
var ReactVersion = "18.3.0-www-modern-e4da1ff6";
35416+
var ReactVersion = "18.3.0-www-modern-d6845784";
3541735417

3541835418
function createPortal$1(
3541935419
children,
@@ -46879,7 +46879,7 @@ if (__DEV__) {
4687946879
}
4688046880
};
4688146881

46882-
function createRoot$1(container, options) {
46882+
function createRoot$2(container, options) {
4688346883
if (!isValidContainer(container)) {
4688446884
throw new Error(
4688546885
"createRoot(...): Target container is not a DOM element."
@@ -46968,7 +46968,7 @@ if (__DEV__) {
4696846968

4696946969
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration =
4697046970
scheduleHydration;
46971-
function hydrateRoot$1(container, initialChildren, options) {
46971+
function hydrateRoot$2(container, initialChildren, options) {
4697246972
if (!isValidContainer(container)) {
4697346973
throw new Error(
4697446974
"hydrateRoot(...): Target container is not a DOM element."
@@ -47595,7 +47595,7 @@ if (__DEV__) {
4759547595
return createPortal$1(children, container, null, key);
4759647596
}
4759747597

47598-
function createRoot(container, options) {
47598+
function createRoot$1(container, options) {
4759947599
{
4760047600
if (!Internals.usingClientEntryPoint && !false) {
4760147601
error(
@@ -47605,10 +47605,10 @@ if (__DEV__) {
4760547605
}
4760647606
}
4760747607

47608-
return createRoot$1(container, options);
47608+
return createRoot$2(container, options);
4760947609
}
4761047610

47611-
function hydrateRoot(container, initialChildren, options) {
47611+
function hydrateRoot$1(container, initialChildren, options) {
4761247612
{
4761347613
if (!Internals.usingClientEntryPoint && !false) {
4761447614
error(
@@ -47618,7 +47618,7 @@ if (__DEV__) {
4761847618
}
4761947619
}
4762047620

47621-
return hydrateRoot$1(container, initialChildren, options);
47621+
return hydrateRoot$2(container, initialChildren, options);
4762247622
} // Overload the definition to the two valid signatures.
4762347623
// Warning, this opts-out of checking the function body.
4762447624
// eslint-disable-next-line no-redeclare
@@ -47681,6 +47681,33 @@ if (__DEV__) {
4768147681
}
4768247682
}
4768347683

47684+
function createRoot(container, options) {
47685+
{
47686+
Internals.usingClientEntryPoint = true;
47687+
}
47688+
47689+
try {
47690+
return createRoot$1(container, options);
47691+
} finally {
47692+
{
47693+
Internals.usingClientEntryPoint = false;
47694+
}
47695+
}
47696+
}
47697+
function hydrateRoot(container, children, options) {
47698+
{
47699+
Internals.usingClientEntryPoint = true;
47700+
}
47701+
47702+
try {
47703+
return hydrateRoot$1(container, children, options);
47704+
} finally {
47705+
{
47706+
Internals.usingClientEntryPoint = false;
47707+
}
47708+
}
47709+
}
47710+
4768447711
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
4768547712
exports.createComponentSelector = createComponentSelector;
4768647713
exports.createHasPseudoClassSelector = createHasPseudoClassSelector;
@@ -47705,7 +47732,6 @@ if (__DEV__) {
4770547732
exports.preloadModule = preloadModule;
4770647733
exports.unstable_batchedUpdates = batchedUpdates$1;
4770747734
exports.unstable_createEventHandle = createEventHandle;
47708-
exports.unstable_runWithPriority = runWithPriority;
4770947735
exports.useFormState = useFormState;
4771047736
exports.useFormStatus = useFormStatus;
4771147737
exports.version = ReactVersion;

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

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12978,14 +12978,14 @@ var isInputEventSupported = !1;
1297812978
if (canUseDOM) {
1297912979
var JSCompiler_inline_result$jscomp$347;
1298012980
if (canUseDOM) {
12981-
var isSupported$jscomp$inline_1561 = "oninput" in document;
12982-
if (!isSupported$jscomp$inline_1561) {
12983-
var element$jscomp$inline_1562 = document.createElement("div");
12984-
element$jscomp$inline_1562.setAttribute("oninput", "return;");
12985-
isSupported$jscomp$inline_1561 =
12986-
"function" === typeof element$jscomp$inline_1562.oninput;
12981+
var isSupported$jscomp$inline_1559 = "oninput" in document;
12982+
if (!isSupported$jscomp$inline_1559) {
12983+
var element$jscomp$inline_1560 = document.createElement("div");
12984+
element$jscomp$inline_1560.setAttribute("oninput", "return;");
12985+
isSupported$jscomp$inline_1559 =
12986+
"function" === typeof element$jscomp$inline_1560.oninput;
1298712987
}
12988-
JSCompiler_inline_result$jscomp$347 = isSupported$jscomp$inline_1561;
12988+
JSCompiler_inline_result$jscomp$347 = isSupported$jscomp$inline_1559;
1298912989
} else JSCompiler_inline_result$jscomp$347 = !1;
1299012990
isInputEventSupported =
1299112991
JSCompiler_inline_result$jscomp$347 &&
@@ -13297,20 +13297,20 @@ function registerSimpleEvent(domEventName, reactName) {
1329713297
registerTwoPhaseEvent(reactName, [domEventName]);
1329813298
}
1329913299
for (
13300-
var i$jscomp$inline_1602 = 0;
13301-
i$jscomp$inline_1602 < simpleEventPluginEvents.length;
13302-
i$jscomp$inline_1602++
13300+
var i$jscomp$inline_1600 = 0;
13301+
i$jscomp$inline_1600 < simpleEventPluginEvents.length;
13302+
i$jscomp$inline_1600++
1330313303
) {
13304-
var eventName$jscomp$inline_1603 =
13305-
simpleEventPluginEvents[i$jscomp$inline_1602],
13306-
domEventName$jscomp$inline_1604 =
13307-
eventName$jscomp$inline_1603.toLowerCase(),
13308-
capitalizedEvent$jscomp$inline_1605 =
13309-
eventName$jscomp$inline_1603[0].toUpperCase() +
13310-
eventName$jscomp$inline_1603.slice(1);
13304+
var eventName$jscomp$inline_1601 =
13305+
simpleEventPluginEvents[i$jscomp$inline_1600],
13306+
domEventName$jscomp$inline_1602 =
13307+
eventName$jscomp$inline_1601.toLowerCase(),
13308+
capitalizedEvent$jscomp$inline_1603 =
13309+
eventName$jscomp$inline_1601[0].toUpperCase() +
13310+
eventName$jscomp$inline_1601.slice(1);
1331113311
registerSimpleEvent(
13312-
domEventName$jscomp$inline_1604,
13313-
"on" + capitalizedEvent$jscomp$inline_1605
13312+
domEventName$jscomp$inline_1602,
13313+
"on" + capitalizedEvent$jscomp$inline_1603
1331413314
);
1331513315
}
1331613316
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16921,17 +16921,17 @@ Internals.Events = [
1692116921
restoreStateIfNeeded,
1692216922
batchedUpdates$1
1692316923
];
16924-
var devToolsConfig$jscomp$inline_1828 = {
16924+
var devToolsConfig$jscomp$inline_1804 = {
1692516925
findFiberByHostInstance: getClosestInstanceFromNode,
1692616926
bundleType: 0,
16927-
version: "18.3.0-www-classic-b3341fd5",
16927+
version: "18.3.0-www-classic-9a4a2139",
1692816928
rendererPackageName: "react-dom"
1692916929
};
16930-
var internals$jscomp$inline_2179 = {
16931-
bundleType: devToolsConfig$jscomp$inline_1828.bundleType,
16932-
version: devToolsConfig$jscomp$inline_1828.version,
16933-
rendererPackageName: devToolsConfig$jscomp$inline_1828.rendererPackageName,
16934-
rendererConfig: devToolsConfig$jscomp$inline_1828.rendererConfig,
16930+
var internals$jscomp$inline_2157 = {
16931+
bundleType: devToolsConfig$jscomp$inline_1804.bundleType,
16932+
version: devToolsConfig$jscomp$inline_1804.version,
16933+
rendererPackageName: devToolsConfig$jscomp$inline_1804.rendererPackageName,
16934+
rendererConfig: devToolsConfig$jscomp$inline_1804.rendererConfig,
1693516935
overrideHookState: null,
1693616936
overrideHookStateDeletePath: null,
1693716937
overrideHookStateRenamePath: null,
@@ -16947,26 +16947,26 @@ var internals$jscomp$inline_2179 = {
1694716947
return null === fiber ? null : fiber.stateNode;
1694816948
},
1694916949
findFiberByHostInstance:
16950-
devToolsConfig$jscomp$inline_1828.findFiberByHostInstance ||
16950+
devToolsConfig$jscomp$inline_1804.findFiberByHostInstance ||
1695116951
emptyFindFiberByHostInstance,
1695216952
findHostInstancesForRefresh: null,
1695316953
scheduleRefresh: null,
1695416954
scheduleRoot: null,
1695516955
setRefreshHandler: null,
1695616956
getCurrentFiber: null,
16957-
reconcilerVersion: "18.3.0-www-classic-b3341fd5"
16957+
reconcilerVersion: "18.3.0-www-classic-9a4a2139"
1695816958
};
1695916959
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
16960-
var hook$jscomp$inline_2180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
16960+
var hook$jscomp$inline_2158 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1696116961
if (
16962-
!hook$jscomp$inline_2180.isDisabled &&
16963-
hook$jscomp$inline_2180.supportsFiber
16962+
!hook$jscomp$inline_2158.isDisabled &&
16963+
hook$jscomp$inline_2158.supportsFiber
1696416964
)
1696516965
try {
16966-
(rendererID = hook$jscomp$inline_2180.inject(
16967-
internals$jscomp$inline_2179
16966+
(rendererID = hook$jscomp$inline_2158.inject(
16967+
internals$jscomp$inline_2157
1696816968
)),
16969-
(injectedHook = hook$jscomp$inline_2180);
16969+
(injectedHook = hook$jscomp$inline_2158);
1697016970
} catch (err) {}
1697116971
}
1697216972
assign(Internals, {
@@ -17183,7 +17183,7 @@ exports.hydrate = function (element, container, callback) {
1718317183
callback
1718417184
);
1718517185
};
17186-
exports.hydrateRoot = function (container, initialChildren, options) {
17186+
exports.hydrateRoot = function (container, children, options) {
1718717187
if (!isValidContainer(container)) throw Error(formatProdErrorMessage(405));
1718817188
var isStrictMode = !1,
1718917189
concurrentUpdatesByDefaultOverride = !1,
@@ -17201,8 +17201,8 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1720117201
(onRecoverableError = options.onRecoverableError),
1720217202
void 0 !== options.unstable_transitionCallbacks &&
1720317203
(transitionCallbacks = options.unstable_transitionCallbacks));
17204-
initialChildren = createHydrationContainer(
17205-
initialChildren,
17204+
children = createHydrationContainer(
17205+
children,
1720617206
null,
1720717207
container,
1720817208
1,
@@ -17214,10 +17214,10 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1721417214
transitionCallbacks,
1721517215
null
1721617216
);
17217-
container[internalContainerInstanceKey] = initialChildren.current;
17217+
container[internalContainerInstanceKey] = children.current;
1721817218
Dispatcher$1.current = ReactDOMClientDispatcher;
1721917219
listenToAllSupportedEvents(container);
17220-
return new ReactDOMHydrationRoot(initialChildren);
17220+
return new ReactDOMHydrationRoot(children);
1722117221
};
1722217222
exports.observeVisibleRects = function (
1722317223
hostRoot,
@@ -17442,4 +17442,4 @@ exports.useFormState = function () {
1744217442
exports.useFormStatus = function () {
1744317443
throw Error(formatProdErrorMessage(248));
1744417444
};
17445-
exports.version = "18.3.0-www-classic-b3341fd5";
17445+
exports.version = "18.3.0-www-classic-9a4a2139";

0 commit comments

Comments
 (0)