Thank you for your interest in contributing to the React on Rails demo applications! This document provides guidelines and instructions for contributing.
Please note that this project adheres to a code of conduct. By participating, you are expected to uphold this standard.
- Fork the repository
- Clone your fork
- Create a new branch for your feature or fix
- Make your changes
- Run tests and linting
- Submit a pull request
- Ruby 3.3+
- Node.js 20+
- PostgreSQL
- pnpm (recommended) or npm/yarn
# Clone the repository
git clone https://github.com/shakacode/react_on_rails-demos.git
cd react_on_rails-demos
# Bootstrap all demos
bin/bootstrap-allcd demos/react_on_rails-demo-v16-[feature-name]
bin/devUse the Ruby scripts for creating demos (fully tested and recommended):
# Create a basic demo
bin/new-demo react_on_rails-demo-v16-your-feature
# Create an advanced demo with scaffolding and integrations
bin/scaffold-demo react_on_rails-demo-v16-your-feature
# Show available options
bin/new-demo --help
bin/scaffold-demo --helpSee the README for detailed usage examples.
Run tests for all demos:
bin/test-allRun tests for a specific demo:
cd demos/react_on_rails-demo-v16-[feature-name]
bundle exec rspecAll demos share common linting configurations:
bundle exec rubocoppnpm run lint- Use clear, descriptive commit messages
- Follow conventional commit format when possible
- Reference issues in commit messages where applicable
Example:
feat: add TypeScript support to v16 demo
- Configure TypeScript with React on Rails
- Add type definitions for server rendering
- Update webpack configuration
Fixes #123
- Update Documentation: Ensure README files are updated with details of changes
- Run Tests: Verify all tests pass locally
- Lint Code: Ensure code passes all linting checks
- Update Changelog: Add notes about your changes if significant
- Request Review: Tag maintainers for review
Use descriptive titles that explain what the PR does:
feat: add React Server Components demofix: correct webpack configuration in SSR demodocs: update setup instructions for demos
Each demo should:
- Have a Clear Purpose: Focus on demonstrating specific React on Rails features
- Include Documentation: Provide a comprehensive README explaining:
- What features are demonstrated
- How to run the demo
- Key files to examine
- Any special configuration
- Follow Best Practices: Use current React on Rails best practices
- Be Self-Contained: Each demo should run independently
- Include Tests: Add appropriate test coverage
When modifying shared configuration in packages/shakacode_demo_common/:
- Test changes across multiple demos
- Update documentation if configuration options change
- Consider backward compatibility
- Update the gem/npm package versions appropriately
- Open an issue for bugs or feature requests
- Join the ShakaCode Slack for discussion
- Tag
@shakacode/react-on-railsfor React on Rails specific questions
By contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for helping make React on Rails better through clear, working examples!