CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-babel-plugin-react-transform

Babel plugin to instrument React components with custom transforms

59%

Overall

Evaluation59%

1.48x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-4/

Export-Safe Component Wrapping

Create a transformation helper that uses a React component wrapping plugin to instrument components without altering module export semantics or double-wrapping nodes. The helper should expose a function that compiles source text and returns both transformed code and the component metadata emitted by the plugin.

Capabilities

Preserve exports while wrapping

  • Transforming a module with a default-exported class component produces output where the wrapped version remains the default export (no missing or renamed default). @test
  • Named exports for class components remain named after wrapping, even when the class is declared inline inside the export list. @test

Deduplicate visits

  • Running the transformer twice against the same input yields identical output with a single wrapper per component, demonstrating visit deduping. @test
  • Components declared inside functions are wrapped once and reported separately in metadata without additional nested wrappers. @test

Implementation

@generates

API

export interface TransformResult {
  code: string;
  metadata: Record<string, { displayName?: string; isInFunction?: boolean }>;
}

export function transformReactSource(source: string, filename?: string): TransformResult;

Dependencies { .dependencies }

babel-plugin-react-transform { .dependency }

Plugin that wraps React components with configured transforms while preserving export behavior and avoiding duplicate visits.

tessl i tessl/npm-babel-plugin-react-transform@3.0.0

tile.json