Home / File/ ReactFiberTransitionTypes.js — react Source File

ReactFiberTransitionTypes.js — react Source File

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

File javascript BabelCompiler Validation 4 imports 3 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  1e43c23f_3064_3cbe_7b30_bc1d04cb479f["ReactFiberTransitionTypes.js"]
  6b9f5caa_fb13_3d3c_2f60_ad3c4f58371f["ReactInternalTypes.js"]
  1e43c23f_3064_3cbe_7b30_bc1d04cb479f --> 6b9f5caa_fb13_3d3c_2f60_ad3c4f58371f
  768f6d67_77c1_be19_5596_a943eab59e05["ReactFiberLane.js"]
  1e43c23f_3064_3cbe_7b30_bc1d04cb479f --> 768f6d67_77c1_be19_5596_a943eab59e05
  76faa448_9fd8_5bef_16ff_7129054308ac["ReactTransitionType"]
  1e43c23f_3064_3cbe_7b30_bc1d04cb479f --> 76faa448_9fd8_5bef_16ff_7129054308ac
  8344de1b_978c_be0f_eebd_38ccc4962a93["ReactFeatureFlags"]
  1e43c23f_3064_3cbe_7b30_bc1d04cb479f --> 8344de1b_978c_be0f_eebd_38ccc4962a93
  6332839f_b3f6_a025_4ca8_e9753718df71["ReactFiberAsyncAction.js"]
  6332839f_b3f6_a025_4ca8_e9753718df71 --> 1e43c23f_3064_3cbe_7b30_bc1d04cb479f
  7b9cb3e8_e71c_27b2_61e8_fe54f0f80f0b["ReactFiberTransition.js"]
  7b9cb3e8_e71c_27b2_61e8_fe54f0f80f0b --> 1e43c23f_3064_3cbe_7b30_bc1d04cb479f
  d73e9290_2d2e_5d3f_97dd_84929f205c77["ReactFiberWorkLoop.js"]
  d73e9290_2d2e_5d3f_97dd_84929f205c77 --> 1e43c23f_3064_3cbe_7b30_bc1d04cb479f
  style 1e43c23f_3064_3cbe_7b30_bc1d04cb479f 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 {FiberRoot} from './ReactInternalTypes';
import type {TransitionTypes} from 'react/src/ReactTransitionType';

import {enableViewTransition} from 'shared/ReactFeatureFlags';
import {includesTransitionLane} from './ReactFiberLane';

export function queueTransitionTypes(
  root: FiberRoot,
  transitionTypes: TransitionTypes,
): void {
  if (enableViewTransition) {
    // TODO: We should really store transitionTypes per lane in a LaneMap on
    // the root. Then merge it when we commit. We currently assume that all
    // Transitions are entangled.
    if (includesTransitionLane(root.pendingLanes)) {
      let queued = root.transitionTypes;
      if (queued === null) {
        queued = root.transitionTypes = [];
      }
      for (let i = 0; i < transitionTypes.length; i++) {
        const transitionType = transitionTypes[i];
        if (queued.indexOf(transitionType) === -1) {
          queued.push(transitionType);
        }
      }
    }
  }
}

// Store all types while we're entangled with an async Transition.
export let entangledTransitionTypes: null | TransitionTypes = null;

export function entangleAsyncTransitionTypes(
  transitionTypes: TransitionTypes,
): void {
  if (enableViewTransition) {
    let queued = entangledTransitionTypes;
    if (queued === null) {
      queued = entangledTransitionTypes = [];
    }
    for (let i = 0; i < transitionTypes.length; i++) {
      const transitionType = transitionTypes[i];
      if (queued.indexOf(transitionType) === -1) {
        queued.push(transitionType);
      }
    }
  }
}

export function clearEntangledAsyncTransitionTypes() {
  // Called when all Async Actions are done.
  entangledTransitionTypes = null;
}

export function claimQueuedTransitionTypes(
  root: FiberRoot,
): null | TransitionTypes {
  const claimed = root.transitionTypes;
  root.transitionTypes = null;
  return claimed;
}

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ReactFiberTransitionTypes.js do?
ReactFiberTransitionTypes.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 ReactFiberTransitionTypes.js?
ReactFiberTransitionTypes.js defines 4 function(s): claimQueuedTransitionTypes, clearEntangledAsyncTransitionTypes, entangleAsyncTransitionTypes, queueTransitionTypes.
What does ReactFiberTransitionTypes.js depend on?
ReactFiberTransitionTypes.js imports 4 module(s): ReactFeatureFlags, ReactFiberLane.js, ReactInternalTypes.js, ReactTransitionType.
What files import ReactFiberTransitionTypes.js?
ReactFiberTransitionTypes.js is imported by 3 file(s): ReactFiberAsyncAction.js, ReactFiberTransition.js, ReactFiberWorkLoop.js.
Where is ReactFiberTransitionTypes.js in the architecture?
ReactFiberTransitionTypes.js is located at packages/react-reconciler/src/ReactFiberTransitionTypes.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-reconciler/src).

Analyze Your Own Codebase

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

Try Supermodel Free