Home / File/ ReactFiberCacheComponent.js — react Source File

ReactFiberCacheComponent.js — react Source File

Architecture documentation for ReactFiberCacheComponent.js, a javascript file in the react codebase. 5 imports, 11 dependents.

File javascript BabelCompiler Validation 5 imports 11 dependents 6 functions

Entity Profile

Dependency Diagram

graph LR
  8d310484_4245_75c0_c183_7a31fce6815e["ReactFiberCacheComponent.js"]
  278c890a_abdf_e007_0c26_ae3bc8eda908["ReactFiberNewContext.js"]
  8d310484_4245_75c0_c183_7a31fce6815e --> 278c890a_abdf_e007_0c26_ae3bc8eda908
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  8d310484_4245_75c0_c183_7a31fce6815e --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  42892443_e223_3da0_aeb9_e1b32a408fb0["ReactInternalTypes"]
  8d310484_4245_75c0_c183_7a31fce6815e --> 42892443_e223_3da0_aeb9_e1b32a408fb0
  e1e1de60_2be4_0643_45fb_e2c306735427["ReactSymbols"]
  8d310484_4245_75c0_c183_7a31fce6815e --> e1e1de60_2be4_0643_45fb_e2c306735427
  cf0374be_82da_b932_450f_9145a907b064["scheduler"]
  8d310484_4245_75c0_c183_7a31fce6815e --> cf0374be_82da_b932_450f_9145a907b064
  d204555d_8af7_71f6_c18b_ea6503e178bf["ReactFiberAsyncDispatcher.js"]
  d204555d_8af7_71f6_c18b_ea6503e178bf --> 8d310484_4245_75c0_c183_7a31fce6815e
  0be70812_cc0c_b210_f84f_8e61dd5f831c["ReactFiberBeginWork.js"]
  0be70812_cc0c_b210_f84f_8e61dd5f831c --> 8d310484_4245_75c0_c183_7a31fce6815e
  e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"]
  e0fbfbd5_47b0_a489_0b36_bbfad9245544 --> 8d310484_4245_75c0_c183_7a31fce6815e
  6b05669d_2f09_63a5_e79f_0afc195f25a3["ReactFiberCompleteWork.js"]
  6b05669d_2f09_63a5_e79f_0afc195f25a3 --> 8d310484_4245_75c0_c183_7a31fce6815e
  85d2c68c_7609_2c66_22fb_5f02e8a2e8fe["ReactFiberHooks.js"]
  85d2c68c_7609_2c66_22fb_5f02e8a2e8fe --> 8d310484_4245_75c0_c183_7a31fce6815e
  79172409_a09a_afa9_9185_df1c9182af84["ReactFiberOffscreenComponent.js"]
  79172409_a09a_afa9_9185_df1c9182af84 --> 8d310484_4245_75c0_c183_7a31fce6815e
  ffca4edd_b46d_4530_2580_e6e4e786c422["ReactFiberRoot.js"]
  ffca4edd_b46d_4530_2580_e6e4e786c422 --> 8d310484_4245_75c0_c183_7a31fce6815e
  7b9cb3e8_e71c_27b2_61e8_fe54f0f80f0b["ReactFiberTransition.js"]
  7b9cb3e8_e71c_27b2_61e8_fe54f0f80f0b --> 8d310484_4245_75c0_c183_7a31fce6815e
  53e7e9e3_9e8c_648e_1f4e_0fdfa5c5cb8f["ReactFiberUnwindWork.js"]
  53e7e9e3_9e8c_648e_1f4e_0fdfa5c5cb8f --> 8d310484_4245_75c0_c183_7a31fce6815e
  style 8d310484_4245_75c0_c183_7a31fce6815e 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 {ReactContext} from 'shared/ReactTypes';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';

import {REACT_CONTEXT_TYPE} from 'shared/ReactSymbols';

import {pushProvider, popProvider} from './ReactFiberNewContext';
import * as Scheduler from 'scheduler';

// In environments without AbortController (e.g. tests)
// replace it with a lightweight shim that only has the features we use.
const AbortControllerLocal: typeof AbortController =
  typeof AbortController !== 'undefined'
    ? AbortController
    : // $FlowFixMe[incompatible-type]
      // $FlowFixMe[missing-this-annot]
      function AbortControllerShim() {
        const listeners = [];
        const signal = (this.signal = {
          aborted: false as boolean,
          addEventListener: (type, listener) => {
            listeners.push(listener);
          },
        });

        this.abort = () => {
          signal.aborted = true;
          listeners.forEach(listener => listener());
        };
      };

export type Cache = {
  controller: AbortController,
  data: Map<() => mixed, mixed>,
  refCount: number,
};

export type CacheComponentState = {
  +parent: Cache,
  +cache: Cache,
};

export type SpawnedCachePool = {
  +parent: Cache,
  +pool: Cache,
};

// Intentionally not named imports because Rollup would
// use dynamic dispatch for CommonJS interop named imports.
const {
  unstable_scheduleCallback: scheduleCallback,
  unstable_NormalPriority: NormalPriority,
// ... (67 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ReactFiberCacheComponent.js do?
ReactFiberCacheComponent.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 ReactFiberCacheComponent.js?
ReactFiberCacheComponent.js defines 6 function(s): AbortControllerLocal, createCache, popCacheProvider, pushCacheProvider, releaseCache, retainCache.
What does ReactFiberCacheComponent.js depend on?
ReactFiberCacheComponent.js imports 5 module(s): ReactFiberNewContext.js, ReactInternalTypes, ReactSymbols, ReactTypes, scheduler.
What files import ReactFiberCacheComponent.js?
ReactFiberCacheComponent.js is imported by 11 file(s): ReactFiberAsyncDispatcher.js, ReactFiberBeginWork.js, ReactFiberCommitWork.js, ReactFiberCompleteWork.js, ReactFiberHooks.js, ReactFiberOffscreenComponent.js, ReactFiberRoot.js, ReactFiberTransition.js, and 3 more.
Where is ReactFiberCacheComponent.js in the architecture?
ReactFiberCacheComponent.js is located at packages/react-reconciler/src/ReactFiberCacheComponent.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