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

subpath-order1.js — react Source File

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

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

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

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