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

subpath-order2.js — react Source File

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

Relationship Graph

Source Code

// When a conditional dependency `props.a` is a subpath of an unconditional
// dependency `props.a.b`, we can access `props.a` while preserving program
// semantics (with respect to nullthrows).
// deps: {`props.a`, `props.a.b`} can further reduce to just `props.a`

import {identity} from 'shared-runtime';

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

export const FIXTURE_ENTRYPOINT = {
  fn: useConditionalSubpath2,
  params: [{a: {b: 3}}, false],
};

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

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