Rails 5.1 introduced ways for better interaction with React. I would love to get an opinion on anyone out there who is currently working with this new functionality. Is this a good stack to work in?
I no longer actively work with Ruby/Rails, but yes, React and Rails work very well together.
As far as integration goes, there are broadly three solutions you can utilize:
react-rails
react-rails deeply integrates javascript build tooling into traditional rails workflow.
There are useful helpers to integrate react components into your ERB templates and server rendering is supported out of the box.
This is the ideal option if you want to integrate React conservatively in an existing Rails application, or want to utilize opinionated rails engines like Spree which have strong assumptions about Rails view layer.
Keep in mind that a frontend developer coming into the team has to now be familiar with both the Rails view layer as well as React + associated technologies.
Decoupled Frontend and Backend
This is the approach I usually recommend for new applications where all or most of the frontend would be driven by React.
You can entirely steer clear of Rails view layer and asset pipeline, and keep the backend and frontend concerns separate - typically in separate repositories.
Frontend developers can easily mock out the backend API once an API contract has been established and this streamlines development workflow.
For server rendering you can take advantage of the excellent Hypernova library by Airbnb which integrates with both React and Rails.
Hyperloop
Hyperloop is a very cohesively integrated stack where you code your frontend entirely in Ruby, which is compiled to javascript through Opal. There are react bindings and though I have limited exposure to this, the setup works quite well out of the box.
This is a great solution if you intend to write your entire application in Ruby and share logic across client and server, however I can guarantee that this will not alleviate your team from learning javascript.
Debugging story is not exactly a cakewalk. While sourcemaps allow you to debug ruby in the browser, the overall experience is far from ideal. Besides glitches like weird jumps when stepping through code, you can no longer put a breakpoint at an arbitrary location and evaluate any piece of code in the console, which is huge advantage when coding in javascript. There is nothing (yet?) in the ecosystem which works as well as Figwheel REPL.
Also exceptions raised in generated code can be somewhat cumbersome to track through.
Lorefnon
Open Web Enthusiast
I no longer actively work with Ruby/Rails, but yes, React and Rails work very well together.
As far as integration goes, there are broadly three solutions you can utilize:
react-rails
react-rails deeply integrates javascript build tooling into traditional rails workflow.
There are useful helpers to integrate react components into your ERB templates and server rendering is supported out of the box.
This is the ideal option if you want to integrate React conservatively in an existing Rails application, or want to utilize opinionated rails engines like Spree which have strong assumptions about Rails view layer.
Keep in mind that a frontend developer coming into the team has to now be familiar with both the Rails view layer as well as React + associated technologies.
Decoupled Frontend and Backend
This is the approach I usually recommend for new applications where all or most of the frontend would be driven by React.
You can entirely steer clear of Rails view layer and asset pipeline, and keep the backend and frontend concerns separate - typically in separate repositories.
Frontend developers can easily mock out the backend API once an API contract has been established and this streamlines development workflow.
For server rendering you can take advantage of the excellent Hypernova library by Airbnb which integrates with both React and Rails.
Hyperloop
Hyperloop is a very cohesively integrated stack where you code your frontend entirely in Ruby, which is compiled to javascript through Opal. There are react bindings and though I have limited exposure to this, the setup works quite well out of the box.
This is a great solution if you intend to write your entire application in Ruby and share logic across client and server, however I can guarantee that this will not alleviate your team from learning javascript.
Debugging story is not exactly a cakewalk. While sourcemaps allow you to debug ruby in the browser, the overall experience is far from ideal. Besides glitches like weird jumps when stepping through code, you can no longer put a breakpoint at an arbitrary location and evaluate any piece of code in the console, which is huge advantage when coding in javascript. There is nothing (yet?) in the ecosystem which works as well as Figwheel REPL.
Also exceptions raised in generated code can be somewhat cumbersome to track through.