{"id":26153,"library":"react-compiler-marker","title":"react-compiler-marker","description":"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.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/blazejkustra/react-compiler-marker","tags":["javascript"],"install":[{"cmd":"npm install react-compiler-marker","lang":"bash","label":"npm"},{"cmd":"yarn add react-compiler-marker","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-compiler-marker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for the CLI to work; it scans files using the Babel plugin to detect compiled and failed components.","package":"babel-plugin-react-compiler","optional":false}],"imports":[{"note":"Package is ESM-only. CommonJS require will fail unless using a dynamic import.","wrong":"const reactCompilerMarker = require('react-compiler-marker')","symbol":"default export","correct":"import reactCompilerMarker from 'react-compiler-marker'"},{"note":"run is a named export. CommonJS require will fail with ESM.","wrong":"const { run } = require('react-compiler-marker')","symbol":"run","correct":"import { run } from 'react-compiler-marker'"},{"note":"TypeScript type import; use import type for type-only imports.","wrong":"","symbol":"ReportFormat type","correct":"import type { ReportFormat } from 'react-compiler-marker'"}],"quickstart":{"code":"import { run } from 'react-compiler-marker';\n\nconst result = await run({\n  directory: '.',\n  format: 'json',\n  excludeDirs: ['node_modules', 'dist'],\n  includeExtensions: ['.tsx', '.ts'],\n  babelPluginPath: process.env.BABEL_PLUGIN_PATH ?? undefined\n});\n\nconsole.log(JSON.stringify(result, null, 2));","lang":"typescript","description":"Shows how to programmatically run react-compiler-marker as a Node.js API, with options for directory, format, exclusions, and babel plugin path."},"warnings":[{"fix":"Pin to exact version in package.json if stability is required.","message":"v0.1.0 is initial release; API may change in future minor versions.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Ensure babel-plugin-react-compiler is installed. Use --babel-plugin-path option to specify exact path if auto-detection fails.","message":"Requires 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use || true or conditional logic to handle exit code 1 appropriately.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"message":"No deprecated features yet; package is at v0.1.0 initial release.","severity":"deprecated"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the plugin: npm install babel-plugin-react-compiler --save-dev or provide the path via --babel-plugin-path.","cause":"The required peer dependency is not installed in the target project or cannot be resolved.","error":"Error: Cannot find module 'babel-plugin-react-compiler'"},{"fix":"Verify the directory path and adjust --include-extensions to match your project's file extensions.","cause":"The directory does not contain any files with the default extensions, or the directory path is incorrect.","error":"Error: No files found matching extensions .js,.jsx,.ts,.tsx,.mjs,.cjs in directory '.'"},{"fix":"Use dynamic import: const reactCompilerMarker = await import('react-compiler-marker'); or ensure your project is configured as ESM.","cause":"Attempting to import the package using CommonJS require() which is not supported (ESM-only).","error":"SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}