Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement queueMicrotask and drainMicrotasks in JSC
Summary: Changelog: [internal] ## Context We want to enable the new React Native event loop by default for all users on the new RN architecture (on the bridgeless initialization path more concretely), which requires support for microtasks in all the JS engines that the support (Hermes already has it, JSC doesn't). ## Changes This adds initial support for microtasks in JSC, so we can schedule and execute microtasks in this runtime. One limitation about this approach is that, AFAIK, the public API for JSC doesn't allow us to customize its internal microtask queue or specify the method to be used by its built-in `Promise` or native `async function`, so we're forced to continue using a polyfill in that case (which uses `setImmediate` that will be mapped to `queueMicrotask`). Reviewed By: NickGerleman Differential Revision: D54302534 fbshipit-source-id: 47f71620344a81bc6624917f77452106ffbf55a3
- Loading branch information