Home / File/ Globals.ts — react Source File

Globals.ts — react Source File

Architecture documentation for Globals.ts, a typescript file in the react codebase. 20 imports, 2 dependents.

File typescript MIRInfrastructure HIR 20 imports 2 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  38c44267_cdd2_9815_ebad_fa6761ba5934["Globals.ts"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 18a78965_f593_105b_e5e8_07001321c2ec
  60d25db4_8803_db04_13e8_2251272ec589["Effect"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 60d25db4_8803_db04_13e8_2251272ec589
  a8d38e41_1012_9d92_b0d6_e81250fede26["ValueKind"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> a8d38e41_1012_9d92_b0d6_e81250fede26
  358e8ce3_19a4_3e01_1d6a_85100cffaccd["ValueReason"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 358e8ce3_19a4_3e01_1d6a_85100cffaccd
  58f81300_7c82_5086_3e10_e46b5f3ab04d["ObjectShape.ts"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 58f81300_7c82_5086_3e10_e46b5f3ab04d
  62e2072d_6759_d697_e834_7f4a3ed2390e["ShapeRegistry"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 62e2072d_6759_d697_e834_7f4a3ed2390e
  a77ff0f7_0c98_02df_9507_6da9eca5fbb5["addFunction"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> a77ff0f7_0c98_02df_9507_6da9eca5fbb5
  d0882928_65af_dce8_5416_84ed7f492587["addHook"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> d0882928_65af_dce8_5416_84ed7f492587
  fdd1014d_2fa9_cdec_af9b_b2e2bada1088["addObject"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> fdd1014d_2fa9_cdec_af9b_b2e2bada1088
  f1874e3c_f8f2_5f68_d3a9_0c56c0dad5ec["Types.ts"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> f1874e3c_f8f2_5f68_d3a9_0c56c0dad5ec
  8a450d1f_206e_c073_f66b_2aeca9857367["BuiltInType"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 8a450d1f_206e_c073_f66b_2aeca9857367
  f46839ce_21c9_196d_4c3d_dd55293d3ecd["ObjectType"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> f46839ce_21c9_196d_4c3d_dd55293d3ecd
  ea778153_9605_e477_e56e_1bd530313341["PolyType"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> ea778153_9605_e477_e56e_1bd530313341
  5e35ae0f_bcda_75e5_55c4_a894ff043a95["TypeSchema.ts"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 5e35ae0f_bcda_75e5_55c4_a894ff043a95
  style 38c44267_cdd2_9815_ebad_fa6761ba5934 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 {Effect, ValueKind, ValueReason} from './HIR';
import {
  BUILTIN_SHAPES,
  BuiltInArrayId,
  BuiltInAutodepsId,
  BuiltInFireFunctionId,
  BuiltInFireId,
  BuiltInMapId,
  BuiltInMixedReadonlyId,
  BuiltInObjectId,
  BuiltInSetId,
  BuiltInUseActionStateId,
  BuiltInUseContextHookId,
  BuiltInUseEffectEventId,
  BuiltInUseEffectHookId,
  BuiltInUseInsertionEffectHookId,
  BuiltInUseLayoutEffectHookId,
  BuiltInUseOperatorId,
  BuiltInUseOptimisticId,
  BuiltInUseReducerId,
  BuiltInUseRefId,
  BuiltInUseStateId,
  BuiltInUseTransitionId,
  BuiltInWeakMapId,
  BuiltInWeakSetId,
  BuiltInEffectEventId,
  ReanimatedSharedValueId,
  ShapeRegistry,
  addFunction,
  addHook,
  addObject,
} from './ObjectShape';
import {BuiltInType, ObjectType, PolyType} from './Types';
import {TypeConfig} from './TypeSchema';
import {assertExhaustive} from '../Utils/utils';
import {isHookName} from './Environment';
import {CompilerError, SourceLocation} from '..';

/*
 * This file exports types and defaults for JavaScript global objects.
 * A Forget `Environment` stores the GlobalRegistry and ShapeRegistry
 * used for the current project. These ultimately help Forget refine
 * its inference of types (i.e. Object vs Primitive) and effects
 * (i.e. read vs mutate) in source programs.
 */

// ShapeRegistry with default definitions for builtins and global objects.
export const DEFAULT_SHAPES: ShapeRegistry = new Map(BUILTIN_SHAPES);

// Hack until we add ObjectShapes for all globals
const UNTYPED_GLOBALS: Set<string> = new Set([
  'Object',
  'Function',
// ... (1091 more lines)

Subdomains

Frequently Asked Questions

What does Globals.ts do?
Globals.ts is a source file in the react codebase, written in typescript. It belongs to the MIRInfrastructure domain, HIR subdomain.
What functions are defined in Globals.ts?
Globals.ts defines 2 function(s): getReanimatedModuleType, installTypeConfig.
What does Globals.ts depend on?
Globals.ts imports 20 module(s): .., BuiltInType, Effect, Environment.ts, HIR.ts, ObjectShape.ts, ObjectType, PolyType, and 12 more.
What files import Globals.ts?
Globals.ts is imported by 2 file(s): Environment.ts, ValidateNoCapitalizedCalls.ts.
Where is Globals.ts in the architecture?
Globals.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/Globals.ts (domain: MIRInfrastructure, subdomain: HIR, directory: compiler/packages/babel-plugin-react-compiler/src/HIR).

Analyze Your Own Codebase

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

Try Supermodel Free