Skip to content

Commit 8947b45

Browse files
committed
[Flight] Add approximate parent context for FormatContext (facebook#34601)
Flight doesn't have any semantically sound notion of a parent context. That's why we removed Server Context. Each root can really start anywhere in the tree when you refetch subtrees. Additionally when you dedupe elements they can end up in multiple different parent contexts. However, we do have a DEV only version of this with debugTask being tracked for the nearest parent element to track the context of properties inside of it. To apply certain DOM specific hints and optimizations when you render host components we need some information of the context. This is usually very local so doesn't suffer from the likelihood that you refetch in the middle. We'll also only use this information for optimistic hints and not hard semantics so getting it wrong isn't terrible. ``` <picture> <img /> </picture> <noscript> <p> <img /> </p> </noscript> ``` For example, in these cases we should exclude preloading the image but we have to know if that's the scope we're in. We can easily get this wrong if they're split or even if they're wrapped in client components that we don't know about like: ``` <NoScript> <p> <img /> </p> </NoScript> ``` However, getting it wrong in either direction is not the end of the world. It's about covering the common cases well. DiffTrain build for [b0c1dc0](facebook@b0c1dc0)
1 parent 6d36037 commit 8947b45

36 files changed

+342
-235
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c44fbf43b1e05417619c3b9411d0559824739569
1+
b0c1dc01ecbfaf81aa69f760b29dd76c02600792
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c44fbf43b1e05417619c3b9411d0559824739569
1+
b0c1dc01ecbfaf81aa69f760b29dd76c02600792

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ __DEV__ &&
14191419
exports.useTransition = function () {
14201420
return resolveDispatcher().useTransition();
14211421
};
1422-
exports.version = "19.2.0-www-classic-c44fbf43-20250924";
1422+
exports.version = "19.2.0-www-classic-b0c1dc01-20250925";
14231423
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14241424
"function" ===
14251425
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
@@ -1419,7 +1419,7 @@ __DEV__ &&
14191419
exports.useTransition = function () {
14201420
return resolveDispatcher().useTransition();
14211421
};
1422-
exports.version = "19.2.0-www-modern-c44fbf43-20250924";
1422+
exports.version = "19.2.0-www-modern-b0c1dc01-20250925";
14231423
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14241424
"function" ===
14251425
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
@@ -602,4 +602,4 @@ exports.useSyncExternalStore = function (
602602
exports.useTransition = function () {
603603
return ReactSharedInternals.H.useTransition();
604604
};
605-
exports.version = "19.2.0-www-classic-c44fbf43-20250924";
605+
exports.version = "19.2.0-www-classic-b0c1dc01-20250925";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,4 @@ exports.useSyncExternalStore = function (
602602
exports.useTransition = function () {
603603
return ReactSharedInternals.H.useTransition();
604604
};
605-
exports.version = "19.2.0-www-modern-c44fbf43-20250924";
605+
exports.version = "19.2.0-www-modern-b0c1dc01-20250925";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.2.0-www-classic-c44fbf43-20250924";
609+
exports.version = "19.2.0-www-classic-b0c1dc01-20250925";
610610
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
611611
"function" ===
612612
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
@@ -606,7 +606,7 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.2.0-www-modern-c44fbf43-20250924";
609+
exports.version = "19.2.0-www-modern-b0c1dc01-20250925";
610610
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
611611
"function" ===
612612
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
@@ -20224,10 +20224,10 @@ __DEV__ &&
2022420224
(function () {
2022520225
var internals = {
2022620226
bundleType: 1,
20227-
version: "19.2.0-www-classic-c44fbf43-20250924",
20227+
version: "19.2.0-www-classic-b0c1dc01-20250925",
2022820228
rendererPackageName: "react-art",
2022920229
currentDispatcherRef: ReactSharedInternals,
20230-
reconcilerVersion: "19.2.0-www-classic-c44fbf43-20250924"
20230+
reconcilerVersion: "19.2.0-www-classic-b0c1dc01-20250925"
2023120231
};
2023220232
internals.overrideHookState = overrideHookState;
2023320233
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20261,7 +20261,7 @@ __DEV__ &&
2026120261
exports.Shape = Shape;
2026220262
exports.Surface = Surface;
2026320263
exports.Text = Text;
20264-
exports.version = "19.2.0-www-classic-c44fbf43-20250924";
20264+
exports.version = "19.2.0-www-classic-b0c1dc01-20250925";
2026520265
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2026620266
"function" ===
2026720267
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19995,10 +19995,10 @@ __DEV__ &&
1999519995
(function () {
1999619996
var internals = {
1999719997
bundleType: 1,
19998-
version: "19.2.0-www-modern-c44fbf43-20250924",
19998+
version: "19.2.0-www-modern-b0c1dc01-20250925",
1999919999
rendererPackageName: "react-art",
2000020000
currentDispatcherRef: ReactSharedInternals,
20001-
reconcilerVersion: "19.2.0-www-modern-c44fbf43-20250924"
20001+
reconcilerVersion: "19.2.0-www-modern-b0c1dc01-20250925"
2000220002
};
2000320003
internals.overrideHookState = overrideHookState;
2000420004
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20032,7 +20032,7 @@ __DEV__ &&
2003220032
exports.Shape = Shape;
2003320033
exports.Surface = Surface;
2003420034
exports.Text = Text;
20035-
exports.version = "19.2.0-www-modern-c44fbf43-20250924";
20035+
exports.version = "19.2.0-www-modern-b0c1dc01-20250925";
2003620036
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2003720037
"function" ===
2003820038
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)