Home / File/ ReactFlightImportMetadata.js — react Source File

ReactFlightImportMetadata.js — react Source File

Architecture documentation for ReactFlightImportMetadata.js, a javascript file in the react codebase. 0 imports, 2 dependents.

File javascript BabelCompiler Validation 2 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  8c630d72_8245_cbaa_84bb_2d827c5947cf["ReactFlightImportMetadata.js"]
  ed5d8ab8_d41a_ce7b_9c4c_86e7deeee4c8["ReactFlightClientConfigBundlerTurbopack.js"]
  ed5d8ab8_d41a_ce7b_9c4c_86e7deeee4c8 --> 8c630d72_8245_cbaa_84bb_2d827c5947cf
  4bcd55b1_aada_3a88_c5ad_77472e72a202["ReactFlightServerConfigTurbopackBundler.js"]
  4bcd55b1_aada_3a88_c5ad_77472e72a202 --> 8c630d72_8245_cbaa_84bb_2d827c5947cf
  style 8c630d72_8245_cbaa_84bb_2d827c5947cf 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
 */

export type ImportManifestEntry = {
  id: string,
  // chunks is an array of filenames
  chunks: Array<string>,
  name: string,
  async?: boolean,
};

// This is the parsed shape of the wire format which is why it is
// condensed to only the essentialy information
export type ImportMetadata =
  | [
      /* id */ string,
      /* chunk filenames */ Array<string>,
      /* name */ string,
      /* async */ 1,
    ]
  | [/* id */ string, /* chunk filenames */ Array<string>, /* name */ string];

export const ID = 0;
export const CHUNKS = 1;
export const NAME = 2;
// export const ASYNC = 3;

// This logic is correct because currently only include the 4th tuple member
// when the module is async. If that changes we will need to actually assert
// the value is true. We don't index into the 4th slot because flow does not
// like the potential out of bounds access
export function isAsyncImport(metadata: ImportMetadata): boolean {
  return metadata.length === 4;
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does ReactFlightImportMetadata.js do?
ReactFlightImportMetadata.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactFlightImportMetadata.js?
ReactFlightImportMetadata.js defines 1 function(s): isAsyncImport.
What files import ReactFlightImportMetadata.js?
ReactFlightImportMetadata.js is imported by 2 file(s): ReactFlightClientConfigBundlerTurbopack.js, ReactFlightServerConfigTurbopackBundler.js.
Where is ReactFlightImportMetadata.js in the architecture?
ReactFlightImportMetadata.js is located at packages/react-server-dom-turbopack/src/shared/ReactFlightImportMetadata.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-server-dom-turbopack/src/shared).

Analyze Your Own Codebase

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

Try Supermodel Free