Home / Type/ FunctionSignature Type — react Architecture

FunctionSignature Type — react Architecture

Architecture documentation for the FunctionSignature type/interface in ObjectShape.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8518cb66_056b_e4aa_6ee1_ca8ccd215d4e["FunctionSignature"]
  58f81300_7c82_5086_3e10_e46b5f3ab04d["ObjectShape.ts"]
  8518cb66_056b_e4aa_6ee1_ca8ccd215d4e -->|defined in| 58f81300_7c82_5086_3e10_e46b5f3ab04d
  style 8518cb66_056b_e4aa_6ee1_ca8ccd215d4e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/ObjectShape.ts lines 298–339

export type FunctionSignature = {
  positionalParams: Array<Effect>;
  restParam: Effect | null;
  returnType: BuiltInType | PolyType;
  returnValueKind: ValueKind;

  /**
   * For functions that return frozen/immutable values, the reason provides a more
   * precise error message for any (invalid) mutations of the value.
   */
  returnValueReason?: ValueReason;

  calleeEffect: Effect;
  hookKind: HookKind | null;
  /*
   * Whether any of the parameters may be aliased by each other or the return
   * value. Defaults to false (parameters may alias). When true, the compiler
   * may choose not to memoize arguments if they do not otherwise escape.
   */
  noAlias?: boolean;

  /**
   * Supported only for methods (no-op when used on functions in CallExpression.callee position).
   *
   * Indicates that the method can only modify its receiver if any of the arguments
   * are mutable or are function expressions which mutate their arguments. This is designed
   * for methods such as Array.prototype.map(), which only mutate the receiver array if they are
   * passed a callback which has mutable side-effects (including mutating its inputs).
   *
   * MethodCalls to such functions will use a different behavior depending on their arguments:
   * - If arguments are all non-mutable, the arguments get the Read effect and the receiver is Capture.
   * - Else uses the effects specified by this signature.
   */
  mutableOnlyIfOperandsAreMutable?: boolean;

  impure?: boolean;
  knownIncompatible?: string | null | undefined;

  canonicalName?: string;

  aliasing?: AliasingSignature | null | undefined;
};

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free