Babel plugin to instrument React components with custom transforms
Build a small compilation helper that loads a React component file, runs it through a configurable component-transform plugin with multiple transforms, and surfaces the wrapper order and metadata observed by those transforms.
"outer:<id>" or "inner:<id>" into a shared log when wrapping components, executing the compiled component records ["inner:App", "outer:App"], showing that the last-listed transform sits closest to the component. @test"logger:inner" while wrapping the component. @test@generates
export interface TransformConfig {
transform: string;
imports?: any[];
locals?: any[];
}
export interface CompileOutcome {
component: any;
orderLog: string[];
}
export function compileAndExecute(
sourcePath: string,
transforms: TransformConfig[],
runtime?: Record<string, any>
): CompileOutcome;Applies user-defined runtime transforms to detected React components, composing multiple transforms in the order declared.
tessl i tessl/npm-babel-plugin-react-transform@3.0.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9