Registry / devops / react-compiler-marker

react-compiler-marker

JSON →
library0.1.0jsnpmunverified

CLI tool (v0.1.0) to scan React projects and report which components are optimized by the React Compiler and which have issues. Supports multiple output formats — plain text, self-contained HTML report with filtering and tree view, and JSON for CI pipelines. Requires babel-plugin-react-compiler to be installed. Differentiates from other tools by focusing specifically on React Compiler integration with explicit failure reporting and exit code 1 on failures, making it suitable for CI enforcement. Released under MIT.

npm install react-compiler-marker
INSTALL
IMPORT
SIG · REACT-COMPILER-MAR
R
react-compiler-marker
devopsjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
✓ import reactCompilerMarker from 'react-compiler-marker'
✗ const reactCompilerMarker = require('react-compiler-marker')
Package is ESM-only. CommonJS require will fail unless using a dynamic import.
run
✓ import { run } from 'react-compiler-marker'
✗ const { run } = require('react-compiler-marker')
run is a named export. CommonJS require will fail with ESM.
ReportFormat type
✓ import type { ReportFormat } from 'react-compiler-marker'
TypeScript type import; use import type for type-only imports.

Shows how to programmatically run react-compiler-marker as a Node.js API, with options for directory, format, exclusions, and babel plugin path.

import { run } from 'react-compiler-marker'; const result = await run({ directory: '.', format: 'json', excludeDirs: ['node_modules', 'dist'], includeExtensions: ['.tsx', '.ts'], babelPluginPath: process.env.BABEL_PLUGIN_PATH ?? undefined }); console.log(JSON.stringify(result, null, 2));
react-compiler-marker --version
Debug
Known issues
breakingv0.1.0 is initial release; API may change in future minor versions.
fix
Pin to exact version in package.json if stability is required.
affects: >=0.1.0
gotchaRequires babel-plugin-react-compiler to be installed as a dependency in the target project. Auto-detection may fail if plugin path is symlinked or not in default node_modules.
fix
Ensure babel-plugin-react-compiler is installed. Use --babel-plugin-path option to specify exact path if auto-detection fails.
affects: >=0.1.0
gotchaThe CLI exits with code 1 when compilation failures are found. In CI pipelines, ensure this exit code is handled correctly to avoid false positives if failures are expected.
fix
Use || true or conditional logic to handle exit code 1 appropriately.
affects: >=0.1.0
deprecatedNo deprecated features yet; package is at v0.1.0 initial release.
Errors
Common errors & fixes
Error: Cannot find module 'babel-plugin-react-compiler'
The required peer dependency is not installed in the target project or cannot be resolved.
fix
Install the plugin: npm install babel-plugin-react-compiler --save-dev or provide the path via --babel-plugin-path.
Error: No files found matching extensions .js,.jsx,.ts,.tsx,.mjs,.cjs in directory '.'
The directory does not contain any files with the default extensions, or the directory path is incorrect.
fix
Verify the directory path and adjust --include-extensions to match your project's file extensions.
SyntaxError: Cannot use import statement outside a module
Attempting to import the package using CommonJS require() which is not supported (ESM-only).
fix
Use dynamic import: const reactCompilerMarker = await import('react-compiler-marker'); or ensure your project is configured as ESM.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
babel-plugin-react-compilerrequiredRequired peer dependency for the CLI to work; it scans files using the Babel plugin to detect compiled and failed components.
Agent activity
2 hits · last 30 days
node
2
Resources
react-compiler-marker — npm install react-compiler-marker · libregistry