Home / File/ Options.ts — react Source File

Options.ts — react Source File

Architecture documentation for Options.ts, a typescript file in the react codebase. 17 imports, 3 dependents.

File typescript BabelCompiler Entrypoint 17 imports 3 dependents 6 functions

Entity Profile

Dependency Diagram

graph LR
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c["Options.ts"]
  e96f281e_f381_272d_2359_3e6a091c9a1d["CompilerError.ts"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> e96f281e_f381_272d_2359_3e6a091c9a1d
  0fda7f86_b7a3_c1f2_f0d9_8d13eed4f042["CompilerDiagnostic"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 0fda7f86_b7a3_c1f2_f0d9_8d13eed4f042
  e51fd0d2_bb38_cc97_7763_efe37f300a47["CompilerError"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> e51fd0d2_bb38_cc97_7763_efe37f300a47
  7cb692eb_ba8e_04dc_5f67_df48b332c3c1["CompilerErrorDetail"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 7cb692eb_ba8e_04dc_5f67_df48b332c3c1
  7d5f57e2_20da_a2a3_7a51_cdf6e9d1ad9b["CompilerErrorDetailOptions"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 7d5f57e2_20da_a2a3_7a51_cdf6e9d1ad9b
  1b971013_8a90_0d8d_1fcc_f31581cd66aa["Environment.ts"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 1b971013_8a90_0d8d_1fcc_f31581cd66aa
  674e370e_9010_8396_1a12_b7aee0e7a30f["EnvironmentConfig"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 674e370e_9010_8396_1a12_b7aee0e7a30f
  9017c821_3b98_1fe2_6116_790d721b5b40["ExternalFunction"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 9017c821_3b98_1fe2_6116_790d721b5b40
  b0ce8325_6d38_9f7e_a2d3_ca5cccc78d99["parseEnvironmentConfig"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> b0ce8325_6d38_9f7e_a2d3_ca5cccc78d99
  3d8c9cf4_b77b_a09b_46bb_a39cfadd4173["tryParseExternalFunction"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 3d8c9cf4_b77b_a09b_46bb_a39cfadd4173
  eb9d33f9_42c1_205c_93e6_8e1365a31839["utils.ts"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> eb9d33f9_42c1_205c_93e6_8e1365a31839
  27d56ae1_023e_57f5_a306_f4be92e0daca["hasOwnProperty"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> 27d56ae1_023e_57f5_a306_f4be92e0daca
  e3cfc07a_10c8_5dcd_e270_e8e14c29309b["Pipeline.ts"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> e3cfc07a_10c8_5dcd_e270_e8e14c29309b
  c5f71a8a_0206_6146_018b_f3ffa6b9d91d["CompilerPipelineValue"]
  4828f3cc_e6ac_9239_d7f7_c05f7f60419c --> c5f71a8a_0206_6146_018b_f3ffa6b9d91d
  style 4828f3cc_e6ac_9239_d7f7_c05f7f60419c 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 {z} from 'zod/v4';
import {
  CompilerDiagnostic,
  CompilerError,
  CompilerErrorDetail,
  CompilerErrorDetailOptions,
} from '../CompilerError';
import {
  EnvironmentConfig,
  ExternalFunction,
  parseEnvironmentConfig,
  tryParseExternalFunction,
} from '../HIR/Environment';
import {hasOwnProperty} from '../Utils/utils';
import {fromZodError} from 'zod-validation-error/v4';
import {CompilerPipelineValue} from './Pipeline';

const PanicThresholdOptionsSchema = z.enum([
  /*
   * Any errors will panic the compiler by throwing an exception, which will
   * bubble up to the nearest exception handler above the Forget transform.
   * If Forget is invoked through `BabelPluginReactCompiler`, this will at the least
   * skip Forget compilation for the rest of current file.
   */
  'all_errors',
  /*
   * Panic by throwing an exception only on critical or unrecognized errors.
   * For all other errors, skip the erroring function without inserting
   * a Forget-compiled version (i.e. same behavior as noEmit).
   */
  'critical_errors',
  // Never panic by throwing an exception.
  'none',
]);

export type PanicThresholdOptions = z.infer<typeof PanicThresholdOptionsSchema>;
const DynamicGatingOptionsSchema = z.object({
  source: z.string(),
});
export type DynamicGatingOptions = z.infer<typeof DynamicGatingOptionsSchema>;
const CustomOptOutDirectiveSchema = z
  .nullable(z.array(z.string()))
  .default(null);
type CustomOptOutDirective = z.infer<typeof CustomOptOutDirectiveSchema>;

export type PluginOptions = Partial<{
  environment: Partial<EnvironmentConfig>;

  logger: Logger | null;

  /*
   * Specifying a `gating` config, makes Forget compile and emit a separate
// ... (371 more lines)

Domain

Subdomains

Frequently Asked Questions

What does Options.ts do?
Options.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Entrypoint subdomain.
What functions are defined in Options.ts?
Options.ts defines 6 function(s): defaultOptions.sources, filename, isCompilerFlag, parsePluginOptions, parseTargetConfig, value.
What does Options.ts depend on?
Options.ts imports 17 module(s): CompilerDiagnostic, CompilerError, CompilerError.ts, CompilerErrorDetail, CompilerErrorDetailOptions, CompilerPipelineValue, Environment.ts, EnvironmentConfig, and 9 more.
What files import Options.ts?
Options.ts is imported by 3 file(s): Imports.ts, Program.ts, Reanimated.ts.
Where is Options.ts in the architecture?
Options.ts is located at compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts (domain: BabelCompiler, subdomain: Entrypoint, directory: compiler/packages/babel-plugin-react-compiler/src/Entrypoint).

Analyze Your Own Codebase

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

Try Supermodel Free