Home / File/ no-uncond.js — react Source File

no-uncond.js — react Source File

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

Relationship Graph

Source Code

// When an object's properties are only read conditionally, we should

import {identity} from 'shared-runtime';

// track the base object as a dependency.
function useOnlyConditionalDependencies({props, cond}) {
  const x = {};
  if (identity(cond)) {
    x.b = props.a.b;
    x.c = props.a.b.c;
  }
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: useOnlyConditionalDependencies,
  params: [{props: {a: {b: 2}}, cond: true}],
  sequentialRenders: [
    {props: {a: {b: 2}}, cond: true},
    {props: null, cond: false},
    // check we preserve nullthrows
    {props: {a: {b: {c: undefined}}}, cond: true},
    {props: {a: {b: undefined}}, cond: true},
    {props: {a: {b: {c: undefined}}}, cond: true},
    {props: undefined, cond: true},
  ],
};

Subdomains

Dependencies

  • shared-runtime

Frequently Asked Questions

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