Home / File/ ReactFlightClientConfigDOM.js — react Source File

ReactFlightClientConfigDOM.js — react Source File

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

Entity Profile

Dependency Diagram

graph LR
  63f0749f_297f_769a_3a54_a5a0d0221571["ReactFlightClientConfigDOM.js"]
  6a345571_3d83_3185_49d0_7a711dbada16["ReactFlightServerConfigDOM.js"]
  63f0749f_297f_769a_3a54_a5a0d0221571 --> 6a345571_3d83_3185_49d0_7a711dbada16
  32da47fd_dac0_1961_6ca0_aaebfed0f91b["crossOriginStrings.js"]
  63f0749f_297f_769a_3a54_a5a0d0221571 --> 32da47fd_dac0_1961_6ca0_aaebfed0f91b
  d6d80e8f_983f_103d_5ad4_f6a8867e4516["getCrossOriginString"]
  63f0749f_297f_769a_3a54_a5a0d0221571 --> d6d80e8f_983f_103d_5ad4_f6a8867e4516
  9b61bdad_4620_0f90_ab09_c1efd8c52c41["ReactDOMSharedInternals"]
  63f0749f_297f_769a_3a54_a5a0d0221571 --> 9b61bdad_4620_0f90_ab09_c1efd8c52c41
  style 63f0749f_297f_769a_3a54_a5a0d0221571 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
 */

// This client file is in the shared folder because it applies to both SSR and browser contexts.
// It is the configuration of the FlightClient behavior which can run in either environment.

import type {HintCode, HintModel} from '../server/ReactFlightServerConfigDOM';

import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals';

import {getCrossOriginString} from './crossOriginStrings';

export function dispatchHint<Code: HintCode>(
  code: Code,
  model: HintModel<Code>,
): void {
  const dispatcher = ReactDOMSharedInternals.d; /* ReactDOMCurrentDispatcher */
  switch (code) {
    case 'D': {
      const refined = refineModel(code, model);
      const href = refined;
      dispatcher.D(/* prefetchDNS */ href);
      return;
    }
    case 'C': {
      const refined = refineModel(code, model);
      if (typeof refined === 'string') {
        const href = refined;
        dispatcher.C(/* preconnect */ href);
      } else {
        const href = refined[0];
        const crossOrigin = refined[1];
        dispatcher.C(/* preconnect */ href, crossOrigin);
      }
      return;
    }
    case 'L': {
      const refined = refineModel(code, model);
      const href = refined[0];
      const as = refined[1];
      if (refined.length === 3) {
        const options = refined[2];
        dispatcher.L(/* preload */ href, as, options);
      } else {
        dispatcher.L(/* preload */ href, as);
      }
      return;
    }
    case 'm': {
      const refined = refineModel(code, model);
      if (typeof refined === 'string') {
        const href = refined;
        dispatcher.m(/* preloadModule */ href);
      } else {
// ... (76 more lines)

Domain

Frequently Asked Questions

What does ReactFlightClientConfigDOM.js do?
ReactFlightClientConfigDOM.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactFlightClientConfigDOM.js depend on?
ReactFlightClientConfigDOM.js imports 4 module(s): ReactDOMSharedInternals, ReactFlightServerConfigDOM.js, crossOriginStrings.js, getCrossOriginString.
Where is ReactFlightClientConfigDOM.js in the architecture?
ReactFlightClientConfigDOM.js is located at packages/react-dom-bindings/src/shared/ReactFlightClientConfigDOM.js (domain: BabelCompiler, directory: packages/react-dom-bindings/src/shared).

Analyze Your Own Codebase

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

Try Supermodel Free