getReactCompilerRuntimeModule() — react Function Reference
Architecture documentation for the getReactCompilerRuntimeModule() function in Program.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 78d6080e_8c56_4f2c_6894_efdb15a87a5c["getReactCompilerRuntimeModule()"] 9aa4477d_960b_1ea1_b6d9_36076aaa70bd["Program.ts"] 78d6080e_8c56_4f2c_6894_efdb15a87a5c -->|defined in| 9aa4477d_960b_1ea1_b6d9_36076aaa70bd daf7f40d_4b1a_938b_ef51_4bee7b9c635c["constructor()"] daf7f40d_4b1a_938b_ef51_4bee7b9c635c -->|calls| 78d6080e_8c56_4f2c_6894_efdb15a87a5c 9e49688f_6b43_84fe_0dd2_18e5142c1f71["shouldSkipCompilation()"] 9e49688f_6b43_84fe_0dd2_18e5142c1f71 -->|calls| 78d6080e_8c56_4f2c_6894_efdb15a87a5c 041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"] 78d6080e_8c56_4f2c_6894_efdb15a87a5c -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e style 78d6080e_8c56_4f2c_6894_efdb15a87a5c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts lines 1427–1446
export function getReactCompilerRuntimeModule(
target: CompilerReactTarget,
): string {
if (target === '19') {
return 'react/compiler-runtime'; // from react namespace
} else if (target === '17' || target === '18') {
return 'react-compiler-runtime'; // npm package
} else {
CompilerError.invariant(
target != null &&
target.kind === 'donotuse_meta_internal' &&
typeof target.runtimeModule === 'string',
{
reason: 'Expected target to already be validated',
loc: GeneratedSource,
},
);
return target.runtimeModule;
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does getReactCompilerRuntimeModule() do?
getReactCompilerRuntimeModule() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts.
Where is getReactCompilerRuntimeModule() defined?
getReactCompilerRuntimeModule() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts at line 1427.
What does getReactCompilerRuntimeModule() call?
getReactCompilerRuntimeModule() calls 1 function(s): invariant.
What calls getReactCompilerRuntimeModule()?
getReactCompilerRuntimeModule() is called by 2 function(s): constructor, shouldSkipCompilation.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free