OutlineFunctions.ts — react Source File
Architecture documentation for OutlineFunctions.ts, a typescript file in the react codebase. 1 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 6b95b3b7_7b72_e9ac_0e48_627f5cf18afd["OutlineFunctions.ts"] 0423f759_97e0_9101_4634_ed555abc5ca9["index.ts"] 6b95b3b7_7b72_e9ac_0e48_627f5cf18afd --> 0423f759_97e0_9101_4634_ed555abc5ca9 e3cfc07a_10c8_5dcd_e270_e8e14c29309b["Pipeline.ts"] e3cfc07a_10c8_5dcd_e270_e8e14c29309b --> 6b95b3b7_7b72_e9ac_0e48_627f5cf18afd style 6b95b3b7_7b72_e9ac_0e48_627f5cf18afd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {HIRFunction, IdentifierId} from '../HIR';
export function outlineFunctions(
fn: HIRFunction,
fbtOperands: Set<IdentifierId>,
): void {
for (const [, block] of fn.body.blocks) {
for (const instr of block.instructions) {
const {value, lvalue} = instr;
if (
value.kind === 'FunctionExpression' ||
value.kind === 'ObjectMethod'
) {
// Recurse in case there are inner functions which can be outlined
outlineFunctions(value.loweredFunc.func, fbtOperands);
}
if (
value.kind === 'FunctionExpression' &&
value.loweredFunc.func.context.length === 0 &&
// TODO: handle outlining named functions
value.loweredFunc.func.id === null &&
!fbtOperands.has(lvalue.identifier.id)
) {
const loweredFunc = value.loweredFunc.func;
const id = fn.env.generateGloballyUniqueIdentifierName(
loweredFunc.id ?? loweredFunc.nameHint,
);
loweredFunc.id = id.value;
fn.env.outlineFunction(loweredFunc, null);
instr.value = {
kind: 'LoadGlobal',
binding: {
kind: 'Global',
name: id.value,
},
loc: value.loc,
};
}
}
}
}
Domain
Subdomains
Functions
Dependencies
Source
Frequently Asked Questions
What does OutlineFunctions.ts do?
OutlineFunctions.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in OutlineFunctions.ts?
OutlineFunctions.ts defines 1 function(s): outlineFunctions.
What does OutlineFunctions.ts depend on?
OutlineFunctions.ts imports 1 module(s): index.ts.
What files import OutlineFunctions.ts?
OutlineFunctions.ts is imported by 1 file(s): Pipeline.ts.
Where is OutlineFunctions.ts in the architecture?
OutlineFunctions.ts is located at compiler/packages/babel-plugin-react-compiler/src/Optimization/OutlineFunctions.ts (domain: BabelCompiler, subdomain: Optimization, directory: compiler/packages/babel-plugin-react-compiler/src/Optimization).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free