react/scripts/flow
Andrew Clark 83643778bd
Internal test helpers: Use Node's MessageChannel to queue task (#26345)
To wait for the microtask queue to empty, our internal test helpers
schedule an arbitrary task using `setImmediate`. It doesn't matter what
kind of task it is, only that it's a separate task from the current one,
because by the time it fires, the microtasks for the current event will
have already been processed.

The issue with `setImmediate` is that Jest mocks it. Which can lead to
weird behavior.

I've changed it to instead use a message event, via the MessageChannel
implementation exposed by the `node:worker_threads` module.

We should consider doing this in the public implementation of `act`,
too.
2023-03-08 15:04:38 -05:00
..
config Upgrade Flow to 0.201 (#26326) 2023-03-06 10:33:22 -05:00
createFlowConfigs.js [flow] enable enforce_local_inference_annotations (#25921) 2023-01-09 15:46:48 -05:00
environment.js Internal test helpers: Use Node's MessageChannel to queue task (#26345) 2023-03-08 15:04:38 -05:00
react-devtools.js ESLint upgrade to use hermes-eslint (#25915) 2022-12-20 14:27:01 -05:00
react-native-host-hooks.js Removed unused imperative events implementation from React Native renderer (#26282) 2023-03-02 15:54:51 +00:00
react-relay-hooks.js Enable passing Server References from Server to Client (#26124) 2023-02-09 19:45:05 -05:00
runFlow.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
xplat.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00