Home / Function/ retryCompileFunction() — react Function Reference

retryCompileFunction() — react Function Reference

Architecture documentation for the retryCompileFunction() function in Program.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b477b62a_df15_0fe0_3f9b_b80ce28b083b["retryCompileFunction()"]
  9aa4477d_960b_1ea1_b6d9_36076aaa70bd["Program.ts"]
  b477b62a_df15_0fe0_3f9b_b80ce28b083b -->|defined in| 9aa4477d_960b_1ea1_b6d9_36076aaa70bd
  db0bec13_2016_3880_d2b9_adcd797cdf2c["processFn()"]
  db0bec13_2016_3880_d2b9_adcd797cdf2c -->|calls| b477b62a_df15_0fe0_3f9b_b80ce28b083b
  a086c126_7bb9_8c77_d2a2_e8336faecc5b["compileFn()"]
  b477b62a_df15_0fe0_3f9b_b80ce28b083b -->|calls| a086c126_7bb9_8c77_d2a2_e8336faecc5b
  073c81a5_c389_d108_5b8f_4d6dc6eece83["push()"]
  b477b62a_df15_0fe0_3f9b_b80ce28b083b -->|calls| 073c81a5_c389_d108_5b8f_4d6dc6eece83
  style b477b62a_df15_0fe0_3f9b_b80ce28b083b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts lines 755–793

function retryCompileFunction(
  fn: BabelFn,
  fnType: ReactFunctionType,
  programContext: ProgramContext,
): CodegenFunction | null {
  const environment = programContext.opts.environment;
  if (
    !(environment.enableFire || environment.inferEffectDependencies != null)
  ) {
    return null;
  }
  /**
   * Note that function suppressions are not checked in the retry pipeline, as
   * they only affect auto-memoization features.
   */
  try {
    const retryResult = compileFn(
      fn,
      environment,
      fnType,
      'client-no-memo',
      programContext,
      programContext.opts.logger,
      programContext.filename,
      programContext.code,
    );

    if (!retryResult.hasFireRewrite && !retryResult.hasInferredEffect) {
      return null;
    }
    return retryResult;
  } catch (err) {
    // TODO: we might want to log error here, but this will also result in duplicate logging
    if (err instanceof CompilerError) {
      programContext.retryErrors.push({fn, error: err});
    }
    return null;
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does retryCompileFunction() do?
retryCompileFunction() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts.
Where is retryCompileFunction() defined?
retryCompileFunction() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts at line 755.
What does retryCompileFunction() call?
retryCompileFunction() calls 2 function(s): compileFn, push.
What calls retryCompileFunction()?
retryCompileFunction() is called by 1 function(s): processFn.

Analyze Your Own Codebase

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

Try Supermodel Free