Skip to content

Commit

Permalink
Remove unused lastFullyObservedContext (#31435)
Browse files Browse the repository at this point in the history
DiffTrain build for [66855b9](66855b9)
  • Loading branch information
sophiebits committed Nov 6, 2024
1 parent e726549 commit f2a54ca
Show file tree
Hide file tree
Showing 23 changed files with 370 additions and 505 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-31496856-20241106
19.0.0-native-fb-66855b96-20241106
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3a4aa78aa340528e4b1179f67d0afe39>>
* @generated SignedSource<<41e8d2e26be06713675a9eaf0808b2ad>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-31496856-20241106";
exports.version = "19.0.0-native-fb-66855b96-20241106";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<41bb5292902905fd6f742da06dbd263a>>
* @generated SignedSource<<67f9de1fb639337086bdff0fcfe5c8fe>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-31496856-20241106";
exports.version = "19.0.0-native-fb-66855b96-20241106";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<41bb5292902905fd6f742da06dbd263a>>
* @generated SignedSource<<67f9de1fb639337086bdff0fcfe5c8fe>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-31496856-20241106";
exports.version = "19.0.0-native-fb-66855b96-20241106";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5c7c07a82d9e7ddd3dafe23a1c8f6bbf>>
* @generated SignedSource<<7614057aa0ac463da717b29ec88bf13e>>
*/

/*
Expand Down Expand Up @@ -10616,10 +10616,7 @@ __DEV__ &&
);
}
function resetContextDependencies() {
lastFullyObservedContext =
lastContextDependency =
currentlyRenderingFiber =
null;
lastContextDependency = currentlyRenderingFiber = null;
isDisallowedContextReadInDEV = !1;
}
function pushProvider(providerFiber, context, nextValue) {
Expand Down Expand Up @@ -10794,7 +10791,7 @@ __DEV__ &&
}
function prepareToReadContext(workInProgress) {
currentlyRenderingFiber = workInProgress;
lastFullyObservedContext = lastContextDependency = null;
lastContextDependency = null;
workInProgress = workInProgress.dependencies;
null !== workInProgress && (workInProgress.firstContext = null);
}
Expand All @@ -10811,23 +10808,20 @@ __DEV__ &&
}
function readContextForConsumer(consumer, context) {
var value = context._currentValue;
if (lastFullyObservedContext !== context)
if (
((context = { context: context, memoizedValue: value, next: null }),
null === lastContextDependency)
) {
if (null === consumer)
throw Error(
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
);
lastContextDependency = context;
consumer.dependencies = {
lanes: 0,
firstContext: context,
_debugThenableState: null
};
consumer.flags |= 524288;
} else lastContextDependency = lastContextDependency.next = context;
context = { context: context, memoizedValue: value, next: null };
if (null === lastContextDependency) {
if (null === consumer)
throw Error(
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
);
lastContextDependency = context;
consumer.dependencies = {
lanes: 0,
firstContext: context,
_debugThenableState: null
};
consumer.flags |= 524288;
} else lastContextDependency = lastContextDependency.next = context;
return value;
}
function initializeUpdateQueue(fiber) {
Expand Down Expand Up @@ -24677,7 +24671,6 @@ __DEV__ &&
var rendererSigil = {};
var currentlyRenderingFiber = null,
lastContextDependency = null,
lastFullyObservedContext = null,
isDisallowedContextReadInDEV = !1,
UpdateState = 0,
ReplaceState = 1,
Expand Down Expand Up @@ -25337,11 +25330,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-31496856-20241106" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-66855b96-20241106" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-31496856-20241106\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-66855b96-20241106\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25378,11 +25371,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-31496856-20241106",
version: "19.0.0-native-fb-66855b96-20241106",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-31496856-20241106"
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25526,5 +25519,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-31496856-20241106";
exports.version = "19.0.0-native-fb-66855b96-20241106";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<553087126eb89b6aa26ee83eedb9ef11>>
* @generated SignedSource<<38668b12aae1b91e6fc1959969bfecd9>>
*/

/*
Expand Down Expand Up @@ -7452,14 +7452,7 @@ function beginWork(current, workInProgress, renderLanes) {
}
var valueCursor = createCursor(null),
currentlyRenderingFiber = null,
lastContextDependency = null,
lastFullyObservedContext = null;
function resetContextDependencies() {
lastFullyObservedContext =
lastContextDependency =
currentlyRenderingFiber =
null;
}
lastContextDependency = null;
function pushProvider(providerFiber, context, nextValue) {
push(valueCursor, context._currentValue);
context._currentValue = nextValue;
Expand Down Expand Up @@ -7602,7 +7595,7 @@ function checkIfContextChanged(currentDependencies) {
}
function prepareToReadContext(workInProgress) {
currentlyRenderingFiber = workInProgress;
lastFullyObservedContext = lastContextDependency = null;
lastContextDependency = null;
workInProgress = workInProgress.dependencies;
null !== workInProgress && (workInProgress.firstContext = null);
}
Expand All @@ -7615,16 +7608,13 @@ function readContextDuringReconciliation(consumer, context) {
}
function readContextForConsumer(consumer, context) {
var value = context._currentValue;
if (lastFullyObservedContext !== context)
if (
((context = { context: context, memoizedValue: value, next: null }),
null === lastContextDependency)
) {
if (null === consumer) throw Error(formatProdErrorMessage(308));
lastContextDependency = context;
consumer.dependencies = { lanes: 0, firstContext: context };
consumer.flags |= 524288;
} else lastContextDependency = lastContextDependency.next = context;
context = { context: context, memoizedValue: value, next: null };
if (null === lastContextDependency) {
if (null === consumer) throw Error(formatProdErrorMessage(308));
lastContextDependency = context;
consumer.dependencies = { lanes: 0, firstContext: context };
consumer.flags |= 524288;
} else lastContextDependency = lastContextDependency.next = context;
return value;
}
var hasForceUpdate = !1;
Expand Down Expand Up @@ -11101,7 +11091,7 @@ function resetWorkInProgressStack() {
var interruptedWork = workInProgress.return;
else
(interruptedWork = workInProgress),
resetContextDependencies(),
(lastContextDependency = currentlyRenderingFiber = null),
resetHooksOnUnwind(interruptedWork),
(thenableState$1 = null),
(thenableIndexCounter$1 = 0),
Expand Down Expand Up @@ -11267,7 +11257,7 @@ function renderRootSync(root, lanes) {
}
while (1);
lanes && root.shellSuspendCounter++;
resetContextDependencies();
lastContextDependency = currentlyRenderingFiber = null;
executionContext = prevExecutionContext;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
Expand Down Expand Up @@ -11382,7 +11372,7 @@ function renderRootConcurrent(root, lanes) {
handleThrow(root, thrownValue$172);
}
while (1);
resetContextDependencies();
lastContextDependency = currentlyRenderingFiber = null;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
executionContext = prevExecutionContext;
Expand Down Expand Up @@ -11449,7 +11439,7 @@ function throwAndUnwindWorkLoop(
thrownValue,
suspendedReason
) {
resetContextDependencies();
lastContextDependency = currentlyRenderingFiber = null;
resetHooksOnUnwind(unitOfWork);
thenableState$1 = null;
thenableIndexCounter$1 = 0;
Expand Down Expand Up @@ -15626,14 +15616,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1691 = React.version;
if (
"19.0.0-native-fb-31496856-20241106" !==
"19.0.0-native-fb-66855b96-20241106" !==
isomorphicReactPackageVersion$jscomp$inline_1691
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1691,
"19.0.0-native-fb-31496856-20241106"
"19.0.0-native-fb-66855b96-20241106"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15653,25 +15643,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
null === componentOrElement ? null : componentOrElement.stateNode;
return componentOrElement;
};
var internals$jscomp$inline_2145 = {
var internals$jscomp$inline_2149 = {
bundleType: 0,
version: "19.0.0-native-fb-31496856-20241106",
version: "19.0.0-native-fb-66855b96-20241106",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-31496856-20241106"
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2146 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2150 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2146.isDisabled &&
hook$jscomp$inline_2146.supportsFiber
!hook$jscomp$inline_2150.isDisabled &&
hook$jscomp$inline_2150.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2146.inject(
internals$jscomp$inline_2145
(rendererID = hook$jscomp$inline_2150.inject(
internals$jscomp$inline_2149
)),
(injectedHook = hook$jscomp$inline_2146);
(injectedHook = hook$jscomp$inline_2150);
} catch (err) {}
}
exports.createRoot = function (container, options) {
Expand Down Expand Up @@ -15763,4 +15753,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-31496856-20241106";
exports.version = "19.0.0-native-fb-66855b96-20241106";
Loading

0 comments on commit f2a54ca

Please sign in to comment.