|
7 | 7 | * @noflow
|
8 | 8 | * @nolint
|
9 | 9 | * @preventMunge
|
10 |
| - * @generated SignedSource<<8b9b9798442c5728adfabb7cd8ca5f24>> |
| 10 | + * @generated SignedSource<<955b120cad9193034a86d0bde3df7d2a>> |
11 | 11 | */
|
12 | 12 |
|
13 | 13 | 'use strict';
|
@@ -949,6 +949,32 @@ function describeFunctionComponentFrame(fn) {
|
949 | 949 | }
|
950 | 950 | }
|
951 | 951 |
|
| 952 | +// TODO: Consider marking the whole bundle instead of these boundaries. |
| 953 | + |
| 954 | +/** @noinline */ |
| 955 | + |
| 956 | +function callComponentInDEV(Component, props, secondArg) { |
| 957 | + setIsRendering(true); |
| 958 | + var result = Component(props, secondArg); |
| 959 | + setIsRendering(false); |
| 960 | + return result; |
| 961 | +} |
| 962 | +/** @noinline */ |
| 963 | + |
| 964 | +function callRenderInDEV(instance) { |
| 965 | + setIsRendering(true); |
| 966 | + var result = instance.render(); |
| 967 | + setIsRendering(false); |
| 968 | + return result; |
| 969 | +} |
| 970 | +/** @noinline */ |
| 971 | + |
| 972 | +function callLazyInitInDEV(lazy) { |
| 973 | + var payload = lazy._payload; |
| 974 | + var init = lazy._init; |
| 975 | + return init(payload); |
| 976 | +} |
| 977 | + |
952 | 978 | function describeFiber(fiber) {
|
953 | 979 | switch (fiber.tag) {
|
954 | 980 | case HostHoistable:
|
@@ -1021,8 +1047,6 @@ function getCurrentFiberStackInDev() {
|
1021 | 1047 | if (current === null) {
|
1022 | 1048 | return '';
|
1023 | 1049 | } // Safe because if current fiber exists, we are reconciling,
|
1024 |
| - // and it is guaranteed to be the work-in-progress version. |
1025 |
| - |
1026 | 1050 |
|
1027 | 1051 | return getStackByFiberInDevAndProd(current);
|
1028 | 1052 | }
|
@@ -5812,9 +5836,9 @@ function warnOnSymbolType(returnFiber, invalidChild) {
|
5812 | 5836 | }
|
5813 | 5837 |
|
5814 | 5838 | function resolveLazy(lazyType) {
|
5815 |
| - var payload = lazyType._payload; |
5816 |
| - var init = lazyType._init; |
5817 |
| - return init(payload); |
| 5839 | + { |
| 5840 | + return callLazyInitInDEV(lazyType); |
| 5841 | + } |
5818 | 5842 | } // This wrapper function exists because I expect to clone the code in each path
|
5819 | 5843 | // to be able to optimize each path individually by branching early. This needs
|
5820 | 5844 | // a compiler or we can do it manually. Helpers that don't need this branching
|
@@ -6086,9 +6110,13 @@ function createChildReconciler(shouldTrackSideEffects) {
|
6086 | 6110 |
|
6087 | 6111 | case REACT_LAZY_TYPE:
|
6088 | 6112 | {
|
6089 |
| - var payload = newChild._payload; |
6090 |
| - var init = newChild._init; |
6091 |
| - return createChild(returnFiber, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo) // call merge after init |
| 6113 | + var resolvedChild; |
| 6114 | + |
| 6115 | + { |
| 6116 | + resolvedChild = callLazyInitInDEV(newChild); |
| 6117 | + } |
| 6118 | + |
| 6119 | + return createChild(returnFiber, resolvedChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo) // call merge after init |
6092 | 6120 | );
|
6093 | 6121 | }
|
6094 | 6122 | }
|
@@ -6172,9 +6200,13 @@ function createChildReconciler(shouldTrackSideEffects) {
|
6172 | 6200 |
|
6173 | 6201 | case REACT_LAZY_TYPE:
|
6174 | 6202 | {
|
6175 |
| - var payload = newChild._payload; |
6176 |
| - var init = newChild._init; |
6177 |
| - return updateSlot(returnFiber, oldFiber, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); |
| 6203 | + var resolvedChild; |
| 6204 | + |
| 6205 | + { |
| 6206 | + resolvedChild = callLazyInitInDEV(newChild); |
| 6207 | + } |
| 6208 | + |
| 6209 | + return updateSlot(returnFiber, oldFiber, resolvedChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); |
6178 | 6210 | }
|
6179 | 6211 | }
|
6180 | 6212 |
|
@@ -6241,9 +6273,15 @@ function createChildReconciler(shouldTrackSideEffects) {
|
6241 | 6273 | }
|
6242 | 6274 |
|
6243 | 6275 | case REACT_LAZY_TYPE:
|
6244 |
| - var payload = newChild._payload; |
6245 |
| - var init = newChild._init; |
6246 |
| - return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); |
| 6276 | + { |
| 6277 | + var resolvedChild; |
| 6278 | + |
| 6279 | + { |
| 6280 | + resolvedChild = callLazyInitInDEV(newChild); |
| 6281 | + } |
| 6282 | + |
| 6283 | + return updateFromMap(existingChildren, returnFiber, newIdx, resolvedChild, lanes, mergeDebugInfo(debugInfo, newChild._debugInfo)); |
| 6284 | + } |
6247 | 6285 | }
|
6248 | 6286 |
|
6249 | 6287 | if (isArray(newChild) || getIteratorFn(newChild) || enableAsyncIterableChildren ) {
|
@@ -6317,10 +6355,16 @@ function createChildReconciler(shouldTrackSideEffects) {
|
6317 | 6355 | break;
|
6318 | 6356 |
|
6319 | 6357 | case REACT_LAZY_TYPE:
|
6320 |
| - var payload = child._payload; |
6321 |
| - var init = child._init; |
6322 |
| - warnOnInvalidKey(init(payload), knownKeys, returnFiber); |
6323 |
| - break; |
| 6358 | + { |
| 6359 | + var resolvedChild; |
| 6360 | + |
| 6361 | + { |
| 6362 | + resolvedChild = callLazyInitInDEV(child); |
| 6363 | + } |
| 6364 | + |
| 6365 | + warnOnInvalidKey(resolvedChild, knownKeys, returnFiber); |
| 6366 | + break; |
| 6367 | + } |
6324 | 6368 | }
|
6325 | 6369 | }
|
6326 | 6370 |
|
@@ -7444,7 +7488,7 @@ function renderWithHooks(current, workInProgress, Component, props, secondArg, n
|
7444 | 7488 |
|
7445 | 7489 | var shouldDoubleRenderDEV = debugRenderPhaseSideEffectsForStrictMode ;
|
7446 | 7490 | shouldDoubleInvokeUserFnsInHooksDEV = shouldDoubleRenderDEV;
|
7447 |
| - var children = Component(props, secondArg); |
| 7491 | + var children = callComponentInDEV(Component, props, secondArg) ; |
7448 | 7492 | shouldDoubleInvokeUserFnsInHooksDEV = false; // Check if there was a render phase update
|
7449 | 7493 |
|
7450 | 7494 | if (didScheduleRenderPhaseUpdateDuringThisPass) {
|
@@ -7584,7 +7628,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
7584 | 7628 | }
|
7585 | 7629 |
|
7586 | 7630 | ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV ;
|
7587 |
| - children = Component(props, secondArg); |
| 7631 | + children = callComponentInDEV(Component, props, secondArg) ; |
7588 | 7632 | } while (didScheduleRenderPhaseUpdateDuringThisPass);
|
7589 | 7633 |
|
7590 | 7634 | return children;
|
@@ -12300,9 +12344,7 @@ function updateForwardRef(current, workInProgress, Component, nextProps, renderL
|
12300 | 12344 | }
|
12301 | 12345 |
|
12302 | 12346 | {
|
12303 |
| - setIsRendering(true); |
12304 | 12347 | nextChildren = renderWithHooks(current, workInProgress, render, propsWithoutRef, ref, renderLanes);
|
12305 |
| - setIsRendering(false); |
12306 | 12348 | }
|
12307 | 12349 |
|
12308 | 12350 | {
|
@@ -12769,9 +12811,7 @@ function updateFunctionComponent(current, workInProgress, Component, nextProps,
|
12769 | 12811 | }
|
12770 | 12812 |
|
12771 | 12813 | {
|
12772 |
| - setIsRendering(true); |
12773 | 12814 | nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);
|
12774 |
| - setIsRendering(false); |
12775 | 12815 | }
|
12776 | 12816 |
|
12777 | 12817 | {
|
@@ -12942,10 +12982,7 @@ function finishClassComponent(current, workInProgress, Component, shouldUpdate,
|
12942 | 12982 | }
|
12943 | 12983 |
|
12944 | 12984 | {
|
12945 |
| - setIsRendering(true); |
12946 |
| - nextChildren = instance.render(); |
12947 |
| - |
12948 |
| - setIsRendering(false); |
| 12985 | + nextChildren = callRenderInDEV(instance); |
12949 | 12986 | }
|
12950 | 12987 |
|
12951 | 12988 | {
|
@@ -13106,9 +13143,12 @@ function mountLazyComponent(_current, workInProgress, elementType, renderLanes)
|
13106 | 13143 | resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);
|
13107 | 13144 | var props = workInProgress.pendingProps;
|
13108 | 13145 | var lazyComponent = elementType;
|
13109 |
| - var payload = lazyComponent._payload; |
13110 |
| - var init = lazyComponent._init; |
13111 |
| - var Component = init(payload); // Store the unwrapped component in the type. |
| 13146 | + var Component; |
| 13147 | + |
| 13148 | + { |
| 13149 | + Component = callLazyInitInDEV(lazyComponent); |
| 13150 | + } // Store the unwrapped component in the type. |
| 13151 | + |
13112 | 13152 |
|
13113 | 13153 | workInProgress.type = Component;
|
13114 | 13154 |
|
@@ -14216,9 +14256,7 @@ function updateContextConsumer(current, workInProgress, renderLanes) {
|
14216 | 14256 | var newChildren;
|
14217 | 14257 |
|
14218 | 14258 | {
|
14219 |
| - setIsRendering(true); |
14220 |
| - newChildren = render(newValue); |
14221 |
| - setIsRendering(false); |
| 14259 | + newChildren = callComponentInDEV(render, newValue, undefined); |
14222 | 14260 | }
|
14223 | 14261 |
|
14224 | 14262 | {
|
@@ -14558,7 +14596,9 @@ function beginWork(current, workInProgress, renderLanes) {
|
14558 | 14596 | {
|
14559 | 14597 | if (workInProgress._debugNeedsRemount && current !== null) {
|
14560 | 14598 | // This will restart the begin phase with a new fiber.
|
14561 |
| - return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); |
| 14599 | + var copiedFiber = createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes); |
| 14600 | + |
| 14601 | + return remountFiber(current, workInProgress, copiedFiber); |
14562 | 14602 | }
|
14563 | 14603 | }
|
14564 | 14604 |
|
@@ -22900,6 +22940,7 @@ function FiberNode(tag, pendingProps, key, mode) {
|
22900 | 22940 | // This isn't directly used but is handy for debugging internals:
|
22901 | 22941 | this._debugInfo = null;
|
22902 | 22942 | this._debugOwner = null;
|
| 22943 | + |
22903 | 22944 | this._debugNeedsRemount = false;
|
22904 | 22945 | this._debugHookTypes = null;
|
22905 | 22946 |
|
@@ -22956,6 +22997,7 @@ function createWorkInProgress(current, pendingProps) {
|
22956 | 22997 | {
|
22957 | 22998 | // DEV-only fields
|
22958 | 22999 | workInProgress._debugOwner = current._debugOwner;
|
| 23000 | + |
22959 | 23001 | workInProgress._debugHookTypes = current._debugHookTypes;
|
22960 | 23002 | }
|
22961 | 23003 |
|
@@ -23463,7 +23505,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
23463 | 23505 | return root;
|
23464 | 23506 | }
|
23465 | 23507 |
|
23466 |
| -var ReactVersion = '19.0.0-rc-5a18a922'; |
| 23508 | +var ReactVersion = '19.0.0-rc-999503d6'; |
23467 | 23509 |
|
23468 | 23510 | /*
|
23469 | 23511 | * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
|
0 commit comments