Home / File/ ReactFlightTurbopackReferences.js — react Source File

ReactFlightTurbopackReferences.js — react Source File

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

File javascript BabelCompiler Validation 1 imports 1 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  659d37ac_3363_3ecd_c7ab_a756bd1f84fb["ReactFlightTurbopackReferences.js"]
  0cf33a2a_6fe6_7412_bf8d_09664538a80f["ReactFlightServer"]
  659d37ac_3363_3ecd_c7ab_a756bd1f84fb --> 0cf33a2a_6fe6_7412_bf8d_09664538a80f
  4bcd55b1_aada_3a88_c5ad_77472e72a202["ReactFlightServerConfigTurbopackBundler.js"]
  4bcd55b1_aada_3a88_c5ad_77472e72a202 --> 659d37ac_3363_3ecd_c7ab_a756bd1f84fb
  style 659d37ac_3363_3ecd_c7ab_a756bd1f84fb 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 {ReactClientValue} from 'react-server/src/ReactFlightServer';

export type ServerReference<T: Function> = T & {
  $$typeof: symbol,
  $$id: string,
  $$bound: null | Array<ReactClientValue>,
  $$location?: Error,
};

// eslint-disable-next-line no-unused-vars
export type ClientReference<T> = {
  $$typeof: symbol,
  $$id: string,
  $$async: boolean,
};

const CLIENT_REFERENCE_TAG = Symbol.for('react.client.reference');
const SERVER_REFERENCE_TAG = Symbol.for('react.server.reference');

export function isClientReference(reference: Object): boolean {
  return reference.$$typeof === CLIENT_REFERENCE_TAG;
}

export function isServerReference(reference: Object): boolean {
  return reference.$$typeof === SERVER_REFERENCE_TAG;
}

export function registerClientReference<T>(
  proxyImplementation: any,
  id: string,
  exportName: string,
): ClientReference<T> {
  return registerClientReferenceImpl(
    proxyImplementation,
    id + '#' + exportName,
    false,
  );
}

function registerClientReferenceImpl<T>(
  proxyImplementation: any,
  id: string,
  async: boolean,
): ClientReference<T> {
  return Object.defineProperties(proxyImplementation, {
    $$typeof: {value: CLIENT_REFERENCE_TAG},
    $$id: {value: id},
    $$async: {value: async},
  });
}

// ... (300 more lines)

Domain

Subdomains

Dependencies

  • ReactFlightServer

Frequently Asked Questions

What does ReactFlightTurbopackReferences.js do?
ReactFlightTurbopackReferences.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 ReactFlightTurbopackReferences.js?
ReactFlightTurbopackReferences.js defines 2 function(s): isClientReference, isServerReference.
What does ReactFlightTurbopackReferences.js depend on?
ReactFlightTurbopackReferences.js imports 1 module(s): ReactFlightServer.
What files import ReactFlightTurbopackReferences.js?
ReactFlightTurbopackReferences.js is imported by 1 file(s): ReactFlightServerConfigTurbopackBundler.js.
Where is ReactFlightTurbopackReferences.js in the architecture?
ReactFlightTurbopackReferences.js is located at packages/react-server-dom-turbopack/src/ReactFlightTurbopackReferences.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-server-dom-turbopack/src).

Analyze Your Own Codebase

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

Try Supermodel Free