This guide will help you set up your development environment for working on RxTUI.
- Rust 1.70+ (install via rustup)
- Git
- A terminal emulator with Unicode support
git clone https://github.com/yourusername/rxtui.git
cd rxtuicargo buildThis will download and compile all dependencies.
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name# Build all examples
cargo build --examples
# Run specific example
cargo run --example demorxtui/
├── rxtui/ # Main library crate
│ ├── lib/ # Library source code
│ │ ├── app/ # Application core
│ │ ├── components/ # Built-in components
│ │ ├── macros/ # Macro implementations
│ │ └── ...
│ ├── examples/ # Example applications
│ └── tests/ # Integration tests
├── rxtui-macros/ # Proc macro crate
├── docs/ # Documentation
└── examples/ # Standalone examples
For faster iteration during development:
# Watch for changes and rebuild
cargo watch -x build
# Run tests on file change
cargo watch -x test
# Run specific example on change
cargo watch -x "run --example demo"Enable debug output:
// In your app configuration
let app = App::new()?
.render_config(RenderConfig {
use_double_buffer: false, // Disable for debugging
use_diffing: false, // See all renders
poll_duration_ms: 100, // Slower polling
});# Build with release optimizations but keep debug symbols
cargo build --release --features debug
# Profile with your favorite tool
# Example with perf on Linux:
perf record --call-graph=dwarf cargo run --release --example demo
perf report- Create component file in
rxtui/lib/components/ - Implement the Component trait
- Add to
mod.rsexports - Write tests in component file
- Add example usage
- Edit
rxtui/lib/macros/node.rs - Test with
cargo test macro_tests - Update documentation if syntax changes
- Add examples of new syntax
- Define event in
rxtui/lib/app/events.rs - Add handler parsing in macro
- Implement event dispatch
- Write tests for new events
Place unit tests in the same file as the code:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_feature() {
// Test implementation
}
}Place in rxtui/tests/ directory:
use rxtui::prelude::*;
#[test]
fn test_complete_flow() {
// Test complete user flow
}For testing rendered output:
#[test]
fn test_rendering() {
let buffer = TestBuffer::new(80, 24);
// Render and assert buffer contents
}Run these checks:
# Format code
cargo fmt
# Run clippy
cargo clippy -- -D warnings
# Run tests
cargo test
# Check documentation
cargo doc --no-deps --openOur CI runs:
cargo fmt -- --checkcargo clippy -- -D warningscargo testcargo doc
Terminal doesn't display correctly
- Ensure your terminal supports Unicode
- Check TERM environment variable
- Try different terminal emulator
Tests fail with display issues
- Tests should use headless mode
- Mock terminal for testing
Performance issues
- Enable optimizations:
cargo build --release - Profile to find bottlenecks
- Check render configuration
- Open an issue on GitHub
- Join our community discussions
- Check existing issues for solutions
- Update version in
Cargo.toml - Update CHANGELOG.md
- Run full test suite
- Create git tag
- Push to trigger CI release