Home / File/ align-scopes-within-nested-valueblock-in-array.tsx — react Source File

align-scopes-within-nested-valueblock-in-array.tsx — react Source File

Architecture documentation for align-scopes-within-nested-valueblock-in-array.tsx, a tsx file in the react codebase. 1 imports, 0 dependents.

File tsx TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  63d03adb_f129_d262_8b75_3f6e61bf8786["align-scopes-within-nested-valueblock-in-array.tsx"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  63d03adb_f129_d262_8b75_3f6e61bf8786 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 63d03adb_f129_d262_8b75_3f6e61bf8786 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {Stringify, identity, makeArray, mutate} from 'shared-runtime';

/**
 * Here, identity('foo') is an immutable allocating instruction.
 * `arr` is a mutable value whose mutable range ends at `arr.map`.
 *
 * The previous (reactive function) version of alignScopesToBlocks set the range of
 * both scopes to end at value blocks within the <></> expression.
 * However, both scope ranges should be aligned to the outer value block
 * (e.g. `cond1 ? <>: null`). The HIR version of alignScopesToBlocks
 * handles this correctly.
 */
function Foo({cond1, cond2}) {
  const arr = makeArray<any>({a: 2}, 2, []);

  return cond1 ? (
    <>
      <div>{identity('foo')}</div>
      <Stringify value={cond2 ? arr.map(mutate) : null} />
    </>
  ) : null;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Foo,
  params: [{cond1: true, cond2: true}],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does align-scopes-within-nested-valueblock-in-array.tsx do?
align-scopes-within-nested-valueblock-in-array.tsx is a source file in the react codebase, written in tsx. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in align-scopes-within-nested-valueblock-in-array.tsx?
align-scopes-within-nested-valueblock-in-array.tsx defines 1 function(s): Foo.
What does align-scopes-within-nested-valueblock-in-array.tsx depend on?
align-scopes-within-nested-valueblock-in-array.tsx imports 1 module(s): shared-runtime.
Where is align-scopes-within-nested-valueblock-in-array.tsx in the architecture?
align-scopes-within-nested-valueblock-in-array.tsx is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-within-nested-valueblock-in-array.tsx (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