Home / Function/ parseInput() — react Function Reference

parseInput() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ecf50617_cf5c_10d3_0c2f_53de955b9e2a["parseInput()"]
  9ba26589_c539_da05_fcd2_2ca7851645ba["compilation.ts"]
  ecf50617_cf5c_10d3_0c2f_53de955b9e2a -->|defined in| 9ba26589_c539_da05_fcd2_2ca7851645ba
  1796e62b_c805_a4b0_f7fd_34e2bc4068da["invokeCompiler()"]
  1796e62b_c805_a4b0_f7fd_34e2bc4068da -->|calls| ecf50617_cf5c_10d3_0c2f_53de955b9e2a
  style ecf50617_cf5c_10d3_0c2f_53de955b9e2a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/apps/playground/lib/compilation.ts lines 34–52

function parseInput(
  input: string,
  language: 'flow' | 'typescript',
): ParseResult<t.File> {
  // Extract the first line to quickly check for custom test directives
  if (language === 'flow') {
    return HermesParser.parse(input, {
      babel: true,
      flow: 'all',
      sourceType: 'module',
      enableExperimentalComponentSyntax: true,
    });
  } else {
    return babelParse(input, {
      plugins: ['typescript', 'jsx'],
      sourceType: 'module',
    }) as ParseResult<t.File>;
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parseInput() do?
parseInput() is a function in the react codebase, defined in compiler/apps/playground/lib/compilation.ts.
Where is parseInput() defined?
parseInput() is defined in compiler/apps/playground/lib/compilation.ts at line 34.
What calls parseInput()?
parseInput() is called by 1 function(s): invokeCompiler.

Analyze Your Own Codebase

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

Try Supermodel Free