A couple of months ago, after a long hacking night, Juan
and I were discussing front-end library options for our upcoming app project over Slack. Overloaded with client work, we were looking for a library we can learn in a short time.
Then we tried React.js
, even though the official React documentation is not as great as Rails’ documentation, after a couple of hours of hacking, React felt very simple to learn and in a week or so we decided to re-build all our apps with React.
React community is growing fast and while it is possible to develop an app just using React; we prefer to merge magic of React with the power of Rails. Rails 5.1 is out and it comes with out of the box support for Webpack/React/Angular/Vue.js. It includes webpacker
gem which lets us use Webpack
Webpacker in Rails coexists with the asset pipeline. This structure provides a powerful separation of front-end from the back-end. While benefiting all great features comes out of the box with Rails, front-end development gets done much faster with ES6 + JSX combination and React flow. The code becomes easier to work on and maintain for teams.
And as Terry Pratchett said, “It’s still magic even if you know how it’s done.”