react/scripts/flow
Sebastian Markbåge ff93c4448c
[Flight] Track Debug Info from Synchronously Unwrapped Promises (#33485)
Stacked on #33482.

There's a flaw with getting information from the execution context of
the ping. For the soft-deprecated "throw a promise" technique, this is a
bit unreliable because you could in theory throw the same one multiple
times. Similarly, a more fundamental flaw with that API is that it
doesn't allow for tracking the information of Promises that are already
synchronously able to resolve.

This stops tracking the async debug info in the case of throwing a
Promise and only when you render a Promise. That means some loss of data
but we should just warn for throwing a Promise anyway.

Instead, this also adds support for tracking `use()`d thenables and
forwarding `_debugInfo` from then. This is done by extracting the info
from the Promise after the fact instead of in the resolve so that it
only happens once at the end after the pings are done.

This also supports passing the same Promise in multiple places and
tracking the debug info at each location, even if it was already
instrumented with a synchronous value by the time of the second use.
2025-06-11 12:07:10 -04:00
..
config [scripts] Switch back to flow parser for prettier (#33414) 2025-06-03 00:00:28 -04:00
createFlowConfigs.js [flow] Remove CI_MAX_WORKERS option 2024-08-20 12:38:27 -04:00
environment.js [Flight] Track Debug Info from Synchronously Unwrapped Promises (#33485) 2025-06-11 12:07:10 -04:00
react-devtools.js [mcp] Add MCP tool to print out the component tree of the currently open React App (#33305) 2025-06-02 21:42:34 -07:00
react-native-host-hooks.js Root import types from react-native in ReactNativeTypes (#33063) 2025-05-08 12:12:35 +01:00
runFlow.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
xplat.js Update RN dynamic flag types (#28427) 2024-03-22 12:23:38 -04:00