Home / File/ PropagateScopeDependenciesHIR.ts — react Source File

PropagateScopeDependenciesHIR.ts — react Source File

Architecture documentation for PropagateScopeDependenciesHIR.ts, a typescript file in the react codebase. 45 imports, 2 dependents.

File typescript MIRInfrastructure HIR 45 imports 2 dependents 8 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  76832af2_c0a7_f31c_e448_af5664da4b88["PropagateScopeDependenciesHIR.ts"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 18a78965_f593_105b_e5e8_07001321c2ec
  2000a5ea_d4ee_1737_10c8_f1b98f24004e["ScopeId"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 2000a5ea_d4ee_1737_10c8_f1b98f24004e
  9241c5c1_a9a7_17bc_e41c_e967225008dd["HIRFunction"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 9241c5c1_a9a7_17bc_e41c_e967225008dd
  c7aaa235_c19e_3530_31c2_911f38eed3e0["Place"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> c7aaa235_c19e_3530_31c2_911f38eed3e0
  02d16d8e_0a17_fa6f_eeef_ee0c7d25bd36["Instruction"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 02d16d8e_0a17_fa6f_eeef_ee0c7d25bd36
  67538878_fe95_51b1_23f8_f71e2575832c["ReactiveScopeDependency"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 67538878_fe95_51b1_23f8_f71e2575832c
  bd003dbd_e691_524b_0cf4_50e080ffea94["Identifier"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> bd003dbd_e691_524b_0cf4_50e080ffea94
  ca9a6820_460e_0b15_8169_3aa4c6503770["ReactiveScope"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> ca9a6820_460e_0b15_8169_3aa4c6503770
  206bc538_facf_a3c4_b99c_e6c96e4aa11a["isObjectMethodType"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 206bc538_facf_a3c4_b99c_e6c96e4aa11a
  9b550baf_b3c9_a36a_101b_988d1ebb847c["isRefValueType"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 9b550baf_b3c9_a36a_101b_988d1ebb847c
  6e7c932f_5e2d_52c4_1399_ff365b3858b6["isUseRefType"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 6e7c932f_5e2d_52c4_1399_ff365b3858b6
  d0270ab6_a621_bd55_a1b9_a5cad8b406b2["makeInstructionId"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> d0270ab6_a621_bd55_a1b9_a5cad8b406b2
  23767d65_9554_fcd2_f2aa_7de7634389f9["InstructionId"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 23767d65_9554_fcd2_f2aa_7de7634389f9
  03aa18e2_bd2c_e9cb_5973_bae3ec02373c["InstructionKind"]
  76832af2_c0a7_f31c_e448_af5664da4b88 --> 03aa18e2_bd2c_e9cb_5973_bae3ec02373c
  style 76832af2_c0a7_f31c_e448_af5664da4b88 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.
 */

import {
  ScopeId,
  HIRFunction,
  Place,
  Instruction,
  ReactiveScopeDependency,
  Identifier,
  ReactiveScope,
  isObjectMethodType,
  isRefValueType,
  isUseRefType,
  makeInstructionId,
  InstructionId,
  InstructionKind,
  GeneratedSource,
  DeclarationId,
  areEqualPaths,
  IdentifierId,
  Terminal,
  InstructionValue,
  LoadContext,
  TInstruction,
  FunctionExpression,
  ObjectMethod,
  PropertyLiteral,
  convertHoistedLValueKind,
} from './HIR';
import {
  collectHoistablePropertyLoads,
  keyByScopeId,
} from './CollectHoistablePropertyLoads';
import {
  ScopeBlockTraversal,
  eachInstructionOperand,
  eachInstructionValueOperand,
  eachPatternOperand,
  eachTerminalOperand,
} from './visitors';
import {Stack, empty} from '../Utils/Stack';
import {CompilerError} from '../CompilerError';
import {Iterable_some} from '../Utils/utils';
import {ReactiveScopeDependencyTreeHIR} from './DeriveMinimalDependenciesHIR';
import {collectOptionalChainSidemap} from './CollectOptionalChainDependencies';

export function propagateScopeDependenciesHIR(fn: HIRFunction): void {
  const usedOutsideDeclaringScope =
    findTemporariesUsedOutsideDeclaringScope(fn);
  const temporaries = collectTemporariesSidemap(fn, usedOutsideDeclaringScope);
  const {
    temporariesReadInOptional,
    processedInstrsInOptional,
    hoistableObjects,
  } = collectOptionalChainSidemap(fn);
// ... (775 more lines)

Subdomains

Types

Frequently Asked Questions

What does PropagateScopeDependenciesHIR.ts do?
PropagateScopeDependenciesHIR.ts is a source file in the react codebase, written in typescript. It belongs to the MIRInfrastructure domain, HIR subdomain.
What functions are defined in PropagateScopeDependenciesHIR.ts?
PropagateScopeDependenciesHIR.ts defines 8 function(s): collectDependencies, collectTemporariesSidemap, collectTemporariesSidemapImpl, findTemporariesUsedOutsideDeclaringScope, getProperty, handleInstruction, isLoadContextMutable, propagateScopeDependenciesHIR.
What does PropagateScopeDependenciesHIR.ts depend on?
PropagateScopeDependenciesHIR.ts imports 45 module(s): CollectHoistablePropertyLoads.ts, CollectOptionalChainDependencies.ts, CompilerError, CompilerError.ts, DeclarationId, DeriveMinimalDependenciesHIR.ts, FunctionExpression, HIR.ts, and 37 more.
What files import PropagateScopeDependenciesHIR.ts?
PropagateScopeDependenciesHIR.ts is imported by 2 file(s): InferEffectDependencies.ts, Pipeline.ts.
Where is PropagateScopeDependenciesHIR.ts in the architecture?
PropagateScopeDependenciesHIR.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/PropagateScopeDependenciesHIR.ts (domain: MIRInfrastructure, subdomain: HIR, directory: compiler/packages/babel-plugin-react-compiler/src/HIR).

Analyze Your Own Codebase

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

Try Supermodel Free