mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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
19 lines
579 B
JavaScript
19 lines
579 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
export * from '../ReactServerStreamConfigFB';
|
|
|
|
export function scheduleMicrotask(callback: () => void) {
|
|
// We don't schedule work in this model, and instead expect performWork to always be called repeatedly.
|
|
}
|
|
|
|
export function scheduleWork(callback: () => void) {
|
|
// We don't schedule work in this model, and instead expect performWork to always be called repeatedly.
|
|
}
|