react/packages
Sebastian Markbåge 9d111ffdfb
Serialize Promises through Flight (#26086)
This lets you pass Promises from server components to client components
and `use()` them there.

We still don't support Promises as children on the client, so we need to
support both. This will be a lot simpler when we remove the need to
encode children as lazy since we don't need the lazy encoding anymore
then.

I noticed that this test failed because we don't synchronously resolve
instrumented Promises if they're lazy. The second fix calls `.then()`
early to ensure that this lazy initialization can happen eagerly. ~It
felt silly to do this with an empty function or something, so I just did
the attachment of ping listeners early here. It's also a little silly
since they will ping the currently running render for no reason if it's
synchronously available.~ EDIT: That didn't work because a ping might
interrupt the current render. Probably need a bigger refactor.

We could add another extension but we've already taken a lot of
liberties with the Promise protocol. At least this is one that doesn't
need extension of the protocol as much. Any sub-class of promises could
do this.
2023-02-01 12:56:53 -05:00
..
dom-event-testing-library Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
eslint-plugin-react-hooks Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
jest-react [flow] enable enforce_local_inference_annotations (#25921) 2023-01-09 15:46:48 -05:00
react Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-art Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-cache Remove unused Flow suppressions (#25977) 2023-01-10 10:32:42 -05:00
react-client Serialize Promises through Flight (#26086) 2023-02-01 12:56:53 -05:00
react-debug-tools Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-core Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-extensions Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-inline Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-shared Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-shell Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-devtools-timeline Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-dom Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-dom-bindings Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-interactions [flow] enable enforce_local_inference_annotations (#25921) 2023-01-09 15:46:48 -05:00
react-is [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
react-native-renderer Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-noop-renderer Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-reconciler Serialize Promises through Flight (#26086) 2023-02-01 12:56:53 -05:00
react-refresh Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
react-server Serialize Promises through Flight (#26086) 2023-02-01 12:56:53 -05:00
react-server-dom-relay Refactor Flight Encoding (#26082) 2023-01-31 12:41:36 -05:00
react-server-dom-webpack Serialize Promises through Flight (#26086) 2023-02-01 12:56:53 -05:00
react-server-native-relay Refactor Flight Encoding (#26082) 2023-01-31 12:41:36 -05:00
react-suspense-test-utils [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
react-test-renderer Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
scheduler Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
shared Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
use-subscription Batch sync, default and continuous lanes (#25700) 2023-01-05 15:21:35 -08:00
use-sync-external-store Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00