Awesome
React-Rails v3
For version 2.7 documentation, visit the 2.7-stable branch.
Summary
React-Rails is a flexible tool to use React with Rails. The benefits:
- Automatically renders React server-side and client-side
- Supports Shakapacker v7
- Supports Sprockets 4.x, 3.x
- Lets you use JSX, ES6, TypeScript, CoffeeScript
While ShakaCode will continue to support this gem, you might consider migrating to React on Rails or React on Rails Pro with proper Node rendering.
Why? React on Rails code receives much more active development and testing. For example, consider the ReactRailsUJS implementation compared to the ReactOnRails Node package which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as React Server Components.
You can find migration to React on Rails steps here.
ShakaCode Support
ShakaCode focuses on helping Ruby on Rails teams use React and Webpack better. We can upgrade your project and improve your development and customer experiences, allowing you to focus on building new features or fixing bugs instead.
For an overview of working with us, see our Client Engagement Model article and how we bill for time.
We also specialize in helping development teams lower infrastructure and CI costs. Check out our project Control Plane Flow, which can allow you to get the ease of Heroku with the power of Kubernetes and big cost savings.
If you think ShakaCode can help your project, click here to book a call with Justin Gordon, the creator of React on Rails and Shakapacker.
Here's a testimonial of how ShakaCode can help from Florian GΓΆΓler of Blinkist, January 2, 2023:
Hey Justin π
I just wanted to let you know that we today shipped the webpacker to shakapacker upgrades and it all seems to be running smoothly! Thanks again for all your support and your teams work! π
On top of your work, it was now also very easy for me to upgrade Tailwind and include our external node_module based web component library which we were using for our other (more modern) apps already. That work is going to be shipped later this week though as we are polishing the last bits of it. π
Have a great 2023 and maybe we get to work together again later in the year! π
Read the full review here.
Resources
- Click to join React + Rails Slack. Then join the channel
#react-rails
. - If upgrading, consider migrating to the react_on_rails gem.
- Source code example utilizing React-Rails: https://github.com/BookOfGreg/react-rails-example-app
Documentation
- Get started
- View Helper
- UJS
- Server-Side Rendering
- Controller Actions
- Component Generator
- Upgrading
- Migrating from
react-rails
toreact_on_rails
- Common Errors
After reading this README file, additional information about React-Rails can be found on the Wiki page: https://github.com/reactjs/React-Rails/wiki The Wiki page features a significant amount of additional information about React-Rails, including instructional articles and answers to the most frequently asked questions.
Related Projects
- react_on_rails: Integration of React with Rails utilizing Webpack, Redux, React-Router.
- React on Rails Pro:React on Rails with Node rendering and many other performance enhancements.
- react-rails-benchmark_renderer adds performance instrumentation to server rendering.
- Ruby Hyperstack: Use Ruby to build reactive user interfaces with React.
Contributing
π Thanks for taking the time to contribute! π See CONTRIBUTING.md for more details.
Supporters
The following companies provide licenses to the ShakaCode team, supporting the development of this and other open-source projects maintained by ShakaCode. ShakaCode stands by the usefulness of these products!
<br /> <br /> <a href="https://www.jetbrains.com"> <img src="https://user-images.githubusercontent.com/4244251/184881139-42e4076b-024b-4b30-8c60-c3cd0e758c0a.png" alt="JetBrains" height="120px"> </a> <a href="https://scoutapp.com"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/4244251/184881147-0d077438-3978-40da-ace9-4f650d2efe2e.png"> <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png"> <img alt="ScoutAPM" src="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png" height="120px"> </picture> </a> <a href="https://controlplane.com"> <picture> <img alt="Control Plane" src="https://github.com/shakacode/.github/assets/20628911/90babd87-62c4-4de3-baa4-3d78ef4bec25" height="120px"> </picture> </a> <br /> <a href="https://www.browserstack.com"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/4244251/184881122-407dcc29-df78-4b20-a9ad-f597b56f6cdb.png"> <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png"> <img alt="BrowserStack" src="https://user-images.githubusercontent.com/4244251/184881129-e1edf4b7-3ae1-4ea8-9e6d-3595cf01609e.png" height="55px"> </picture> </a> <a href="https://www.honeybadger.io/"> <picture> <img alt="HoneyBadger" src="https://user-images.githubusercontent.com/4244251/184881133-79ee9c3c-8165-4852-958e-31687b9536f4.png" height="70px"> </picture> </a>ShakaCode is hiring!