Home / Type/ InstructionValue Type — react Architecture

InstructionValue Type — react Architecture

Architecture documentation for the InstructionValue type/interface in HIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b99c825f_2e15_fbd5_332e_fb1b900c8ca9["InstructionValue"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  b99c825f_2e15_fbd5_332e_fb1b900c8ca9 -->|defined in| 18a78965_f593_105b_e5e8_07001321c2ec
  style b99c825f_2e15_fbd5_332e_fb1b900c8ca9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts lines 899–1124

export type InstructionValue =
  | LoadLocal
  | LoadContext
  | {
      kind: 'DeclareLocal';
      lvalue: LValue;
      type: t.FlowType | t.TSType | null;
      loc: SourceLocation;
    }
  | {
      kind: 'DeclareContext';
      lvalue: {
        kind:
          | InstructionKind.Let
          | InstructionKind.HoistedConst
          | InstructionKind.HoistedLet
          | InstructionKind.HoistedFunction;
        place: Place;
      };
      loc: SourceLocation;
    }
  | StoreLocal
  | {
      kind: 'StoreContext';
      /**
       * StoreContext kinds:
       * Reassign: context variable reassignment in source
       * Const:    const declaration + assignment in source
       *           ('const' context vars are ones whose declarations are hoisted)
       * Let:      let declaration + assignment in source
       * Function: function declaration in source (similar to `const`)
       */
      lvalue: {
        kind:
          | InstructionKind.Reassign
          | InstructionKind.Const
          | InstructionKind.Let
          | InstructionKind.Function;
        place: Place;
      };
      value: Place;
      loc: SourceLocation;
    }
  | Destructure
  | {
      kind: 'Primitive';
      value: number | boolean | string | null | undefined;
      loc: SourceLocation;
    }
  | JSXText
  | {
      kind: 'BinaryExpression';
      operator: Exclude<t.BinaryExpression['operator'], '|>'>;
      left: Place;
      right: Place;
      loc: SourceLocation;
    }
  | NewExpression
  | CallExpression
  | MethodCall
  | {
      kind: 'UnaryExpression';
      operator: Exclude<t.UnaryExpression['operator'], 'throw' | 'delete'>;
      value: Place;
      loc: SourceLocation;
    }
  | ({
      kind: 'TypeCastExpression';
      value: Place;
      type: Type;
      loc: SourceLocation;
    } & (
      | {
          typeAnnotation: t.FlowType;
          typeAnnotationKind: 'cast';
        }
      | {
          typeAnnotation: t.TSType;
          typeAnnotationKind: 'as' | 'satisfies';
        }
    ))

Frequently Asked Questions

What is the InstructionValue type?
InstructionValue is a type/interface in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts.
Where is InstructionValue defined?
InstructionValue is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts at line 899.

Analyze Your Own Codebase

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

Try Supermodel Free