Home / File/ ReactFlightAsyncSequence.js — react Source File

ReactFlightAsyncSequence.js — react Source File

Architecture documentation for ReactFlightAsyncSequence.js, a javascript file in the react codebase. 1 imports, 3 dependents.

File javascript BabelCompiler 1 imports 3 dependents

Entity Profile

Dependency Diagram

graph LR
  7bd7722b_4393_af3e_4956_aebdb94eaca3["ReactFlightAsyncSequence.js"]
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  7bd7722b_4393_af3e_4956_aebdb94eaca3 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  e143ec37_0522_ef26_bb9c_180891985523["ReactFlightServer.js"]
  e143ec37_0522_ef26_bb9c_180891985523 --> 7bd7722b_4393_af3e_4956_aebdb94eaca3
  e13213e5_bbf2_d841_8c5b_fc4a5aece086["ReactFlightServerConfigDebugNode.js"]
  e13213e5_bbf2_d841_8c5b_fc4a5aece086 --> 7bd7722b_4393_af3e_4956_aebdb94eaca3
  2b4b7e63_3f76_2fd5_1e73_38ee16c89aa1["ReactFlightServerConfigDebugNoop.js"]
  2b4b7e63_3f76_2fd5_1e73_38ee16c89aa1 --> 7bd7722b_4393_af3e_4956_aebdb94eaca3
  style 7bd7722b_4393_af3e_4956_aebdb94eaca3 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
 */

import type {
  ReactDebugInfo,
  ReactComponentInfo,
  ReactStackTrace,
} from 'shared/ReactTypes';

export const IO_NODE = 0;
export const PROMISE_NODE = 1;
export const AWAIT_NODE = 2;
export const UNRESOLVED_PROMISE_NODE = 3;
export const UNRESOLVED_AWAIT_NODE = 4;

type PromiseWithDebugInfo = interface extends Promise<any> {
  _debugInfo?: ReactDebugInfo,
};

export type IONode = {
  tag: 0,
  owner: null | ReactComponentInfo,
  stack: null | ReactStackTrace, // callsite that spawned the I/O
  start: number, // start time when the first part of the I/O sequence started
  end: number, // we typically don't use this. only when there's no promise intermediate.
  promise: null, // not used on I/O
  awaited: null, // I/O is only blocked on external.
  previous: null | AwaitNode | UnresolvedAwaitNode, // the preceeding await that spawned this new work
};

export type PromiseNode = {
  tag: 1,
  owner: null | ReactComponentInfo,
  stack: null | ReactStackTrace, // callsite that created the Promise
  start: number, // start time when the Promise was created
  end: number, // end time when the Promise was resolved.
  promise: WeakRef<PromiseWithDebugInfo>, // a reference to this Promise if still referenced
  awaited: null | AsyncSequence, // the thing that ended up resolving this promise
  previous: null | AsyncSequence, // represents what the last return of an async function depended on before returning
};

export type AwaitNode = {
  tag: 2,
  owner: null | ReactComponentInfo,
  stack: null | ReactStackTrace, // callsite that awaited (using await, .then(), Promise.all(), ...)
  start: number, // when we started blocking. This might be later than the I/O started.
  end: number, // when we unblocked. This might be later than the I/O resolved if there's CPU time.
  promise: WeakRef<PromiseWithDebugInfo>, // a reference to this Promise if still referenced
  awaited: null | AsyncSequence, // the promise we were waiting on
  previous: null | AsyncSequence, // the sequence that was blocking us from awaiting in the first place
};

export type UnresolvedPromiseNode = {
  tag: 3,
  owner: null | ReactComponentInfo,
  stack: null | ReactStackTrace, // callsite that created the Promise
  start: number, // start time when the Promise was created
  end: -1.1, // set when we resolve.
  promise: WeakRef<PromiseWithDebugInfo>, // a reference to this Promise if still referenced
  awaited: null | AsyncSequence, // the thing that ended up resolving this promise
  previous: null, // where we created the promise is not interesting since creating it doesn't mean waiting.
};

export type UnresolvedAwaitNode = {
  tag: 4,
  owner: null | ReactComponentInfo,
  stack: null | ReactStackTrace, // callsite that awaited (using await, .then(), Promise.all(), ...)
  start: number, // when we started blocking. This might be later than the I/O started.
  end: -1.1, // set when we resolve.
  promise: WeakRef<PromiseWithDebugInfo>, // a reference to this Promise if still referenced
  awaited: null | AsyncSequence, // the promise we were waiting on
  previous: null | AsyncSequence, // the sequence that was blocking us from awaiting in the first place
};

export type AsyncSequence =
  | IONode
  | PromiseNode
  | AwaitNode
  | UnresolvedPromiseNode
  | UnresolvedAwaitNode;

Domain

Dependencies

  • ReactTypes

Frequently Asked Questions

What does ReactFlightAsyncSequence.js do?
ReactFlightAsyncSequence.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactFlightAsyncSequence.js depend on?
ReactFlightAsyncSequence.js imports 1 module(s): ReactTypes.
What files import ReactFlightAsyncSequence.js?
ReactFlightAsyncSequence.js is imported by 3 file(s): ReactFlightServer.js, ReactFlightServerConfigDebugNode.js, ReactFlightServerConfigDebugNoop.js.
Where is ReactFlightAsyncSequence.js in the architecture?
ReactFlightAsyncSequence.js is located at packages/react-server/src/ReactFlightAsyncSequence.js (domain: BabelCompiler, directory: packages/react-server/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free