Home / Function/ parseInput() — react Function Reference

parseInput() — react Function Reference

Architecture documentation for the parseInput() function in compiler.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a87dd476_f026_8f78_2fa7_26db794e5375["parseInput()"]
  f294d5ab_dd3b_6bca_e120_e970909a7dc8["compiler.ts"]
  a87dd476_f026_8f78_2fa7_26db794e5375 -->|defined in| f294d5ab_dd3b_6bca_e120_e970909a7dc8
  34f68e46_4ab8_f2b5_b44f_59f14d4d25b8["transformFixtureInput()"]
  34f68e46_4ab8_f2b5_b44f_59f14d4d25b8 -->|calls| a87dd476_f026_8f78_2fa7_26db794e5375
  c38ea253_eaec_a82d_bbe8_28e45a28dbf6["runCompileCommand()"]
  c38ea253_eaec_a82d_bbe8_28e45a28dbf6 -->|calls| a87dd476_f026_8f78_2fa7_26db794e5375
  style a87dd476_f026_8f78_2fa7_26db794e5375 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/compiler.ts lines 105–127

export function parseInput(
  input: string,
  filename: string,
  language: 'flow' | 'typescript',
  sourceType: 'module' | 'script',
): BabelCore.types.File {
  // Extract the first line to quickly check for custom test directives
  if (language === 'flow') {
    return HermesParser.parse(input, {
      babel: true,
      flow: 'all',
      sourceFilename: filename,
      sourceType,
      enableExperimentalComponentSyntax: true,
    });
  } else {
    return BabelParser.parse(input, {
      sourceFilename: filename,
      plugins: ['typescript', 'jsx'],
      sourceType,
    });
  }
}

Domain

Subdomains

Frequently Asked Questions

What does parseInput() do?
parseInput() is a function in the react codebase, defined in compiler/packages/snap/src/compiler.ts.
Where is parseInput() defined?
parseInput() is defined in compiler/packages/snap/src/compiler.ts at line 105.
What calls parseInput()?
parseInput() is called by 2 function(s): runCompileCommand, transformFixtureInput.

Analyze Your Own Codebase

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

Try Supermodel Free