1.0.0 โข Published 4 months ago
blinkreact v1.0.0
๐ BlinkReact
โจ Features
- ๐ Render Count Tracking: Monitor how many times a component re-renders and detect unnecessary re-renders
- โฑ๏ธ Render Time Measurement: Measure the time taken for initial and subsequent renders
- ๐ง State Update Monitoring: Track state changes and detect redundant updates
- ๐ ๏ธ Performance Recommendations: Get actionable suggestions for optimizing your component
๐ฆ Installation
# Install globally
npm install -g blinkreact
# Or use npx without installing
npx blinkreact <component-file>
๐ฆ Usage
blinkreact path/to/your/component.tsx
๐ How It Works
BlinkReact analyzes your React component through a 4-step process:
- ๐งช Instrumentation: Adds performance tracking code to your component
- ๐ Render Analysis: Measures render counts and durations
- ๐ State Analysis: Detects redundant state updates and inefficient patterns
- ๐ Report Generation: Creates a comprehensive performance report
๐ Output
BlinkReact generates a detailed PERFORMANCE_REPORT.md
file containing:
Section | Description |
---|---|
๐ Component Info | Component name and file path |
โฑ๏ธ Render Metrics | Total renders, render times, unnecessary renders |
๐ง State Management | State updates and redundancy analysis |
๐ก Recommendations | Actionable optimization suggestions |
๐ง Requirements
- Node.js >= 14.0
- React >= 18.0
๐ Example Report
# BlinkReact Performance Report
## Component: `TodoList`
**File Path:** `src/components/TodoList.tsx`
**Analysis Date:** 2023-05-15 10:30:45
## Render Performance
- **Total Renders:** 5
- **Average Render Time:** 3.45ms
- **Maximum Render Time:** 8.12ms
- **Unnecessary Renders:** 2
## State Management
- **Total State Updates:** 10
- **Redundant State Updates:** 2
## Performance Recommendations
- **Reduce Unnecessary Renders:** Consider using `React.memo()` to prevent re-renders when props haven't changed.
- **Optimize Render Performance:** The component has slow renders. Consider breaking it down into smaller components.
- **Reduce Redundant State Updates:** The component has redundant state updates. Consider using functional updates.
๐ค Contributing
Contributions, issues and feature requests are welcome! Feel free to check the issues page.
๐ License
This project is ISC licensed.
1.0.0
4 months ago