codegenDependency() — react Function Reference
Architecture documentation for the codegenDependency() function in CodegenReactiveFunction.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 9380734b_cfd2_bad5_b83a_eeadc55aca3b["codegenDependency()"] dc7f10c2_c914_a162_d02b_a10a15c64a5f["CodegenReactiveFunction.ts"] 9380734b_cfd2_bad5_b83a_eeadc55aca3b -->|defined in| dc7f10c2_c914_a162_d02b_a10a15c64a5f 94638464_4710_0693_528f_4848cf25e876["codegenReactiveScope()"] 94638464_4710_0693_528f_4848cf25e876 -->|calls| 9380734b_cfd2_bad5_b83a_eeadc55aca3b 9bb6f6d9_ff05_0f27_1a27_bc67145db7ba["convertIdentifier()"] 9380734b_cfd2_bad5_b83a_eeadc55aca3b -->|calls| 9bb6f6d9_ff05_0f27_1a27_bc67145db7ba style 9380734b_cfd2_bad5_b83a_eeadc55aca3b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts lines 1469–1495
function codegenDependency(
cx: Context,
dependency: ReactiveScopeDependency,
): t.Expression {
let object: t.Expression = convertIdentifier(dependency.identifier);
if (dependency.path.length !== 0) {
const hasOptional = dependency.path.some(path => path.optional);
for (const path of dependency.path) {
const property =
typeof path.property === 'string'
? t.identifier(path.property)
: t.numericLiteral(path.property);
const isComputed = typeof path.property !== 'string';
if (hasOptional) {
object = t.optionalMemberExpression(
object,
property,
isComputed,
path.optional,
);
} else {
object = t.memberExpression(object, property, isComputed);
}
}
}
return object;
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does codegenDependency() do?
codegenDependency() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts.
Where is codegenDependency() defined?
codegenDependency() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts at line 1469.
What does codegenDependency() call?
codegenDependency() calls 1 function(s): convertIdentifier.
What calls codegenDependency()?
codegenDependency() is called by 1 function(s): codegenReactiveScope.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free