Thank you for your interest in contributing to HyperRender! We welcome contributions from the community and appreciate your help in making this project better.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Commit Guidelines
- Pull Request Process
- Reporting Issues
- Testing
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/hyper_render.git cd hyper_render - Add upstream remote:
git remote add upstream https://github.com/brewkits/hyper_render.git
- Flutter SDK >=3.10.0
- Dart SDK >=3.5.0
- Git
-
Install dependencies:
flutter pub get
-
Run tests to verify setup:
flutter test -
Run the example app:
cd example flutter run
hyper_render/
├── lib/ # Main package (convenience wrapper)
├── packages/
│ ├── hyper_render_core/ # Core rendering engine (zero dependencies)
│ ├── hyper_render_html/ # HTML parsing plugin
│ ├── hyper_render_markdown/ # Markdown parsing plugin
│ ├── hyper_render_highlight/ # Syntax highlighting plugin
│ └── hyper_render_clipboard/ # Clipboard operations plugin
├── example/ # Example Flutter app
├── test/ # Integration and system tests
└── doc/ # Documentation
We welcome:
- Bug fixes
- New features
- Documentation improvements
- Performance optimizations
- Test coverage improvements
- Examples and tutorials
- Check existing issues to see if your idea/bug is already being discussed
- Create an issue for significant changes to discuss the approach
- For small fixes, feel free to submit a PR directly
- Follow the Effective Dart guidelines
- Use
flutter_lintsfor code analysis - Run
dart format .before committing - Run
flutter analyzeto check for issues
-
Naming:
- Classes:
PascalCase - Variables/functions:
camelCase - Constants:
camelCaseorSCREAMING_SNAKE_CASEfor compile-time constants - Private members: prefix with
_
- Classes:
-
Documentation:
- Add dartdoc comments (
///) for all public APIs - Include usage examples for complex APIs
- Document parameters, return values, and exceptions
- Add dartdoc comments (
-
Code Organization:
- Keep files under 500 lines when possible
- Group related functionality together
- Extract complex logic into separate functions/classes
-
Performance:
- Avoid unnecessary rebuilds
- Use
constconstructors where possible - Profile before optimizing
-
No Debug Code:
- Remove all
print()statements from production code - Use
debugPrint()or logging packages for development
- Remove all
- Write tests for all new features
- Maintain or improve test coverage
- Include unit tests, widget tests, and integration tests as appropriate
- Test edge cases and error conditions
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringtest: Adding or updating testsperf: Performance improvementschore: Maintenance tasks
Examples:
feat(html): add support for CSS Grid layout
Implement CSS Grid layout parsing and rendering with proper
alignment and gap support.
Closes #123
fix(core): resolve text selection crash on empty nodes
Add null checks in selection logic to prevent crashes when
selecting empty text nodes.
Fixes #456
-
Update your branch with the latest upstream changes:
git fetch upstream git rebase upstream/main
-
Run tests:
flutter test -
Run analysis:
flutter analyze
-
Format code:
dart format . -
Update documentation if needed
-
Push to your fork:
git push origin your-branch-name
-
Create a Pull Request on GitHub
-
Fill out the PR template completely:
- Description of changes
- Related issue numbers
- Testing performed
- Screenshots/videos (for UI changes)
- Breaking changes (if any)
-
Respond to review feedback promptly
- ✅ All tests pass
- ✅ Code follows style guidelines
- ✅ Documentation updated
- ✅ Commit messages follow conventions
- ✅ No merge conflicts
- ✅ Signed commits (optional but recommended)
- Maintainers will review your PR within 1-2 weeks
- Address feedback by pushing new commits
- Once approved, a maintainer will merge your PR
- PRs may be closed if inactive for 30+ days
When reporting bugs, include:
- Description: Clear description of the issue
- Steps to Reproduce: Minimal reproducible example
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment:
- Flutter version:
flutter --version - Dart version:
dart --version - Platform: iOS/Android/Web/Desktop
- Device/Emulator details
- Flutter version:
- Code Sample: Minimal code that reproduces the issue
- Logs/Screenshots: Any relevant error messages or screenshots
When requesting features:
- Use Case: Describe the problem you're trying to solve
- Proposed Solution: Your suggested implementation
- Alternatives: Other approaches you've considered
- Additional Context: Any other relevant information
# Run all tests
flutter test
# Run specific test file
flutter test test/system_test.dart
# Run with coverage
flutter test --coverage
# View coverage report
genhtml coverage/lcov.info -o coverage/html
open coverage/html/index.html- Place unit tests in
test/directory - Use descriptive test names
- Follow AAA pattern: Arrange, Act, Assert
- Use
group()to organize related tests - Mock external dependencies
Example:
test('parses simple HTML paragraph', () {
// Arrange
const html = '<p>Hello World</p>';
// Act
final document = HtmlParser().parse(html);
// Assert
expect(document.children, hasLength(1));
expect(document.children[0].textContent, equals('Hello World'));
});If you have questions about contributing:
- Check the documentation
- Search existing issues
- Ask in GitHub Discussions
- Open a new issue with the
questionlabel
Thank you for contributing to HyperRender! 🚀