Home / File/ allocating-primitive-as-dep-nested-scope.js — react Source File

allocating-primitive-as-dep-nested-scope.js — react Source File

Architecture documentation for allocating-primitive-as-dep-nested-scope.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  abfcd953_c4c4_c575_ffd2_f0beeffddec3["allocating-primitive-as-dep-nested-scope.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  abfcd953_c4c4_c575_ffd2_f0beeffddec3 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style abfcd953_c4c4_c575_ffd2_f0beeffddec3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// bar(props.b) is an allocating expression that produces a primitive, which means
// that Forget should memoize it.
// Correctness:

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

//   - y depends on either bar(props.b) or bar(props.b) + 1
function AllocatingPrimitiveAsDepNested(props) {
  let x = {};
  mutate(x);
  let y = identity(identity(props.b) + 1);
  setProperty(x, props.a);
  return [x, y];
}

export const FIXTURE_ENTRYPOINT = {
  fn: AllocatingPrimitiveAsDepNested,
  params: [{a: 1, b: 2}],
  sequentialRenders: [
    // change b
    {a: 1, b: 3},
    // change b
    {a: 1, b: 4},
    // change a
    {a: 2, b: 4},
    // change a
    {a: 3, b: 4},
  ],
};

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

What does allocating-primitive-as-dep-nested-scope.js do?
allocating-primitive-as-dep-nested-scope.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in allocating-primitive-as-dep-nested-scope.js?
allocating-primitive-as-dep-nested-scope.js defines 1 function(s): AllocatingPrimitiveAsDepNested.
What does allocating-primitive-as-dep-nested-scope.js depend on?
allocating-primitive-as-dep-nested-scope.js imports 1 module(s): shared-runtime.
Where is allocating-primitive-as-dep-nested-scope.js in the architecture?
allocating-primitive-as-dep-nested-scope.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allocating-primitive-as-dep-nested-scope.js (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