@rn-debug-mcp/babel-plugin
v1.0.5
Published
Babel plugin for automatic React Native component instrumentation
Maintainers
Readme
@rn-debug-mcp/babel-plugin
Babel plugin for automatic React Native component instrumentation.
Part of the RN Debug MCP suite. This plugin automatically injects render tracking hooks into your functional components.
🚀 Comprehensive Setup
To use the full RN Debug MCP suite, you need three parts:
- Babel Plugin (This package):
npm install @rn-debug-mcp/babel-plugin --save-dev - Instrumentation:
npm install @rn-debug-mcp/instrumentation(required by the plugin) - MCP Server: Run via
npx -y @rn-debug-mcp/server(for Cursor/AI integration)
View the Full Integration Guide
Setup
Add the plugin to your babel.config.js:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [...(process.env.NODE_ENV !== 'production' ? ['@rn-debug-mcp/babel-plugin'] : [])],
};The plugin scans your source code for functional components and injects tracking hooks from @rn-debug-mcp/instrumentation:
useRenderTracker: Counts render frequency.useRenderCheck: Compares props between renders to detect unnecessary updates.useContextTracker: Injected intoContext.Providerto track value changes.setCurrentScreen: Automatically inferred from filenames to provide screen-aware debugging.
License
MIT
