Home / File/ TypeSchema.ts — react Source File

TypeSchema.ts — react Source File

Architecture documentation for TypeSchema.ts, a typescript file in the react codebase. 5 imports, 4 dependents.

File typescript MIRInfrastructure HIR 5 imports 4 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  5e35ae0f_bcda_75e5_55c4_a894ff043a95["TypeSchema.ts"]
  18a78965_f593_105b_e5e8_07001321c2ec["HIR.ts"]
  5e35ae0f_bcda_75e5_55c4_a894ff043a95 --> 18a78965_f593_105b_e5e8_07001321c2ec
  358e8ce3_19a4_3e01_1d6a_85100cffaccd["ValueReason"]
  5e35ae0f_bcda_75e5_55c4_a894ff043a95 --> 358e8ce3_19a4_3e01_1d6a_85100cffaccd
  52e3d8d7_abf4_7343_1f98_3f701ec04082["types"]
  5e35ae0f_bcda_75e5_55c4_a894ff043a95 --> 52e3d8d7_abf4_7343_1f98_3f701ec04082
  3d45252d_d5b7_7967_8ef9_8c2bccea9e5a["v4"]
  5e35ae0f_bcda_75e5_55c4_a894ff043a95 --> 3d45252d_d5b7_7967_8ef9_8c2bccea9e5a
  2ed45bcd_6c82_3ccd_0e20_fa96b5111055[".."]
  5e35ae0f_bcda_75e5_55c4_a894ff043a95 --> 2ed45bcd_6c82_3ccd_0e20_fa96b5111055
  0c7e53f1_4ebc_f3be_54f8_05e81729a4e9["DefaultModuleTypeProvider.ts"]
  0c7e53f1_4ebc_f3be_54f8_05e81729a4e9 --> 5e35ae0f_bcda_75e5_55c4_a894ff043a95
  1b971013_8a90_0d8d_1fcc_f31581cd66aa["Environment.ts"]
  1b971013_8a90_0d8d_1fcc_f31581cd66aa --> 5e35ae0f_bcda_75e5_55c4_a894ff043a95
  38c44267_cdd2_9815_ebad_fa6761ba5934["Globals.ts"]
  38c44267_cdd2_9815_ebad_fa6761ba5934 --> 5e35ae0f_bcda_75e5_55c4_a894ff043a95
  58f81300_7c82_5086_3e10_e46b5f3ab04d["ObjectShape.ts"]
  58f81300_7c82_5086_3e10_e46b5f3ab04d --> 5e35ae0f_bcda_75e5_55c4_a894ff043a95
  style 5e35ae0f_bcda_75e5_55c4_a894ff043a95 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 {isValidIdentifier} from '@babel/types';
import {z} from 'zod/v4';
import {Effect, ValueKind} from '..';
import {
  EffectSchema,
  ValueKindSchema,
  ValueReason,
  ValueReasonSchema,
} from './HIR';

export type ObjectPropertiesConfig = {[key: string]: TypeConfig};
export const ObjectPropertiesSchema: z.ZodType<ObjectPropertiesConfig> = z
  .record(
    z.string(),
    z.lazy(() => TypeSchema),
  )
  .refine(record => {
    return Object.keys(record).every(
      key => key === '*' || key === 'default' || isValidIdentifier(key),
    );
  }, 'Expected all "object" property names to be valid identifier, `*` to match any property, of `default` to define a module default export');

export type ObjectTypeConfig = {
  kind: 'object';
  properties: ObjectPropertiesConfig | null;
};
export const ObjectTypeSchema: z.ZodType<ObjectTypeConfig> = z.object({
  kind: z.literal('object'),
  properties: ObjectPropertiesSchema.nullable(),
});

export const LifetimeIdSchema = z.string().refine(id => id.startsWith('@'), {
  message: "Placeholder names must start with '@'",
});

export type FreezeEffectConfig = {
  kind: 'Freeze';
  value: string;
  reason: ValueReason;
};

export const FreezeEffectSchema: z.ZodType<FreezeEffectConfig> = z.object({
  kind: z.literal('Freeze'),
  value: LifetimeIdSchema,
  reason: ValueReasonSchema,
});

export type MutateEffectConfig = {
  kind: 'Mutate';
  value: string;
};

export const MutateEffectSchema: z.ZodType<MutateEffectConfig> = z.object({
// ... (266 more lines)

Subdomains

Dependencies

Frequently Asked Questions

What does TypeSchema.ts do?
TypeSchema.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 TypeSchema.ts?
TypeSchema.ts defines 2 function(s): LifetimeIdSchema, ObjectPropertiesSchema.
What does TypeSchema.ts depend on?
TypeSchema.ts imports 5 module(s): .., HIR.ts, ValueReason, types, v4.
What files import TypeSchema.ts?
TypeSchema.ts is imported by 4 file(s): DefaultModuleTypeProvider.ts, Environment.ts, Globals.ts, ObjectShape.ts.
Where is TypeSchema.ts in the architecture?
TypeSchema.ts is located at compiler/packages/babel-plugin-react-compiler/src/HIR/TypeSchema.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