Home / File/ repro-allocating-ternary-test-instruction-scope.ts — react Source File

repro-allocating-ternary-test-instruction-scope.ts — react Source File

Architecture documentation for repro-allocating-ternary-test-instruction-scope.ts, a typescript file in the react codebase. 1 imports, 0 dependents.

File typescript TestingUtilities Fixtures 1 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  c20f7fec_9e90_8bd2_9b68_6da2452fe9e2["repro-allocating-ternary-test-instruction-scope.ts"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  c20f7fec_9e90_8bd2_9b68_6da2452fe9e2 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style c20f7fec_9e90_8bd2_9b68_6da2452fe9e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {identity, makeObject_Primitives} from 'shared-runtime';

function useHook() {}

function useTest({cond}) {
  const val = makeObject_Primitives();

  useHook();
  /**
   * We don't technically need a reactive scope for this ternary as
   * it cannot produce newly allocated values.
   * While identity(...) may allocate, we can teach the compiler that
   * its result is only used as as a test condition
   */
  const result = identity(cond) ? val : null;
  return result;
}

export const FIXTURE_ENTRYPOINT = {
  fn: useTest,
  params: [{cond: true}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does repro-allocating-ternary-test-instruction-scope.ts do?
repro-allocating-ternary-test-instruction-scope.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 repro-allocating-ternary-test-instruction-scope.ts?
repro-allocating-ternary-test-instruction-scope.ts defines 2 function(s): useHook, useTest.
What does repro-allocating-ternary-test-instruction-scope.ts depend on?
repro-allocating-ternary-test-instruction-scope.ts imports 1 module(s): shared-runtime.
Where is repro-allocating-ternary-test-instruction-scope.ts in the architecture?
repro-allocating-ternary-test-instruction-scope.ts is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-allocating-ternary-test-instruction-scope.ts (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free