Babel plugin to instrument React components with custom transforms
A small tool that instruments React component source code and reports the per-component identifiers and metadata generated by the transform step. All metadata should come from the declared instrumentation dependency rather than custom component scanning, making it obvious when anonymous or nested components receive stable ids.
id matches the transform-generated value (starts with _component), displayName is absent, and isInFunction is false. @testisInFunction as true for that component while keeping its generated id consistent (uses the class name if available) even when another top-level component exists. @testdisplayName for named entries and assigns generated ids (e.g., _component, _component2) to anonymous ones while keeping isInFunction false. @test@generates
export interface ComponentMetadata {
id: string;
displayName?: string;
isInFunction: boolean;
}
/**
* Instruments React component source and returns the transform-generated metadata.
* @param source JavaScript/JSX source containing components
* @param filename Optional filename used during instrumentation
*/
export function collectComponentMetadata(source: string, filename?: string): ComponentMetadata[];Instruments React components and assigns per-file identifiers.
Runs the compile step that applies the transform plugin.
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