Home / File/ ReactFlightServerConfig.markup.js — react Source File

ReactFlightServerConfig.markup.js — react Source File

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

File javascript BabelCompiler Validation 2 imports 6 functions

Entity Profile

Dependency Diagram

graph LR
  6f6f9c34_6954_9855_09f5_9a4b373b9baf["ReactFlightServerConfig.markup.js"]
  0cf33a2a_6fe6_7412_bf8d_09664538a80f["ReactFlightServer"]
  6f6f9c34_6954_9855_09f5_9a4b373b9baf --> 0cf33a2a_6fe6_7412_bf8d_09664538a80f
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  6f6f9c34_6954_9855_09f5_9a4b373b9baf --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  style 6f6f9c34_6954_9855_09f5_9a4b373b9baf 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 {Request} from 'react-server/src/ReactFlightServer';
import type {ReactComponentInfo} from 'shared/ReactTypes';
import type {ReactClientValue} from 'react-server/src/ReactFlightServer';

export type HintCode = string;
export type HintModel<T: HintCode> = null; // eslint-disable-line no-unused-vars
export type Hints = null;

export function createHints(): Hints {
  return null;
}

export type FormatContext = null;

export function createRootFormatContext(): FormatContext {
  return null;
}

export function getChildFormatContext(
  parentContext: FormatContext,
  type: string,
  props: Object,
): FormatContext {
  return parentContext;
}

export const supportsRequestStorage = false;
export const requestStorage: AsyncLocalStorage<Request | void> = (null: any);

export const supportsComponentStorage = false;
export const componentStorage: AsyncLocalStorage<ReactComponentInfo | void> =
  (null: any);

export * from '../ReactFlightServerConfigDebugNoop';

export * from '../ReactFlightStackConfigV8';
export * from '../ReactServerConsoleConfigPlain';

export type ClientManifest = null;
export opaque type ClientReference<T> = null; // eslint-disable-line no-unused-vars
export opaque type ServerReference<T> = null; // eslint-disable-line no-unused-vars
export opaque type ClientReferenceMetadata: any = null;
export opaque type ServerReferenceId: string = string;
export opaque type ClientReferenceKey: any = string;

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 getClientReferenceKey(
  reference: ClientReference<any>,
): ClientReferenceKey {
  throw new Error(
    'Attempted to render a Client Component from renderToHTML. ' +
      'This is not supported since it will never hydrate. ' +
      'Only render Server Components with renderToHTML.',
  );
}

export function resolveClientReferenceMetadata<T>(
  config: ClientManifest,
  clientReference: ClientReference<T>,
): ClientReferenceMetadata {
  throw new Error(
    'Attempted to render a Client Component from renderToHTML. ' +
      'This is not supported since it will never hydrate. ' +
      'Only render Server Components with renderToHTML.',
  );
}

export function getServerReferenceId<T>(
  config: ClientManifest,
  serverReference: ServerReference<T>,
): ServerReferenceId {
  throw new Error(
    'Attempted to render a Server Action from renderToHTML. ' +
      'This is not supported since it varies by version of the app. ' +
      'Use a fixed URL for any forms instead.',
  );
}

export function getServerReferenceBoundArguments<T>(
  config: ClientManifest,
  serverReference: ServerReference<T>,
): null | Array<ReactClientValue> {
  throw new Error(
    'Attempted to render a Server Action from renderToHTML. ' +
      'This is not supported since it varies by version of the app. ' +
      'Use a fixed URL for any forms instead.',
  );
}

export function getServerReferenceLocation<T>(
  config: ClientManifest,
  serverReference: ServerReference<T>,
): void {
  return undefined;
}

Domain

Subdomains

Dependencies

  • ReactFlightServer
  • ReactTypes

Frequently Asked Questions

What does ReactFlightServerConfig.markup.js do?
ReactFlightServerConfig.markup.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 ReactFlightServerConfig.markup.js?
ReactFlightServerConfig.markup.js defines 6 function(s): createHints, createRootFormatContext, getChildFormatContext, getClientReferenceKey, isClientReference, isServerReference.
What does ReactFlightServerConfig.markup.js depend on?
ReactFlightServerConfig.markup.js imports 2 module(s): ReactFlightServer, ReactTypes.
Where is ReactFlightServerConfig.markup.js in the architecture?
ReactFlightServerConfig.markup.js is located at packages/react-server/src/forks/ReactFlightServerConfig.markup.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-server/src/forks).

Analyze Your Own Codebase

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

Try Supermodel Free