Home / File/ TransformFire.ts — react Source File

TransformFire.ts — react Source File

Architecture documentation for TransformFire.ts, a typescript file in the react codebase. 15 imports, 0 dependents.

File typescript BabelCompiler Validation 15 imports 12 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  6061353e_921a_a1a8_d6c1_777e8d9f8896["TransformFire.ts"]
  0423f759_97e0_9101_4634_ed555abc5ca9["index.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 0423f759_97e0_9101_4634_ed555abc5ca9
  df6865e0_b573_e905_84d6_4eb6b419a888["HIRBuilder.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> df6865e0_b573_e905_84d6_4eb6b419a888
  49446ae1_b830_9411_8258_1139d21b314b["createTemporaryPlace"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 49446ae1_b830_9411_8258_1139d21b314b
  0c09df5a_6c07_11e5_1a6b_9253007463b8["markInstructionIds"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 0c09df5a_6c07_11e5_1a6b_9253007463b8
  eb9d33f9_42c1_205c_93e6_8e1365a31839["utils.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> eb9d33f9_42c1_205c_93e6_8e1365a31839
  4663af75_e270_25e3_3415_1230be609d66["getOrInsertWith"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 4663af75_e270_25e3_3415_1230be609d66
  58f81300_7c82_5086_3e10_e46b5f3ab04d["ObjectShape.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 58f81300_7c82_5086_3e10_e46b5f3ab04d
  2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 2f3caf55_cc64_415c_55dd_9771ba7dc210
  ccace1c3_85b7_a05e_c2a5_7eff8b3422ed["eachInstructionOperand"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> ccace1c3_85b7_a05e_c2a5_7eff8b3422ed
  6976a9ee_9d8e_4f16_3016_495f39aff2fd["PrintHIR.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 6976a9ee_9d8e_4f16_3016_495f39aff2fd
  109b0dcb_1439_a6cc_f796_4ddf088678a3["printSourceLocationLine"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 109b0dcb_1439_a6cc_f796_4ddf088678a3
  1b971013_8a90_0d8d_1fcc_f31581cd66aa["Environment.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> 1b971013_8a90_0d8d_1fcc_f31581cd66aa
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> e96f281e_f381_272d_2359_3e6a091c9a1d
  a2b91621_58d3_1d04_4663_00cd808f1034["ErrorCategory"]
  6061353e_921a_a1a8_d6c1_777e8d9f8896 --> a2b91621_58d3_1d04_4663_00cd808f1034
  style 6061353e_921a_a1a8_d6c1_777e8d9f8896 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 {CompilerError, CompilerErrorDetailOptions, SourceLocation} from '..';
import {
  ArrayExpression,
  CallExpression,
  Effect,
  Environment,
  FunctionExpression,
  GeneratedSource,
  HIRFunction,
  Identifier,
  IdentifierId,
  Instruction,
  InstructionId,
  InstructionKind,
  InstructionValue,
  isUseEffectHookType,
  LoadLocal,
  makeInstructionId,
  NonLocalImportSpecifier,
  Place,
  promoteTemporary,
} from '../HIR';
import {createTemporaryPlace, markInstructionIds} from '../HIR/HIRBuilder';
import {getOrInsertWith} from '../Utils/utils';
import {
  BuiltInFireFunctionId,
  BuiltInFireId,
  DefaultNonmutatingHook,
} from '../HIR/ObjectShape';
import {eachInstructionOperand} from '../HIR/visitors';
import {printSourceLocationLine} from '../HIR/PrintHIR';
import {USE_FIRE_FUNCTION_NAME} from '../HIR/Environment';
import {ErrorCategory} from '../CompilerError';

/*
 * TODO(jmbrown):
 *   - traverse object methods
 *   - method calls
 *   - React.useEffect calls
 */

const CANNOT_COMPILE_FIRE = 'Cannot compile `fire`';

export function transformFire(fn: HIRFunction): void {
  const context = new Context(fn.env);
  replaceFireFunctions(fn, context);
  if (!context.hasErrors()) {
    ensureNoMoreFireUses(fn, context);
  }
  context.throwIfErrorsFound();
}

function replaceFireFunctions(fn: HIRFunction, context: Context): void {
// ... (680 more lines)

Domain

Subdomains

Classes

Frequently Asked Questions

What does TransformFire.ts do?
TransformFire.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in TransformFire.ts?
TransformFire.ts defines 12 function(s): deleteInstructions, eachReachablePlace, ensureNoMoreFireUses, ensureNoRemainingCalleeCaptures, makeCallUseFireInstruction, makeLoadFireCalleeInstruction, makeLoadUseFireInstruction, makeStoreUseFireInstruction, replaceFireFunctions, rewriteInstructions, and 2 more.
What does TransformFire.ts depend on?
TransformFire.ts imports 15 module(s): .., CompilerError.ts, Environment.ts, ErrorCategory, HIRBuilder.ts, ObjectShape.ts, PrintHIR.ts, createTemporaryPlace, and 7 more.
Where is TransformFire.ts in the architecture?
TransformFire.ts is located at compiler/packages/babel-plugin-react-compiler/src/Transform/TransformFire.ts (domain: BabelCompiler, subdomain: Validation, directory: compiler/packages/babel-plugin-react-compiler/src/Transform).

Analyze Your Own Codebase

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

Try Supermodel Free