Plugin Development
This guide will walk you through the complete process of creating a React Native DevTools plugin, from initial generation to building for production.
Tip: Before creating your own plugin, check out the Official Plugins to see if there's already a plugin that meets your needs!
Quick Start
Generate a new plugin in seconds:
Step 1: Generate Your Plugin
The rozenite generate command creates a complete plugin project structure:
This creates:
- Complete TypeScript project setup
- Vite build configuration with Rozenite plugin
- Sample DevTools panel
- Git repository with initial commit
- All dependencies installed
Step 2: Understanding Plugin Structure
Your generated plugin has this structure:
Step 3: Creating Panels
Panels are React components that appear in the DevTools interface. They're defined in your rozenite.config.ts file. Plugin developers can leverage React Native APIs and libraries to create powerful debugging tools that integrate deeply with the React Native runtime.
Type-Safe Plugin Development
Rozenite provides full TypeScript support for plugin development. The RozeniteDevToolsClient uses an event-based API with full type safety:
Client API
Type Safety Benefits
- Compile-time error checking for event names and payloads
- IntelliSense support for all event types and methods
- Type-safe event handling between DevTools and React Native
- Automatic refactoring when event interfaces change
- Plugin ID isolation ensures events don't conflict between plugins
Panel Configuration Options
Creating a Panel Component
Create a new panel by adding a React component:
Using the Plugin Bridge
Connect your panel to React Native using the plugin bridge. The RozeniteDevToolsClient provides full TypeScript support for type-safe communication:
Step 4: React Native Integration
Add React Native functionality by creating a react-native.ts file. You can use React Native APIs and libraries to enhance your plugin:
Step 5: Local Development Workflow
Complete Development Setup
For local plugin development, follow these steps:
Step 1: Create and Start Your Plugin
This starts a development server that:
- Watches for file changes
- Hot reloads your panels automatically
- Provides real-time feedback during development
Step 2: Link to React Native Playground
- Create or use a React Native playground project that has Rozenite configured
- Add your plugin to the playground's dependencies (you can use
npm link,yarn linkorpnpm linkfor local development)
Step 3: Run Your React Native App
Then run the app on your device or simulator.
Step 4: Open DevTools
- Open React Native DevTools in your browser
- Your plugin panels should appear in the sidebar automatically
Hot Reloading
Your development workflow supports automatic hot reloading:
- Panel changes: Your DevTools panels will automatically update when you make changes to your plugin code
- React Native integration changes: Changes to your
react-native.tsfile will also hot reload - New panels: If you add a new panel to your
rozenite.config.ts, restart React Native DevTools by pressingCtrl+R(orCmd+Ron Mac) - Configuration changes: Most changes to
rozenite.config.tsrequire a DevTools restart
Testing Your Plugin
- Make changes to your panel components - they should update instantly
- Modify your React Native integration code - changes should be reflected immediately
- Add new panels - remember to restart DevTools with
Ctrl+R - Test communication between your panels and React Native code
Step 6: Building for Production
Build your plugin for distribution:
This creates optimized bundles:
- DevTools panels (minified and optimized)
- React Native entry point (if
react-native.tsexists) - Ready for distribution
Build Output
The build creates a dist/ directory with:
*.js- Individual DevTools panel files (one file per panel, names reflect your config)react-native.js- React Native integration (if applicable)rozenite.json- Plugin manifest with metadata and configuration- Source maps for debugging
Next Steps
- Check out Official Plugins to see available plugins
- Join the community to share your plugins and get help
