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

superpath-order1.js — react Source File

Architecture documentation for superpath-order1.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
  2e48a1dd_3a63_cb0e_918e_77e0d15b33f1["superpath-order1.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  2e48a1dd_3a63_cb0e_918e_77e0d15b33f1 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style 2e48a1dd_3a63_cb0e_918e_77e0d15b33f1 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 useConditionalSuperpath1({props, cond}) {
  const x = {};
  x.a = props.a;
  if (identity(cond)) {
    x.b = props.a.b;
  }
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: useConditionalSuperpath1,
  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-order1.js do?
superpath-order1.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-order1.js?
superpath-order1.js defines 1 function(s): useConditionalSuperpath1.
What does superpath-order1.js depend on?
superpath-order1.js imports 1 module(s): shared-runtime.
Where is superpath-order1.js in the architecture?
superpath-order1.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order1.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