Home / File/ ReactFlightUnbundledReferences.js — react Source File

ReactFlightUnbundledReferences.js — react Source File

Architecture documentation for ReactFlightUnbundledReferences.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
  3668d0cf_c7c5_71f0_043b_52567ce7585c["ReactFlightUnbundledReferences.js"]
  0cf33a2a_6fe6_7412_bf8d_09664538a80f["ReactFlightServer"]
  3668d0cf_c7c5_71f0_043b_52567ce7585c --> 0cf33a2a_6fe6_7412_bf8d_09664538a80f
  800b57fe_64a5_c6f9_986f_d9edff1b0aef["ReactFlightServerConfigUnbundledBundler.js"]
  800b57fe_64a5_c6f9_986f_d9edff1b0aef --> 3668d0cf_c7c5_71f0_043b_52567ce7585c
  style 3668d0cf_c7c5_71f0_043b_52567ce7585c 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 ReactFlightUnbundledReferences.js do?
ReactFlightUnbundledReferences.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 ReactFlightUnbundledReferences.js?
ReactFlightUnbundledReferences.js defines 2 function(s): isClientReference, isServerReference.
What does ReactFlightUnbundledReferences.js depend on?
ReactFlightUnbundledReferences.js imports 1 module(s): ReactFlightServer.
What files import ReactFlightUnbundledReferences.js?
ReactFlightUnbundledReferences.js is imported by 1 file(s): ReactFlightServerConfigUnbundledBundler.js.
Where is ReactFlightUnbundledReferences.js in the architecture?
ReactFlightUnbundledReferences.js is located at packages/react-server-dom-unbundled/src/ReactFlightUnbundledReferences.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-server-dom-unbundled/src).

Analyze Your Own Codebase

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

Try Supermodel Free