Thank you for your interest in contributing to bevy_material_ui!
- Rust 1.80+ (latest stable recommended)
- Cargo
- Git
git clone https://github.com/edgarhsanchez/bevy_material_ui.git
cd bevy_material_ui
cargo buildcargo testcargo run --example showcase
cargo run --example button_demo
# See examples/ directory for moreImportant: Before submitting a PR that affects performance-critical code, you must run benchmarks locally and include the results.
# Run all benchmarks
cargo bench --benches
# Run specific benchmark suite
cargo bench --bench color_benchmarks
cargo bench --bench component_benchmarks
cargo bench --bench system_benchmarksNotes:
- The bench entrypoints are in
benches/*.rs, and the benchmark groups are organized into per-component files underbenches/components/and per-system files underbenches/systems/. - To focus on a subset of Criterion benchmarks, you can pass a filter after
--, e.g.cargo bench --bench component_benchmarks -- button.
When submitting PRs that may impact performance:
- Run the relevant benchmarks locally
- Copy benchmark data to
benchmarks/results/:# Copy estimates for tracking find target/criterion -name "estimates.json" -exec sh -c 'mkdir -p "benchmarks/results/$(dirname {})" && cp {} "benchmarks/results/$(dirname {})"' \;
- Update
benchmarks/results/README.mdwith the date and commit hash - Include a summary of benchmark results in your PR description
- If there are significant performance changes (>5%), explain why
Example PR description section:
## Benchmark Results
Ran `cargo bench --benches` before and after changes:
- `hct_to_argb_single`: 2,103 ns/iter → 1,950 ns/iter (-7.3%)
- `palette_generation`: No significant change
- `color_scheme_creation`: 15,420 ns/iter → 15,380 ns/iter (~0%)
See `benchmarks/results/` for full data.Criterion stores results in:
- HTML reports:
target/criterion/*/report/index.html - Raw data:
target/criterion/*/base/
You can view detailed results by opening the HTML reports in your browser.
cargo fmt --allcargo clippy --all-targets --all-featurescargo doc --no-deps --open- Fork the repository
- Create a branch from
mainfor your feature or fix - Make your changes with clear, descriptive commits
- Run tests and ensure they pass
- Run benchmarks if your changes affect performance
- Format code with
cargo fmt - Check for warnings with
cargo clippy - Update documentation if adding new features
- Submit a PR with a clear description of changes
## Summary
Brief description of the changes
## Changes
- List of specific changes made
## Testing
How you tested your changes
## Benchmark Results (if applicable)
Performance impact summary
## Breaking Changes (if applicable)
What breaks and how to migrate- Follow Rust standard naming conventions (snake_case, CamelCase, SCREAMING_SNAKE_CASE)
- Use meaningful variable and function names
- Add doc comments for public APIs
- Keep functions focused and reasonably sized
- Prefer explicitness over cleverness
Feel free to:
- Open an issue for discussion
- Ask in pull request comments
- Tag @edgarhsanchez for questions
Thank you for contributing!