Home / File/ ScopeDependencyUtils.ts — react Source File

ScopeDependencyUtils.ts — react Source File

Architecture documentation for ScopeDependencyUtils.ts, a typescript file in the react codebase. 19 imports, 1 dependents.

File typescript MIRInfrastructure HIR 19 imports 1 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994["ScopeDependencyUtils.ts"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 18a78965_f593_105b_e5e8_07001321c2ec
  c7aaa235_c19e_3530_31c2_911f38eed3e0["Place"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> c7aaa235_c19e_3530_31c2_911f38eed3e0
  67538878_fe95_51b1_23f8_f71e2575832c["ReactiveScopeDependency"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 67538878_fe95_51b1_23f8_f71e2575832c
  bd003dbd_e691_524b_0cf4_50e080ffea94["Identifier"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> bd003dbd_e691_524b_0cf4_50e080ffea94
  d0270ab6_a621_bd55_a1b9_a5cad8b406b2["makeInstructionId"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> d0270ab6_a621_bd55_a1b9_a5cad8b406b2
  03aa18e2_bd2c_e9cb_5973_bae3ec02373c["InstructionKind"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 03aa18e2_bd2c_e9cb_5973_bae3ec02373c
  4a73a9b9_07eb_502f_14c1_2f045ba2666c["BlockId"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 4a73a9b9_07eb_502f_14c1_2f045ba2666c
  4e7c3351_9e52_0196_d1f4_d8371b23d0cb["makeTemporaryIdentifier"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 4e7c3351_9e52_0196_d1f4_d8371b23d0cb
  60d25db4_8803_db04_13e8_2251272ec589["Effect"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 60d25db4_8803_db04_13e8_2251272ec589
  b520037e_e135_2bd9_f501_1fe9a8324ce5["GotoVariant"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> b520037e_e135_2bd9_f501_1fe9a8324ce5
  84e61022_6608_cd44_18fd_5844dea02b4f["HIR"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 84e61022_6608_cd44_18fd_5844dea02b4f
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> e96f281e_f381_272d_2359_3e6a091c9a1d
  e51fd0d2_bb38_cc97_7763_efe37f300a47["CompilerError"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> e51fd0d2_bb38_cc97_7763_efe37f300a47
  1b971013_8a90_0d8d_1fcc_f31581cd66aa["Environment.ts"]
  a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 --> 1b971013_8a90_0d8d_1fcc_f31581cd66aa
  style a4fd6965_224d_0ddc_a6f9_b2f74cfd3994 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {
  Place,
  ReactiveScopeDependency,
  Identifier,
  makeInstructionId,
  InstructionKind,
  GeneratedSource,
  BlockId,
  makeTemporaryIdentifier,
  Effect,
  GotoVariant,
  HIR,
} from './HIR';
import {CompilerError} from '../CompilerError';
import {Environment} from './Environment';
import HIRBuilder from './HIRBuilder';
import {lowerValueToTemporary} from './BuildHIR';

type DependencyInstructions = {
  place: Place;
  value: HIR;
  exitBlockId: BlockId;
};

export function buildDependencyInstructions(
  dep: ReactiveScopeDependency,
  env: Environment,
): DependencyInstructions {
  const builder = new HIRBuilder(env, {
    entryBlockKind: 'value',
  });
  let dependencyValue: Identifier;
  if (dep.path.every(path => !path.optional)) {
    dependencyValue = writeNonOptionalDependency(dep, env, builder);
  } else {
    dependencyValue = writeOptionalDependency(dep, builder, null);
  }

  const exitBlockId = builder.terminate(
    {
      kind: 'unsupported',
      loc: GeneratedSource,
      id: makeInstructionId(0),
    },
    null,
  );
  return {
    place: {
      kind: 'Identifier',
      identifier: dependencyValue,
      effect: Effect.Freeze,
      reactive: dep.reactive,
      loc: GeneratedSource,
    },
    value: builder.build(),
    exitBlockId,
  };
}

/**
// ... (222 more lines)

Subdomains

Frequently Asked Questions

What does ScopeDependencyUtils.ts do?
ScopeDependencyUtils.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 ScopeDependencyUtils.ts?
ScopeDependencyUtils.ts defines 3 function(s): buildDependencyInstructions, writeNonOptionalDependency, writeOptionalDependency.
What does ScopeDependencyUtils.ts depend on?
ScopeDependencyUtils.ts imports 19 module(s): BlockId, BuildHIR.ts, CompilerError, CompilerError.ts, Effect, Environment, Environment.ts, GotoVariant, and 11 more.
What files import ScopeDependencyUtils.ts?
ScopeDependencyUtils.ts is imported by 1 file(s): InferEffectDependencies.ts.
Where is ScopeDependencyUtils.ts in the architecture?
ScopeDependencyUtils.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/ScopeDependencyUtils.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