Home / File/ infer-non-null-destructure.ts — react Source File

infer-non-null-destructure.ts — react Source File

Architecture documentation for infer-non-null-destructure.ts, a typescript file in the react codebase. 1 imports, 0 dependents.

File typescript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  79aaba72_1a17_297a_5c38_b2a69b539904["infer-non-null-destructure.ts"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  79aaba72_1a17_297a_5c38_b2a69b539904 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 79aaba72_1a17_297a_5c38_b2a69b539904 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @enablePropagateDepsInHIR
import {identity, useIdentity} from 'shared-runtime';

function useFoo({arg, cond}: {arg: number; cond: boolean}) {
  const maybeObj = useIdentity({value: arg});
  const {value} = maybeObj;
  useIdentity(null);
  /**
   * maybeObj.value should be inferred as the dependency of this scope
   * since we know that maybeObj is safe to read from (i.e. non-null)
   * due to the above destructuring instruction
   */
  const arr = [];
  if (cond) {
    arr.push(identity(maybeObj.value));
  }
  return {arr, value};
}

export const FIXTURE_ENTRYPOINT = {
  fn: useFoo,
  params: [{arg: 2, cond: false}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does infer-non-null-destructure.ts do?
infer-non-null-destructure.ts is a source file in the react codebase, written in typescript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in infer-non-null-destructure.ts?
infer-non-null-destructure.ts defines 1 function(s): useFoo.
What does infer-non-null-destructure.ts depend on?
infer-non-null-destructure.ts imports 1 module(s): shared-runtime.
Where is infer-non-null-destructure.ts in the architecture?
infer-non-null-destructure.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/infer-non-null-destructure.ts (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork).

Analyze Your Own Codebase

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

Try Supermodel Free