ObjectShape.ts — react Source File
Architecture documentation for ObjectShape.ts, a typescript file in the react codebase. 28 imports, 11 dependents.
Entity Profile
Dependency Diagram
graph LR 58f81300_7c82_5086_3e10_e46b5f3ab04d["ObjectShape.ts"] e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> e96f281e_f381_272d_2359_3e6a091c9a1d e51fd0d2_bb38_cc97_7763_efe37f300a47["CompilerError"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> e51fd0d2_bb38_cc97_7763_efe37f300a47 2f00e901_2271_5b46_4d72_3fa77ff15e31["AliasingEffects.ts"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 2f00e901_2271_5b46_4d72_3fa77ff15e31 9f54f993_76c3_b507_621f_ba4f24e13eda["AliasingEffect"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 9f54f993_76c3_b507_621f_ba4f24e13eda 0609fbd1_bfa6_b02c_367b_23bb24b4c4ce["AliasingSignature"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 0609fbd1_bfa6_b02c_367b_23bb24b4c4ce eb9d33f9_42c1_205c_93e6_8e1365a31839["utils.ts"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> eb9d33f9_42c1_205c_93e6_8e1365a31839 d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> d7fde76c_4fd9_feb3_299b_798689f05bc6 18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 18a78965_f593_105b_e5e8_07001321c2ec 60d25db4_8803_db04_13e8_2251272ec589["Effect"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 60d25db4_8803_db04_13e8_2251272ec589 df3c4ef0_382c_e96e_63aa_b244e0f8fa1a["Hole"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> df3c4ef0_382c_e96e_63aa_b244e0f8fa1a 9994dc80_69bc_44aa_ef8c_97977d75801a["makeDeclarationId"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 9994dc80_69bc_44aa_ef8c_97977d75801a 7acba8cd_83f0_fe9c_342c_9cd4f8c74673["makeIdentifierId"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> 7acba8cd_83f0_fe9c_342c_9cd4f8c74673 d0270ab6_a621_bd55_a1b9_a5cad8b406b2["makeInstructionId"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> d0270ab6_a621_bd55_a1b9_a5cad8b406b2 c7aaa235_c19e_3530_31c2_911f38eed3e0["Place"] 58f81300_7c82_5086_3e10_e46b5f3ab04d --> c7aaa235_c19e_3530_31c2_911f38eed3e0 style 58f81300_7c82_5086_3e10_e46b5f3ab04d 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 {CompilerError} from '../CompilerError';
import {AliasingEffect, AliasingSignature} from '../Inference/AliasingEffects';
import {assertExhaustive} from '../Utils/utils';
import {
Effect,
GeneratedSource,
Hole,
makeDeclarationId,
makeIdentifierId,
makeInstructionId,
Place,
SourceLocation,
SpreadPattern,
ValueKind,
ValueReason,
} from './HIR';
import {
BuiltInType,
FunctionType,
makeType,
ObjectType,
PolyType,
PrimitiveType,
} from './Types';
import {AliasingEffectConfig, AliasingSignatureConfig} from './TypeSchema';
/*
* This file exports types and defaults for JavaScript object shapes. These are
* stored and used by a Forget `Environment`. See comments in `Types.ts`,
* `Globals.ts`, and `Environment.ts` for more details.
*/
const PRIMITIVE_TYPE: PrimitiveType = {
kind: 'Primitive',
};
let nextAnonId = 0;
/*
* We currently use strings for anonymous ShapeIds since they are easily
* debuggable, even though `Symbol()` might be more performant
*/
function createAnonId(): string {
return `<generated_${nextAnonId++}>`;
}
/*
* Add a non-hook function to an existing ShapeRegistry.
*
* @returns a {@link FunctionType} representing the added function.
*/
export function addFunction(
registry: ShapeRegistry,
properties: Iterable<[string, BuiltInType | PolyType]>,
// ... (1473 more lines)
Domain
Subdomains
Functions
Dependencies
- AliasingEffect
- AliasingEffectConfig
- AliasingEffects.ts
- AliasingSignature
- AliasingSignatureConfig
- BuiltInType
- CompilerError
- CompilerError.ts
- Effect
- FunctionType
- HIR.ts
- Hole
- ObjectType
- Place
- PolyType
- PrimitiveType
- SourceLocation
- SpreadPattern
- TypeSchema.ts
- Types.ts
- ValueKind
- ValueReason
- assertExhaustive
- makeDeclarationId
- makeIdentifierId
- makeInstructionId
- makeType
- utils.ts
Imported By
- compiler/packages/babel-plugin-react-compiler/src/Inference/AliasingEffects.ts
- compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts
- compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts
- compiler/packages/babel-plugin-react-compiler/src/HIR/Globals.ts
- compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts
- compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts
- compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/MergeReactiveScopesThatInvalidateTogether.ts
- compiler/packages/babel-plugin-react-compiler/src/Transform/TransformFire.ts
- compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoRefAccessInRender.ts
Source
Frequently Asked Questions
What does ObjectShape.ts do?
ObjectShape.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 ObjectShape.ts?
ObjectShape.ts defines 7 function(s): addFunction, addHook, addObject, addShape, createAnonId, parseAliasingSignatureConfig, signatureArgument.
What does ObjectShape.ts depend on?
ObjectShape.ts imports 28 module(s): AliasingEffect, AliasingEffectConfig, AliasingEffects.ts, AliasingSignature, AliasingSignatureConfig, BuiltInType, CompilerError, CompilerError.ts, and 20 more.
What files import ObjectShape.ts?
ObjectShape.ts is imported by 11 file(s): AliasingEffects.ts, BuildHIR.ts, Environment.ts, Globals.ts, HIR.ts, InferEffectDependencies.ts, InferMutationAliasingEffects.ts, InferTypes.ts, and 3 more.
Where is ObjectShape.ts in the architecture?
ObjectShape.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/ObjectShape.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