Home / File/ ValidateExhaustiveDependencies.ts — react Source File

ValidateExhaustiveDependencies.ts — react Source File

Architecture documentation for ValidateExhaustiveDependencies.ts, a typescript file in the react codebase. 17 imports, 1 dependents.

File typescript BabelCompiler Validation 17 imports 1 dependents 12 functions

Entity Profile

Dependency Diagram

graph LR
  fe7a7397_dddc_7222_20d4_d5b1015466f1["ValidateExhaustiveDependencies.ts"]
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> e96f281e_f381_272d_2359_3e6a091c9a1d
  85be47eb_0bce_bd23_62f4_30764408dfc2["CompilerSuggestion"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 85be47eb_0bce_bd23_62f4_30764408dfc2
  a2b91621_58d3_1d04_4663_00cd808f1034["ErrorCategory"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> a2b91621_58d3_1d04_4663_00cd808f1034
  0423f759_97e0_9101_4634_ed555abc5ca9["index.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 0423f759_97e0_9101_4634_ed555abc5ca9
  2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 2f3caf55_cc64_415c_55dd_9771ba7dc210
  10043bf1_f7ee_9ed9_307a_fe3edfd02b09["eachInstructionLValue"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 10043bf1_f7ee_9ed9_307a_fe3edfd02b09
  21b1eb1e_eaf5_5238_3a24_f56eb8ef7278["eachInstructionValueLValue"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 21b1eb1e_eaf5_5238_3a24_f56eb8ef7278
  b2fc2985_a7ba_9865_c2a3_2a7531f27d44["eachInstructionValueOperand"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> b2fc2985_a7ba_9865_c2a3_2a7531f27d44
  41232a25_deb6_6e83_05a8_ae9f961656f7["eachTerminalOperand"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 41232a25_deb6_6e83_05a8_ae9f961656f7
  494e3425_0b47_293a_1ea4_d4670b0fc0e7["Result.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 494e3425_0b47_293a_1ea4_d4670b0fc0e7
  7aace723_0ee1_cff5_b263_aec8e06dd79e["Result"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 7aace723_0ee1_cff5_b263_aec8e06dd79e
  eb9d33f9_42c1_205c_93e6_8e1365a31839["utils.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> eb9d33f9_42c1_205c_93e6_8e1365a31839
  c447b97e_0b8e_b187_e3a8_4be412d6f495["retainWhere"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> c447b97e_0b8e_b187_e3a8_4be412d6f495
  4f3dd743_0a09_5d8d_bf24_d727c39bc26f["ValidateMemoizedEffectDependencies.ts"]
  fe7a7397_dddc_7222_20d4_d5b1015466f1 --> 4f3dd743_0a09_5d8d_bf24_d727c39bc26f
  style fe7a7397_dddc_7222_20d4_d5b1015466f1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import prettyFormat from 'pretty-format';
import {
  CompilerDiagnostic,
  CompilerError,
  CompilerSuggestionOperation,
  Effect,
  SourceLocation,
} from '..';
import {CompilerSuggestion, ErrorCategory} from '../CompilerError';
import {
  areEqualPaths,
  BlockId,
  DependencyPath,
  FinishMemoize,
  GeneratedSource,
  HIRFunction,
  Identifier,
  IdentifierId,
  InstructionKind,
  isEffectEventFunctionType,
  isPrimitiveType,
  isStableType,
  isSubPath,
  isSubPathIgnoringOptionals,
  isUseRefType,
  LoadGlobal,
  ManualMemoDependency,
  Place,
  StartMemoize,
} from '../HIR';
import {
  eachInstructionLValue,
  eachInstructionValueLValue,
  eachInstructionValueOperand,
  eachTerminalOperand,
} from '../HIR/visitors';
import {Result} from '../Utils/Result';
import {retainWhere} from '../Utils/utils';
import {isEffectHook} from './ValidateMemoizedEffectDependencies';

const DEBUG = false;

/**
 * Validates that existing manual memoization is exhaustive and does not
 * have extraneous dependencies. The goal of the validation is to ensure
 * that auto-memoization will not substantially change the behavior of
 * the program:
 * - If the manual dependencies were non-exhaustive (missing important deps)
 *   then auto-memoization will include those dependencies, and cause the
 *   value to update *more* frequently.
 * - If the manual dependencies had extraneous deps, then auto memoization
 *   will remove them and cause the value to update *less* frequently.
 *
// ... (1053 more lines)

Domain

Subdomains

Frequently Asked Questions

What does ValidateExhaustiveDependencies.ts do?
ValidateExhaustiveDependencies.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ValidateExhaustiveDependencies.ts?
ValidateExhaustiveDependencies.ts defines 12 function(s): addDependency, collectDependencies, collectReactiveIdentifiersHIR, createDiagnostic, findOptionalPlaces, isEqualTemporary, isOptionalDependency, printInferredDependency, printManualMemoDependency, validateDependencies, and 2 more.
What does ValidateExhaustiveDependencies.ts depend on?
ValidateExhaustiveDependencies.ts imports 17 module(s): .., CompilerError.ts, CompilerSuggestion, ErrorCategory, Result, Result.ts, ValidateMemoizedEffectDependencies.ts, eachInstructionLValue, and 9 more.
What files import ValidateExhaustiveDependencies.ts?
ValidateExhaustiveDependencies.ts is imported by 1 file(s): Pipeline.ts.
Where is ValidateExhaustiveDependencies.ts in the architecture?
ValidateExhaustiveDependencies.ts is located at compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts (domain: BabelCompiler, subdomain: Validation, directory: compiler/packages/babel-plugin-react-compiler/src/Validation).

Analyze Your Own Codebase

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

Try Supermodel Free