Skip to content

Commit

Permalink
[Flight] Schedule work in a microtask (#29491)
Browse files Browse the repository at this point in the history
Stacked on #29551

Flight pings much more often than Fizz because async function components
will always take at least a microtask to resolve . Rather than
scheduling this work as a new macrotask Flight now schedules pings in a
microtask. This allows more microtasks to ping before actually doing a
work flush but doesn't force the vm to spin up a new task which is quite
common give n the nature of Server Components

DiffTrain build for commit 1e1e5cd.
  • Loading branch information
gnoff committed Jun 6, 2024
1 parent ea0950f commit 79722c7
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 36 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-b526a0a419-20240606
19.0.0-native-fb-1e1e5cd252-20240606
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<aeb5412de032acf9afc7bd5d88a329b3>>
* @generated SignedSource<<f7815a843a9f54d4da37dd2647c299d0>>
*/

'use strict';
Expand Down Expand Up @@ -23580,7 +23580,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-native-fb-b526a0a419-20240606';
var ReactVersion = '19.0.0-native-fb-1e1e5cd252-20240606';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<071298c9ff96ae03132c2f6189a9505d>>
* @generated SignedSource<<d0d4e5d8191e2180263cc55239ce6106>>
*/

"use strict";
Expand Down Expand Up @@ -9336,7 +9336,7 @@ var devToolsConfig$jscomp$inline_1048 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-native-fb-b526a0a419-20240606",
version: "19.0.0-native-fb-1e1e5cd252-20240606",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1235 = {
Expand Down Expand Up @@ -9367,7 +9367,7 @@ var internals$jscomp$inline_1235 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-native-fb-b526a0a419-20240606"
reconcilerVersion: "19.0.0-native-fb-1e1e5cd252-20240606"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1236 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2b7f28997d14368e8b072ffc1497cb77>>
* @generated SignedSource<<7acd955e6808e3be88f1cdc50d2a594b>>
*/

"use strict";
Expand Down Expand Up @@ -9958,7 +9958,7 @@ var devToolsConfig$jscomp$inline_1131 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-native-fb-b526a0a419-20240606",
version: "19.0.0-native-fb-1e1e5cd252-20240606",
rendererPackageName: "react-test-renderer"
};
(function (internals) {
Expand Down Expand Up @@ -10002,7 +10002,7 @@ var devToolsConfig$jscomp$inline_1131 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-native-fb-b526a0a419-20240606"
reconcilerVersion: "19.0.0-native-fb-1e1e5cd252-20240606"
});
exports._Scheduler = Scheduler;
exports.act = act;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<27df3fd4e7100982c8f4ef7d518a4510>>
* @generated SignedSource<<0abf8e5118ea2b56775e8918c72212d7>>
*/

'use strict';
Expand All @@ -24,7 +24,7 @@ if (
}
var dynamicFlagsUntyped = require('ReactNativeInternalFeatureFlags');

var ReactVersion = '19.0.0-native-fb-b526a0a419-20240606';
var ReactVersion = '19.0.0-native-fb-1e1e5cd252-20240606';

// Re-export dynamic flags from the internal module.
var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-exporting to avoid a dynamic look-up on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<02284763378c01e6ceb319a485aebf4e>>
* @generated SignedSource<<4eb73bc3a903ce23b05b972ddb23974d>>
*/

"use strict";
Expand Down Expand Up @@ -604,4 +604,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-native-fb-b526a0a419-20240606";
exports.version = "19.0.0-native-fb-1e1e5cd252-20240606";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<27f9d9eb4116e19c56a7659cf6b57e21>>
* @generated SignedSource<<41b2095c7a60ae87cfed87994d77300a>>
*/

"use strict";
Expand Down Expand Up @@ -608,7 +608,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-native-fb-b526a0a419-20240606";
exports.version = "19.0.0-native-fb-1e1e5cd252-20240606";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b526a0a419029eea31f4d967951b6feca123012d
1e1e5cd25223fddbce0e3fb7889b06df0d93a950
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<557c39946498737c4c67c5ed81c7a5e8>>
* @generated SignedSource<<5e256a72a792b00fed5697837d04daca>>
*/

'use strict';
Expand Down Expand Up @@ -26316,7 +26316,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-b526a0a419-20240606';
var ReactVersion = '19.0.0-rc-1e1e5cd252-20240606';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5d81da86232cf85d0e472d78b33810df>>
* @generated SignedSource<<fff9adf88275f610135dd546a13cab70>>
*/

"use strict";
Expand Down Expand Up @@ -10591,7 +10591,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1125 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-rc-b526a0a419-20240606",
version: "19.0.0-rc-1e1e5cd252-20240606",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10634,7 +10634,7 @@ var internals$jscomp$inline_1351 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-b526a0a419-20240606"
reconcilerVersion: "19.0.0-rc-1e1e5cd252-20240606"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1352 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5294159175056cc85cd3eaccc20868b4>>
* @generated SignedSource<<86fa47d8f492032c650dfc992eed398d>>
*/

"use strict";
Expand Down Expand Up @@ -11297,7 +11297,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1206 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-rc-b526a0a419-20240606",
version: "19.0.0-rc-1e1e5cd252-20240606",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11353,7 +11353,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-b526a0a419-20240606"
reconcilerVersion: "19.0.0-rc-1e1e5cd252-20240606"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<573edab4cc9019514d21527ed1a1468d>>
* @generated SignedSource<<99dfb5afcc0e9f18fc2671f3907b43a8>>
*/

'use strict';
Expand Down Expand Up @@ -26671,7 +26671,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-b526a0a419-20240606';
var ReactVersion = '19.0.0-rc-1e1e5cd252-20240606';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<01aad9dc1b3e5258b1625899f2dd8824>>
* @generated SignedSource<<38ca9b02c50a0a1ea4961cdd43811111>>
*/

"use strict";
Expand Down Expand Up @@ -10734,11 +10734,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
traverseOwnerTreeUp(hierarchy, instance);
}
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-rc-b526a0a419-20240606" !== isomorphicReactPackageVersion)
if ("19.0.0-rc-1e1e5cd252-20240606" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.0.0-rc-b526a0a419-20240606\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.0.0-rc-1e1e5cd252-20240606\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
Expand Down Expand Up @@ -10788,7 +10788,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1193 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-rc-b526a0a419-20240606",
version: "19.0.0-rc-1e1e5cd252-20240606",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10831,7 +10831,7 @@ var internals$jscomp$inline_1440 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-b526a0a419-20240606"
reconcilerVersion: "19.0.0-rc-1e1e5cd252-20240606"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1441 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5d49e7b8b07ff7bea189bf5c9bdbc4ee>>
* @generated SignedSource<<415004ff3ce757d7f454d526ed577f2d>>
*/

"use strict";
Expand Down Expand Up @@ -11441,11 +11441,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
traverseOwnerTreeUp(hierarchy, instance);
}
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-rc-b526a0a419-20240606" !== isomorphicReactPackageVersion)
if ("19.0.0-rc-1e1e5cd252-20240606" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.0.0-rc-b526a0a419-20240606\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.0.0-rc-1e1e5cd252-20240606\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
Expand Down Expand Up @@ -11495,7 +11495,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1274 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-rc-b526a0a419-20240606",
version: "19.0.0-rc-1e1e5cd252-20240606",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11551,7 +11551,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-b526a0a419-20240606"
reconcilerVersion: "19.0.0-rc-1e1e5cd252-20240606"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 79722c7

Please sign in to comment.