Home / File/ superpath-order2.js — react Source File

superpath-order2.js — react Source File

Architecture documentation for superpath-order2.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
  ad51a7d6_820c_55c7_4081_95582a7bceef["superpath-order2.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  ad51a7d6_820c_55c7_4081_95582a7bceef --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style ad51a7d6_820c_55c7_4081_95582a7bceef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// When an unconditional dependency `props.a` is the subpath of a conditional
// dependency `props.a.b`, we can safely overestimate and only track `props.a`
// as a dependency

import {identity} from 'shared-runtime';

// ordering of accesses should not matter
function useConditionalSuperpath2({props, cond}) {
  const x = {};
  if (identity(cond)) {
    x.b = props.a.b;
  }
  x.a = props.a;
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: useConditionalSuperpath2,
  params: [{props: {a: null}, cond: false}],
  sequentialRenders: [
    {props: {a: null}, cond: false},
    {props: {a: {}}, cond: true},
    {props: {a: {b: 3}}, cond: true},
    {props: {}, cond: false},
    // test that we preserve nullthrows
    {props: {a: {b: undefined}}, cond: true},
    {props: {a: undefined}, cond: true},
  ],
};

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

What does superpath-order2.js do?
superpath-order2.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 superpath-order2.js?
superpath-order2.js defines 1 function(s): useConditionalSuperpath2.
What does superpath-order2.js depend on?
superpath-order2.js imports 1 module(s): shared-runtime.
Where is superpath-order2.js in the architecture?
superpath-order2.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order2.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps).

Analyze Your Own Codebase

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

Try Supermodel Free