Skip to content

Commit

Permalink
[RN] Set enableOwnerStacks and enableUseDeferredValueInitialArg to false
Browse files Browse the repository at this point in the history
In www, the experimental versions get a .modern.js or .classic.js prefix
and get copied into the same folder. In RN, they don't seem to have
.modern.js and .classic.js versions so they end up getting the same
name.

sebmarkbage's theory is that what happens is that they then override
the file that was already there. So depending on if experimental or
stable build finishes first you get a different version at the end.

It doesn't make sense to use `__EXPERIMENTAL__` for flags in native-fb
since there's no modern/classic split there. So that flag should just be
hardcoded to true or false and then it doesn't matter which one finishes
first.

We don't support experimental builds in OSS RN neither so the same thing
could happen with
[`enableOwnerStacks`](https://github.com/facebook/react/blob/5dcf3ca8d45a276a8b4cee0cedd234967661ca35/packages/shared/forks/ReactFeatureFlags.native-oss.js#L60).

You can see that the build errors in the previous PR but passes after
these flag changes.

ghstack-source-id: d10f37bcea0e485fdb4f136370c179999badd560
Pull Request resolved: #30322

DiffTrain build for commit ff3f1fa.
  • Loading branch information
poteto committed Jul 12, 2024
1 parent 1c54b5d commit 981fe2b
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 136 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-433068ee-20240711
19.0.0-native-fb-ff3f1fac-20240712
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<333ee47fc63e94412bc1786f307125aa>>
* @generated SignedSource<<a55b3ae9fc483a5ea92aaa34fe44b5df>>
*/

"use strict";
__DEV__ &&
(function () {
function JSCompiler_object_inline_createNodeMock_1106() {
function JSCompiler_object_inline_createNodeMock_1089() {
return null;
}
function findHook(fiber, id) {
Expand Down Expand Up @@ -4693,38 +4693,50 @@ __DEV__ &&
hook.memoizedState = [prevState, deps];
return prevState;
}
function mountDeferredValue(value) {
mountWorkInProgressHook().memoizedState = value;
return value;
function mountDeferredValue(value, initialValue) {
var hook = mountWorkInProgressHook();
return mountDeferredValueImpl(hook, value, initialValue);
}
function updateDeferredValue(value) {
function updateDeferredValue(value, initialValue) {
var hook = updateWorkInProgressHook();
return updateDeferredValueImpl(hook, currentHook.memoizedState, value);
return updateDeferredValueImpl(
hook,
currentHook.memoizedState,
value,
initialValue
);
}
function rerenderDeferredValue(value) {
function rerenderDeferredValue(value, initialValue) {
var hook = updateWorkInProgressHook();
return null === currentHook
? ((hook.memoizedState = value), value)
: updateDeferredValueImpl(hook, currentHook.memoizedState, value);
? mountDeferredValueImpl(hook, value, initialValue)
: updateDeferredValueImpl(
hook,
currentHook.memoizedState,
value,
initialValue
);
}
function updateDeferredValueImpl(hook, prevValue, value) {
function mountDeferredValueImpl(hook, value, initialValue) {
if (void 0 === initialValue || 0 !== (renderLanes & DeferredLane))
return (hook.memoizedState = value);
hook.memoizedState = initialValue;
hook = requestDeferredLane();
currentlyRenderingFiber$1.lanes |= hook;
workInProgressRootSkippedLanes |= hook;
return initialValue;
}
function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
if (objectIs(value, prevValue)) return value;
if (null !== currentTreeHiddenStackCursor.current)
return (
(hook.memoizedState = value),
objectIs(value, prevValue) || (didReceiveUpdate = !0),
value
(hook = mountDeferredValueImpl(hook, value, initialValue)),
objectIs(hook, prevValue) || (didReceiveUpdate = !0),
hook
);
if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane)))
return (didReceiveUpdate = !0), (hook.memoizedState = value);
0 === workInProgressDeferredLane &&
(workInProgressDeferredLane =
0 !== (workInProgressRootRenderLanes & OffscreenLane)
? OffscreenLane
: claimNextTransitionLane());
hook = suspenseHandlerStackCursor.current;
null !== hook && (hook.flags |= 32);
hook = workInProgressDeferredLane;
hook = requestDeferredLane();
currentlyRenderingFiber$1.lanes |= hook;
workInProgressRootSkippedLanes |= hook;
return prevValue;
Expand Down Expand Up @@ -10680,6 +10692,16 @@ __DEV__ &&
: DefaultEventPriority;
return fiber;
}
function requestDeferredLane() {
0 === workInProgressDeferredLane &&
(workInProgressDeferredLane =
0 !== (workInProgressRootRenderLanes & OffscreenLane)
? OffscreenLane
: claimNextTransitionLane());
var suspenseHandler = suspenseHandlerStackCursor.current;
null !== suspenseHandler && (suspenseHandler.flags |= 32);
return workInProgressDeferredLane;
}
function scheduleUpdateOnFiber(root, fiber, lane) {
isRunningInsertionEffect &&
error$jscomp$0("useInsertionEffect must not schedule updates.");
Expand Down Expand Up @@ -13776,10 +13798,10 @@ __DEV__ &&
currentHookNameInDev = "useDebugValue";
mountHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
mountHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -13901,10 +13923,10 @@ __DEV__ &&
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -14031,10 +14053,10 @@ __DEV__ &&
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return updateDeferredValue(value);
return updateDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -14156,10 +14178,10 @@ __DEV__ &&
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return rerenderDeferredValue(value);
return rerenderDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -14296,11 +14318,11 @@ __DEV__ &&
warnInvalidHookAccess();
mountHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
mountHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -14450,11 +14472,11 @@ __DEV__ &&
warnInvalidHookAccess();
updateHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return updateDeferredValue(value);
return updateDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -14601,11 +14623,11 @@ __DEV__ &&
warnInvalidHookAccess();
updateHookTypesDev();
},
useDeferredValue: function (value) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderDeferredValue(value);
return rerenderDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -15169,20 +15191,20 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-native-fb-433068ee-20240711"
reconcilerVersion: "19.0.0-native-fb-ff3f1fac-20240712"
});
})({
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 1,
version: "19.0.0-native-fb-433068ee-20240711",
version: "19.0.0-native-fb-ff3f1fac-20240712",
rendererPackageName: "react-test-renderer"
});
exports._Scheduler = Scheduler;
exports.act = act;
exports.create = function (element, options) {
var createNodeMock = JSCompiler_object_inline_createNodeMock_1106,
var createNodeMock = JSCompiler_object_inline_createNodeMock_1089,
isConcurrent = !1,
isStrictMode = !1,
concurrentUpdatesByDefault = null;
Expand Down
Loading

0 comments on commit 981fe2b

Please sign in to comment.