Skip to content

Commit 52d9721

Browse files
committed
Ship enableFabricCompleteRootInCommitPhase (facebook#33064)
This was shipped internally. Cleaning up the flag. DiffTrain build for [edf550b](facebook@edf550b)
1 parent d3f70d8 commit 52d9721

35 files changed

+134
-89
lines changed

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45843,19 +45843,42 @@ const EMPTY = new Empty();
4584345843
function pruneHoistedContexts(fn) {
4584445844
visitReactiveFunction(fn, new Visitor$8(), {
4584545845
activeScopes: empty(),
45846+
uninitialized: new Map(),
4584645847
});
4584745848
}
4584845849
let Visitor$8 = class Visitor extends ReactiveFunctionTransform {
4584945850
visitScope(scope, state) {
4585045851
state.activeScopes = state.activeScopes.push(new Set(scope.scope.declarations.keys()));
45852+
for (const decl of scope.scope.declarations.values()) {
45853+
state.uninitialized.set(decl.identifier.id, { kind: 'unknown-kind' });
45854+
}
4585145855
this.traverseScope(scope, state);
4585245856
state.activeScopes.pop();
45857+
for (const decl of scope.scope.declarations.values()) {
45858+
state.uninitialized.delete(decl.identifier.id);
45859+
}
45860+
}
45861+
visitPlace(_id, place, state) {
45862+
const maybeHoistedFn = state.uninitialized.get(place.identifier.id);
45863+
if ((maybeHoistedFn === null || maybeHoistedFn === void 0 ? void 0 : maybeHoistedFn.kind) === 'func' &&
45864+
maybeHoistedFn.definition !== place) {
45865+
CompilerError.throwTodo({
45866+
reason: '[PruneHoistedContexts] Rewrite hoisted function references',
45867+
loc: place.loc,
45868+
});
45869+
}
4585345870
}
4585445871
transformInstruction(instruction, state) {
45855-
this.visitInstruction(instruction, state);
4585645872
if (instruction.value.kind === 'DeclareContext') {
4585745873
const maybeNonHoisted = convertHoistedLValueKind(instruction.value.lvalue.kind);
4585845874
if (maybeNonHoisted != null) {
45875+
if (maybeNonHoisted === InstructionKind.Function &&
45876+
state.uninitialized.has(instruction.value.lvalue.place.identifier.id)) {
45877+
state.uninitialized.set(instruction.value.lvalue.place.identifier.id, {
45878+
kind: 'func',
45879+
definition: null,
45880+
});
45881+
}
4585945882
return { kind: 'remove' };
4586045883
}
4586145884
}
@@ -45864,9 +45887,31 @@ let Visitor$8 = class Visitor extends ReactiveFunctionTransform {
4586445887
const lvalueId = instruction.value.lvalue.place.identifier.id;
4586545888
const isDeclaredByScope = state.activeScopes.find(scope => scope.has(lvalueId));
4586645889
if (isDeclaredByScope) {
45867-
instruction.value.lvalue.kind = InstructionKind.Reassign;
45890+
if (instruction.value.lvalue.kind === InstructionKind.Let ||
45891+
instruction.value.lvalue.kind === InstructionKind.Const) {
45892+
instruction.value.lvalue.kind = InstructionKind.Reassign;
45893+
}
45894+
else if (instruction.value.lvalue.kind === InstructionKind.Function) {
45895+
const maybeHoistedFn = state.uninitialized.get(lvalueId);
45896+
if (maybeHoistedFn != null) {
45897+
CompilerError.invariant(maybeHoistedFn.kind === 'func', {
45898+
reason: '[PruneHoistedContexts] Unexpected hoisted function',
45899+
loc: instruction.loc,
45900+
});
45901+
maybeHoistedFn.definition = instruction.value.lvalue.place;
45902+
state.uninitialized.delete(lvalueId);
45903+
}
45904+
}
45905+
else {
45906+
CompilerError.throwTodo({
45907+
reason: '[PruneHoistedContexts] Unexpected kind',
45908+
description: `(${instruction.value.lvalue.kind})`,
45909+
loc: instruction.loc,
45910+
});
45911+
}
4586845912
}
4586945913
}
45914+
this.visitInstruction(instruction, state);
4587045915
return { kind: 'keep' };
4587145916
}
4587245917
};
@@ -60153,7 +60198,7 @@ const rule = {
6015360198
docs: {
6015460199
description: 'enforces the Rules of Hooks',
6015560200
recommended: true,
60156-
url: 'https://reactjs.org/docs/hooks-rules.html',
60201+
url: 'https://react.dev/reference/rules/rules-of-hooks',
6015760202
},
6015860203
},
6015960204
create(context) {

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0db8db178c1521f979535bdba32bf9db9f47ca05
1+
edf550b67936f2c62534ad5549bf580a4f581bd8
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0db8db178c1521f979535bdba32bf9db9f47ca05
1+
edf550b67936f2c62534ad5549bf580a4f581bd8

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ __DEV__ &&
15381538
exports.useTransition = function () {
15391539
return resolveDispatcher().useTransition();
15401540
};
1541-
exports.version = "19.2.0-www-classic-0db8db17-20250503";
1541+
exports.version = "19.2.0-www-classic-edf550b6-20250505";
15421542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15431543
"function" ===
15441544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ __DEV__ &&
15381538
exports.useTransition = function () {
15391539
return resolveDispatcher().useTransition();
15401540
};
1541-
exports.version = "19.2.0-www-modern-0db8db17-20250503";
1541+
exports.version = "19.2.0-www-modern-edf550b6-20250505";
15421542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15431543
"function" ===
15441544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,4 +636,4 @@ exports.useSyncExternalStore = function (
636636
exports.useTransition = function () {
637637
return ReactSharedInternals.H.useTransition();
638638
};
639-
exports.version = "19.2.0-www-classic-0db8db17-20250503";
639+
exports.version = "19.2.0-www-classic-edf550b6-20250505";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,4 +636,4 @@ exports.useSyncExternalStore = function (
636636
exports.useTransition = function () {
637637
return ReactSharedInternals.H.useTransition();
638638
};
639-
exports.version = "19.2.0-www-modern-0db8db17-20250503";
639+
exports.version = "19.2.0-www-modern-edf550b6-20250505";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ exports.useSyncExternalStore = function (
640640
exports.useTransition = function () {
641641
return ReactSharedInternals.H.useTransition();
642642
};
643-
exports.version = "19.2.0-www-classic-0db8db17-20250503";
643+
exports.version = "19.2.0-www-classic-edf550b6-20250505";
644644
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
645645
"function" ===
646646
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ exports.useSyncExternalStore = function (
640640
exports.useTransition = function () {
641641
return ReactSharedInternals.H.useTransition();
642642
};
643-
exports.version = "19.2.0-www-modern-0db8db17-20250503";
643+
exports.version = "19.2.0-www-modern-edf550b6-20250505";
644644
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
645645
"function" ===
646646
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19014,10 +19014,10 @@ __DEV__ &&
1901419014
(function () {
1901519015
var internals = {
1901619016
bundleType: 1,
19017-
version: "19.2.0-www-classic-0db8db17-20250503",
19017+
version: "19.2.0-www-classic-edf550b6-20250505",
1901819018
rendererPackageName: "react-art",
1901919019
currentDispatcherRef: ReactSharedInternals,
19020-
reconcilerVersion: "19.2.0-www-classic-0db8db17-20250503"
19020+
reconcilerVersion: "19.2.0-www-classic-edf550b6-20250505"
1902119021
};
1902219022
internals.overrideHookState = overrideHookState;
1902319023
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19051,7 +19051,7 @@ __DEV__ &&
1905119051
exports.Shape = Shape;
1905219052
exports.Surface = Surface;
1905319053
exports.Text = Text;
19054-
exports.version = "19.2.0-www-classic-0db8db17-20250503";
19054+
exports.version = "19.2.0-www-classic-edf550b6-20250505";
1905519055
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1905619056
"function" ===
1905719057
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)