Home / File/ shared-runtime-type-provider.ts — react Source File

shared-runtime-type-provider.ts — react Source File

Architecture documentation for shared-runtime-type-provider.ts, a typescript file in the react codebase. 2 imports, 1 dependents.

File typescript BabelCompiler Optimization 2 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  7abd0006_a288_8ea5_5a9e_399bf42f51d6["shared-runtime-type-provider.ts"]
  6532b592_e173_3956_4bd1_d55d91adeefe["src"]
  7abd0006_a288_8ea5_5a9e_399bf42f51d6 --> 6532b592_e173_3956_4bd1_d55d91adeefe
  9ecaf4f3_cb2b_29fc_b168_5371e9d44935["TypeSchema"]
  7abd0006_a288_8ea5_5a9e_399bf42f51d6 --> 9ecaf4f3_cb2b_29fc_b168_5371e9d44935
  f294d5ab_dd3b_6bca_e120_e970909a7dc8["compiler.ts"]
  f294d5ab_dd3b_6bca_e120_e970909a7dc8 --> 7abd0006_a288_8ea5_5a9e_399bf42f51d6
  style 7abd0006_a288_8ea5_5a9e_399bf42f51d6 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 type {
  Effect,
  ValueKind,
  ValueReason,
} from 'babel-plugin-react-compiler/src';
import type {TypeConfig} from 'babel-plugin-react-compiler/src/HIR/TypeSchema';

export function makeSharedRuntimeTypeProvider({
  EffectEnum,
  ValueKindEnum,
  ValueReasonEnum,
}: {
  EffectEnum: typeof Effect;
  ValueKindEnum: typeof ValueKind;
  ValueReasonEnum: typeof ValueReason;
}) {
  return function sharedRuntimeTypeProvider(
    moduleName: string,
  ): TypeConfig | null {
    if (moduleName === 'shared-runtime') {
      return {
        kind: 'object',
        properties: {
          default: {
            kind: 'function',
            calleeEffect: EffectEnum.Read,
            positionalParams: [],
            restParam: EffectEnum.Read,
            returnType: {kind: 'type', name: 'Primitive'},
            returnValueKind: ValueKindEnum.Primitive,
          },
          graphql: {
            kind: 'function',
            calleeEffect: EffectEnum.Read,
            positionalParams: [],
            restParam: EffectEnum.Read,
            returnType: {kind: 'type', name: 'Primitive'},
            returnValueKind: ValueKindEnum.Primitive,
          },
          typedArrayPush: {
            kind: 'function',
            calleeEffect: EffectEnum.Read,
            positionalParams: [EffectEnum.Store, EffectEnum.Capture],
            restParam: EffectEnum.Capture,
            returnType: {kind: 'type', name: 'Primitive'},
            returnValueKind: ValueKindEnum.Primitive,
          },
          typedLog: {
            kind: 'function',
            calleeEffect: EffectEnum.Read,
            positionalParams: [],
            restParam: EffectEnum.Read,
            returnType: {kind: 'type', name: 'Primitive'},
// ... (222 more lines)

Domain

Subdomains

Dependencies

  • TypeSchema
  • src

Frequently Asked Questions

What does shared-runtime-type-provider.ts do?
shared-runtime-type-provider.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in shared-runtime-type-provider.ts?
shared-runtime-type-provider.ts defines 1 function(s): makeSharedRuntimeTypeProvider.
What does shared-runtime-type-provider.ts depend on?
shared-runtime-type-provider.ts imports 2 module(s): TypeSchema, src.
What files import shared-runtime-type-provider.ts?
shared-runtime-type-provider.ts is imported by 1 file(s): compiler.ts.
Where is shared-runtime-type-provider.ts in the architecture?
shared-runtime-type-provider.ts is located at compiler/packages/snap/src/sprout/shared-runtime-type-provider.ts (domain: BabelCompiler, subdomain: Optimization, directory: compiler/packages/snap/src/sprout).

Analyze Your Own Codebase

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

Try Supermodel Free