PropFlow
Visualize React prop flow and eliminate prop drilling confusion Features • Installation • Usage • Demo • Contributing 🎯 Problem StatementIn large React applications, tracing where props originate becomes a time-consuming manual process:
PropFlow solves this by showing you the complete propflow lineage instantly, right where you need it. ✨ Features🔍 Instant Hover TracingHover over any prop to see the complete data flow from source to destination.
🌲 PropFlow Lineage TreeVisual hierarchical sidebar showing the full component chain.
🎨 Color-Coded Visualization
🚀 Click-to-NavigateJump directly to any component in the chain with one click.
⚡ Performance Optimized
🛠️ Handles Edge Cases
📦 InstallationFrom VS Code Marketplace
From VSIX File
From Source
🚀 UsageMethod 1: Hover (Recommended)
Example:
Result:
Method 2: Command Palette
Method 3: CodeLensLook for the 🎬 DemoTracing a Simple PropFile Structure:
App.tsx:
Card.tsx:
Button.tsx:
PropFlow Output:
Handling Prop RenamingParent.tsx:
Child.tsx:
PropFlow Output:
⚙️ ConfigurationPropFlow works out-of-the-box with zero configuration. Optional settings: User Settings (
|
| Setting | Default | Description |
|---|---|---|
maxTraceDepth |
20 |
Maximum levels to trace (prevents infinite loops) |
enableHoverProvider |
true |
Show hover tooltips |
enableCodeLens |
true |
Show CodeLens links above components |
traceTimeout |
5000 |
Timeout for trace operations (ms) |
🏗️ Architecture
Overview
┌─────────────────────────────────────────┐
│ VS Code Extension │
├─────────────────────────────────────────┤
│ Hover Provider │ Command Handlers │
│ CodeLens │ Tree View Provider │
└─────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Graph Builder │
│ • Recursive prop chain construction │
│ • Workspace-wide JSX search │
└─────────────┬───────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ AST Analyzer (ts-morph) │
│ • Parse TypeScript/JavaScript │
│ • Extract components and props │
│ • Find JSX element attributes │
└─────────────────────────────────────────┘
Core Algorithms
1. Prop Chain Building
function buildPropChain(filePath, componentName, propName):
1. Create root node: { component, prop, type: DEFINITION }
2. Find parent component using workspace search
3. Parse parent's JSX to find prop usage
4. Determine if source (literal) or usage (variable)
5. If usage, recursively trace parent's parent
6. Return complete chain from source → current
2. Workspace JSX Search
function findComponentUsages(componentName):
1. Search all .tsx/.jsx files for `<ComponentName`
2. Return file paths and line numbers
3. Filter out false positives (comments, strings)
3. Prop Usage Detection
function findPropUsage(sourceFile, componentName, propName):
1. Get all JSX elements in file
2. Find elements matching componentName
3. Extract attributes from matching element
4. Look for propName in attributes
5. Return prop value (literal or expression)
🧪 Testing
Run Tests
npm test
Test Coverage
npm run coverage
Test Structure
test/
├── suite/
│ └── index.ts # Test runner setup
├── extension.test.ts # Extension activation tests
├── astAnalyzer.test.ts # AST parsing tests
└── graphBuilder.test.ts # Prop chain building tests
Current Coverage: 15 passing tests
- 5 Extension integration tests
- 6 AST analyzer tests
- 4 Graph builder tests
🔧 Development
Prerequisites
- Node.js 18+
- VS Code 1.85.0+
- npm or yarn
Setup
# Clone repository
git clone https://github.com/rutpshah/propflow.git
cd propflow
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
Debugging
- Open the project in VS Code
- Press
F5to start debugging - A new VS Code window opens with the extension loaded
- Test your changes in the Extension Development Host
Building
# Compile
npm run compile
# Run tests
npm test
# Package extension
npm run package
This creates propflow-<version>.vsix ready for distribution.
🤝 Contributing
We welcome contributions! Here's how to get started:
Contribution Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Write tests for new functionality
- Ensure tests pass:
npm test - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
Areas for Contribution
- 🎯 Context API tracing - Trace
useContextvalues - 🎯 Redux integration - Trace store connections
- 🎯 Class component support - Handle legacy codebases
- 🎯 Performance improvements - Optimize for monorepos
- 🎯 Documentation - Improve guides and examples
- 🎯 Bug fixes - Check Issues
Code Style
- Use TypeScript for all new code
- Follow existing code style (ESLint)
- Add JSDoc comments for public APIs
- Write meaningful commit messages
Commit Message Format
We use conventional commits:
feat:- New featurefix:- Bug fixdocs:- Documentation onlyrefactor:- Code change that neither fixes a bug nor adds a featuretest:- Adding or updating testschore:- Maintenance tasks
🐛 Known Issues & Limitations
Current Limitations (v1.0)
❌ Not Supported:
- Context API (
useContext) - Redux/Zustand store connections
- Class components
- Dynamic/computed prop names
- Props from external libraries (stops at boundary)
✅ Supported:
- Function components
- Hooks-based components
- Destructured props
- Prop spreading
- Prop renaming
- Default & named exports
Known Issues
See Issues for active bugs and feature requests.
🗺️ Roadmap (Tentative)
v1.1 (Q2 2026)
- [ ] Context API support
- [ ] Redux store tracing
- [ ] Performance optimizations for 50k+ file projects
- [ ] Configurable color schemes
- [ ] Prop documentation in hover tooltip
v1.2 (Q3 2026)
- [ ] Class component support
- [ ] Prop type information in trace
- [ ] Export diagrams as PNG/SVG
- [ ] Multi-root workspace support
v2.0 (Q4 2026)
- [ ] Vue.js component tracing
- [ ] Angular component tracing
- [ ] Real-time collaboration features
- [ ] AI-powered prop usage suggestions
📄 License
MIT License - see LICENSE file for details.
👤 Author
Your Name
🙏 Acknowledgments
- ts-morph - For excellent TypeScript AST manipulation
- VS Code Extension API - For comprehensive IDE integration
- React community - For inspiration and feedback
📊 Stats
💬 Support
- Star this repo on GitHub
- Suggest features - Have an idea? We'd love to hear it (Refer to
feature_request.mdtemplate) - Improve docs - Typos, clarifications, examples
- Issues: GitHub Issues (Refer to
bug_report.mdtemplate) - Discussions: GitHub Discussions
- Email: hello@rutpshah.com
If this extension saves you time, consider:
If PropFlow saves you time, please ⭐ star the repo!
Made with ❤️ for developers




