Home / File/ Environment.ts — react Source File

Environment.ts — react Source File

Architecture documentation for Environment.ts, a typescript file in the react codebase. 42 imports, 18 dependents.

File typescript MIRInfrastructure HIR 42 imports 18 dependents 6 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  1b971013_8a90_0d8d_1fcc_f31581cd66aa["Environment.ts"]
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> e96f281e_f381_272d_2359_3e6a091c9a1d
  e51fd0d2_bb38_cc97_7763_efe37f300a47["CompilerError"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> e51fd0d2_bb38_cc97_7763_efe37f300a47
  6ec70299_8c45_d057_8deb_dd41bb1f7153["index.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 6ec70299_8c45_d057_8deb_dd41bb1f7153
  494e3425_0b47_293a_1ea4_d4670b0fc0e7["Result.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 494e3425_0b47_293a_1ea4_d4670b0fc0e7
  9217845a_d29d_c624_b607_e3b35cf604bc["Err"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 9217845a_d29d_c624_b607_e3b35cf604bc
  9f0e6a52_ff9e_00f3_1760_5fddfd89b234["Ok"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 9f0e6a52_ff9e_00f3_1760_5fddfd89b234
  7aace723_0ee1_cff5_b263_aec8e06dd79e["Result"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 7aace723_0ee1_cff5_b263_aec8e06dd79e
  38c44267_cdd2_9815_ebad_fa6761ba5934["Globals.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 38c44267_cdd2_9815_ebad_fa6761ba5934
  fb0322dd_a208_1e43_104c_5c4d4416d8a1["Global"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> fb0322dd_a208_1e43_104c_5c4d4416d8a1
  89a78f81_4ad2_9063_c439_cef03d13987d["GlobalRegistry"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 89a78f81_4ad2_9063_c439_cef03d13987d
  4ba5c3ad_186f_8c38_7db0_a6d2e5ee2b25["getReanimatedModuleType"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 4ba5c3ad_186f_8c38_7db0_a6d2e5ee2b25
  b5df453b_1fe3_4bcb_9def_abba2aa3a9a4["installTypeConfig"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> b5df453b_1fe3_4bcb_9def_abba2aa3a9a4
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 18a78965_f593_105b_e5e8_07001321c2ec
  4a73a9b9_07eb_502f_14c1_2f045ba2666c["BlockId"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 4a73a9b9_07eb_502f_14c1_2f045ba2666c
  style 1b971013_8a90_0d8d_1fcc_f31581cd66aa 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 * as t from '@babel/types';
import {ZodError, z} from 'zod/v4';
import {fromZodError} from 'zod-validation-error/v4';
import {CompilerError} from '../CompilerError';
import {CompilerOutputMode, Logger, ProgramContext} from '../Entrypoint';
import {Err, Ok, Result} from '../Utils/Result';
import {
  DEFAULT_GLOBALS,
  DEFAULT_SHAPES,
  Global,
  GlobalRegistry,
  getReanimatedModuleType,
  installTypeConfig,
} from './Globals';
import {
  BlockId,
  BuiltInType,
  Effect,
  FunctionType,
  GeneratedSource,
  HIRFunction,
  IdentifierId,
  NonLocalBinding,
  PolyType,
  ScopeId,
  SourceLocation,
  Type,
  ValidatedIdentifier,
  ValueKind,
  getHookKindForType,
  makeBlockId,
  makeIdentifierId,
  makeIdentifierName,
  makeScopeId,
} from './HIR';
import {
  BuiltInMixedReadonlyId,
  DefaultMutatingHook,
  DefaultNonmutatingHook,
  FunctionSignature,
  ShapeRegistry,
  addHook,
} from './ObjectShape';
import {Scope as BabelScope, NodePath} from '@babel/traverse';
import {TypeSchema} from './TypeSchema';
import {FlowTypeEnv} from '../Flood/Types';
import {defaultModuleTypeProvider} from './DefaultModuleTypeProvider';
import {assertExhaustive} from '../Utils/utils';

export const ReactElementSymbolSchema = z.object({
  elementSymbol: z.union([
    z.literal('react.element'),
    z.literal('react.transitional.element'),
// ... (1237 more lines)

Subdomains

Classes

Frequently Asked Questions

What does Environment.ts do?
Environment.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 Environment.ts?
Environment.ts defines 6 function(s): InstrumentationSchema, isHookName, parseEnvironmentConfig, printFunctionType, tryParseExternalFunction, validateEnvironmentConfig.
What does Environment.ts depend on?
Environment.ts imports 42 module(s): BlockId, CompilerError, CompilerError.ts, DefaultModuleTypeProvider.ts, Effect, Err, FlowTypeEnv, FunctionSignature, and 34 more.
What files import Environment.ts?
Environment.ts is imported by 18 file(s): BuildHIR.ts, BuildReactiveScopeTerminalsHIR.ts, CodegenReactiveFunction.ts, EnterSSA.ts, Globals.ts, HIR.ts, HIRBuilder.ts, Imports.ts, and 10 more.
Where is Environment.ts in the architecture?
Environment.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.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