SchedulerNative.js — react Source File
Architecture documentation for SchedulerNative.js, a javascript file in the react codebase. 3 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR c975b17f_0019_cb5f_37d9_561988e04ee9["SchedulerNative.js"] ddd23dfb_c95d_b046_b4f3_3904daada6f0["Scheduler.js"] c975b17f_0019_cb5f_37d9_561988e04ee9 --> ddd23dfb_c95d_b046_b4f3_3904daada6f0 0c4003c2_7bcb_0f8f_2e9c_0802d60fa754["SchedulerPriorities.js"] c975b17f_0019_cb5f_37d9_561988e04ee9 --> 0c4003c2_7bcb_0f8f_2e9c_0802d60fa754 c975b17f_0019_cb5f_37d9_561988e04ee9["SchedulerNative.js"] c975b17f_0019_cb5f_37d9_561988e04ee9 --> c975b17f_0019_cb5f_37d9_561988e04ee9 c975b17f_0019_cb5f_37d9_561988e04ee9["SchedulerNative.js"] c975b17f_0019_cb5f_37d9_561988e04ee9 --> c975b17f_0019_cb5f_37d9_561988e04ee9 style c975b17f_0019_cb5f_37d9_561988e04ee9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* 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 strict
*/
import * as Scheduler from './Scheduler';
import type {Callback, Task} from './Scheduler';
import type {PriorityLevel} from '../SchedulerPriorities';
import typeof * as PriorityLevels from '../SchedulerPriorities';
import typeof * as SchedulerExportsType from './Scheduler';
import typeof * as SchedulerNativeExportsType from './SchedulerNative';
// This type is supposed to reflect the actual methods and arguments currently supported by the C++ implementation:
// https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp
type NativeSchedulerType = {
unstable_ImmediatePriority: PriorityLevels['ImmediatePriority'],
unstable_UserBlockingPriority: PriorityLevels['UserBlockingPriority'],
unstable_NormalPriority: PriorityLevels['NormalPriority'],
unstable_IdlePriority: PriorityLevels['IdlePriority'],
unstable_LowPriority: PriorityLevels['LowPriority'],
unstable_scheduleCallback: (
priorityLevel: PriorityLevel,
callback: Callback,
) => Task,
unstable_cancelCallback: (task: Task) => void,
unstable_getCurrentPriorityLevel: () => PriorityLevel,
unstable_shouldYield: () => boolean,
unstable_requestPaint: () => void,
unstable_now: () => DOMHighResTimeStamp,
};
declare const nativeRuntimeScheduler: void | NativeSchedulerType;
export const unstable_UserBlockingPriority: PriorityLevels['UserBlockingPriority'] =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_UserBlockingPriority
: Scheduler.unstable_UserBlockingPriority;
export const unstable_NormalPriority: PriorityLevels['NormalPriority'] =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_NormalPriority
: Scheduler.unstable_NormalPriority;
export const unstable_IdlePriority: PriorityLevels['IdlePriority'] =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_IdlePriority
: Scheduler.unstable_IdlePriority;
export const unstable_LowPriority: PriorityLevels['LowPriority'] =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_LowPriority
: Scheduler.unstable_LowPriority;
export const unstable_ImmediatePriority: PriorityLevels['ImmediatePriority'] =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_ImmediatePriority
: Scheduler.unstable_ImmediatePriority;
export const unstable_scheduleCallback: (
priorityLevel: PriorityLevel,
callback: Callback,
) => Task =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_scheduleCallback
: Scheduler.unstable_scheduleCallback;
export const unstable_cancelCallback: (task: Task) => void =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_cancelCallback
: Scheduler.unstable_cancelCallback;
export const unstable_getCurrentPriorityLevel: () => PriorityLevel =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_getCurrentPriorityLevel
: Scheduler.unstable_getCurrentPriorityLevel;
export const unstable_shouldYield: () => boolean =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_shouldYield
: Scheduler.unstable_shouldYield;
export const unstable_requestPaint: () => void =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_requestPaint
: Scheduler.unstable_requestPaint;
export const unstable_now: () => number | DOMHighResTimeStamp =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_now
: Scheduler.unstable_now;
// These were never implemented on the native scheduler because React never calls them.
// For consistency, let's disable them altogether and make them throw.
export const unstable_next: any = throwNotImplemented;
export const unstable_runWithPriority: any = throwNotImplemented;
export const unstable_wrapCallback: any = throwNotImplemented;
export const unstable_forceFrameRate: any = throwNotImplemented;
export const unstable_Profiling: any = null;
function throwNotImplemented() {
throw Error('Not implemented.');
}
// Flow magic to verify the exports of this file match the original version.
export type {Callback, Task};
((((null: any): SchedulerExportsType): SchedulerNativeExportsType): SchedulerExportsType);
Domain
Subdomains
Functions
Dependencies
Imported By
Source
Frequently Asked Questions
What does SchedulerNative.js do?
SchedulerNative.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in SchedulerNative.js?
SchedulerNative.js defines 6 function(s): NativeSchedulerType.unstable_cancelCallback, NativeSchedulerType.unstable_getCurrentPriorityLevel, NativeSchedulerType.unstable_now, NativeSchedulerType.unstable_requestPaint, NativeSchedulerType.unstable_shouldYield, throwNotImplemented.
What does SchedulerNative.js depend on?
SchedulerNative.js imports 3 module(s): Scheduler.js, SchedulerNative.js, SchedulerPriorities.js.
What files import SchedulerNative.js?
SchedulerNative.js is imported by 1 file(s): SchedulerNative.js.
Where is SchedulerNative.js in the architecture?
SchedulerNative.js is located at packages/scheduler/src/forks/SchedulerNative.js (domain: BabelCompiler, subdomain: Optimization, directory: packages/scheduler/src/forks).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free