SlideShare a Scribd company logo
1 of 36
Download to read offline
React on Rails
React + Redux + React-Router on Rails Views via Webpack/NPM
including Server Rendering, v 6.1
github.com/shakacode/react_on_rails
by Justin Gordon, justin@shakacode.com
Presented at LA Ruby, November 10, 2016
1
Who is Justin?
• Palisades High, undergrad at Harvard, MBA from UC Berkeley
• Lived in Boston, then San Francisco, then telecommuting from Maui!
• Used to blog a lot at http://www.railsonmaui.com
• Started hiring and renamed my company to ShakaCode!
• We have our own app! https://www.friendsandguests.com
2
Why add React to a Rails
Project?
3
Task: Build an Interactive Dashboard
• Old “Rails Way”:
CoffeeScript and jQuery
• Client: madroneco.com
• JavaScript Frameworks:
• Ember.js
• AngularJS
• React.js
4
Why React Inside a Rails App?
• You need a rich client interface…You decide on React (smart)
• Rails only as an API server? Or all Node.js tooling?
• Nah! We ❤ Rails for both front and back-end development. In a
large app, only some screens need a high fidelity JavaScript UX.
• That’s the sweet spot: the ability to mix and match simple Rails
screens with React where and when you need it, with ease!
• Use a React navigation header with a Rails content area.
5
Two videos =>Sold on React.js!
6
Pete Hunt: React: Rethinking best
practices -- JSConf EU 2013
https://youtu.be/x7cQ3mrcKaY
Mountain West JavaScript 2014 - Be
Predictable, Not Correct. by Pete Hunt
https://youtu.be/h3KksH8gfcQ
How about the react-rails gem?
• react-rails is based on the standard asset pipeline inclusion of
assets
• Benefits
• Simpler for newbies and those used to doing this the Rails way.
• Code organization is very much the Rails way, if you like that. (I’d
rather run with the JavaScript herd for JavaScript!)
7
Why not the react-rails gem?
• The custom setup via the Rails asset pipeline is just not anything like
the native tooling popular in the JavaScript community.
• How do you integrate Redux and React-Router?
• This is what led me to custom Webpack integration of Rails with React,
and eventually React on Rails!
• I just wanted to use an npm package called react-bootstrap, and there
was no obvious way to do that with react-rails in 2014.
• React-rails may support webpack someday; issues: #301 and #448.
8
9
Ruby Gems vs NPM
10
11
12
Why create the React on Rails Gem?
• Server rendering?
• React on Rails Doctrine
• Omakase for JavaScript
with Ruby on Rails!
13
React on Rails
• React + Redux + React-Router + Webpack + Babel Rock!
• Both a Ruby Gem react_on_rails and a NPM Package react-on-
rails!
• Used by Friends and Guests, Pivotal Tracker, Blink Inc, and others,
listed here.
• 2167+ ⭐ as of November 10, 2016
14
React on Rails
• All files for the client side under /client
• React: rendering
• Webpack + Babel + NPM: packages files for the browser (for distribution
via the Rails asset pipeline or a server for hot reloading assets)
• Favorite Libraries: Redux + React-Router: Key major JS components to use
with React, supported by React on Rails
• Tooling: ESLint, Flow, CSS-Modules, etc.: Many other cutting edge
JavaScript technologies enabled by doing things the JavaScript way, and
not the Rails way!
15
React on Rails Integration with Rails
• Production and Tests: Webpack creates JavaScript and CSS
assets that are used by the asset pipeline, like any other JS and
CSS files.
• Development: Can either use statically created JS and CSS files,
or special view helpers can grab “hot-reloadable” versions of the
JS and CSS from a Webpack Development Server.
16
17
Adding React on Rails to a new Rails app
18
https://youtu.be/_bjScw60FBk
Code Generated
19
• Demo App and change one line and restart (no hot reloading)
• Show generated source in browser
• Code walkthrough in RubyMine
• Optional: show hot-reloading https://github.com/shakacode/react-
webpack-rails-tutorial/
Getting Started
• Read The React on Rails Doctrine and React on Rails, 2000+ 🌟 Stars
• Lots of great docs at github.com/shakacode/react_on_rails
• Follow a simple tutorial
• Study example apps:
• Simple, no DB: test/demo app: github.com/shakacode/react_on_rails/tree/
master/spec/dummy
• A more complex example at www.reactrails.com with code: https://
github.com/shakacode/react-webpack-rails-tutorial
20
21
www.friendsandguests.com
www.blinkinc.com
22
spylight.com
23
Want More Help?
• ShakaCode can build your app, or augment your engineering team. We’re
free to use techniques and code from our own app,
www.friendsandguests.com.
• ShakaCode offers consulting on React on Rails, from a modestly priced
starter pack of usage help to full app development. We’re experts at Rails/
React/Redux/React-Router/Webpack JavaScript apps!
• Check out forum.shakacode.com for discussions. We have a Slack room!
• Follow @railsonmaui for updates on React on Rails.
• Aloha from Justin, justin@shakacode.com, and the ShakaCode Team!
24
React on Rails
Advanced Topics
25
Tips for Newbies
• Do simplest things first
• Initially skip:
• Server Rendering
• Hot Reloading
• CSS Modules
26
Hot Module Reloading in Rails
• Statically created assets always used for production and tests.
• Why HMR in development? No page refresh to see changes in JS and Sass code!
• How?
• ReactOnRails view helpers, env_javascript_include_tag and
env_stylesheet_link_tag configure getting assets either from HMR server or
regular static files.
• Procfile.hot sets ENV value so Rails knows and starts HMR server for assets
on port 3500, client/server-rails-hot.js
• More details: Hot Reloading of Assets for Rails Development
27
React on a Rails View via React On Rails
• redux_store: Rails helper method, sets up a registered redux store,
either in controller or on the view, usable by react components,
initialized with props from Rails. If defined on the view and server
rendering used, it must go before the react_component call.
• react_component: Rails view helper to put a registered component
on a Rails View. This component may talk to a registered redux store, or
it may create a redux store, getting initialized by props from Rails.
• ReactOnRails.register: JavaScript registration of stores and
components (actually functions that generate them).
28
Client Side Rendering
• React on Rails installs a post-load JavaScript function (turbolinks compatible) that scans the
HTML, using class matchers on hidden HTML elements, and does initialization, passing in props
from rails that is placed in a HTML data attribute.
1. Initialize any Redux Stores, via controller helper or view helper with props from Rails. Note
the use of <% and NOT <%= for the ERB call:
<% redux_store("SharedReduxStore", props: @app_props_server_render %>
2. Render any react components, optionally with props from Rails. Note the use of <%=
<%= react_component("HelloWorld", props: @app_props_server_render %>

• You don’t need Redux for React on Rails! It’s an option. You also don’t need the redux_store
API. You can initialize your redux stores with your components if you have a 1:1 mapping of a
redux store to a component. You do this with a “generator function” which is a function that takes
props and returns a Redux component attached to a store.
29
Server Side Rendering
• First, don’t try server rendering until client rendering is working without bugs!
• Set option prerender: true in the call to react_component
• React on Rails Server side rendering of React roughly does:
1. Sets up the JavaScript “context” with your server side webpack build
2. Create code to hydrate stores for the view
3. Create initialization code to server render react component, maybe passing props.
4. Execute this JavaScript on the Rails Server as part of the rendering process
5. Returns a HTML string placed on the Rails view
30
Shared Redux Stores
AppReduxStore
Header React Component Body React Component Footer React Component
• Many React components communicating with the same redux store
• Supports server rendering and react-router
31
Shared Redux Stores
AppReduxStore
Header React Component
Body React Component Body Rails Partial
• Allows a header React component to be paired with either a body react
component or a body Rails partial.
• Header React component can be dynamic! Notifications indicators!
• Why use Rails views? Sometimes Rails is good enough! and WAY less code!
Header React Component
AppReduxStore
32
react-router Integration
• react-router is supported including server rendering.
• If your server rendered router does a redirect, React on Rails
handles this by doing a redirect on the client side.
• More details are here.
33
CSS Options
1. Standard Rails: Just use React on Rails for JavaScript and your regular Rails
techniques for Sass, images, etc. Advantage: simple
2. Webpack Generated CSS: More complex, but not hard to setup with our
examples. Advantages:
1. CSS Modules. This is huge. Once you try this, you won’t go back. What is
it? Allows very simple CSS class names with small CSS files right next to
your JavaScript. Here’s an example in the react-webpack-rails-tutorial.
2. Hot Reloading. You can change the your Sass files, save, and then you’ll
see the browser update, without reloading. For configuration of hot
reloading, see Hot Reloading of Assets For Rails Development.
34
Performance
• Turbolinks: Don’t reload the JavaScript and CSS, just the HTML
• Fragment caching of Server Rendering: The fast way to generate
the HTML is to have it cached!
35
Running Tests
• React on Rails provides a test helper to optimize building the static
assets only when needed.
• This is a huge convenience!
• Be sure to setup config/initializers/react_on_rails.config
• Configure rails_helper:
RSpec.configure do |config|

# Ensure that if we are running js tests, we are using latest webpack assets

# This will use the defaults of :js and :server_rendering meta tags

ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
36

More Related Content

What's hot

Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SThoughtWorks
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years agoAndres Almiray
 
Rails Engine :: modularize you app
Rails Engine :: modularize you appRails Engine :: modularize you app
Rails Engine :: modularize you appMuntasim Ahmed
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spinAndres Almiray
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with RailsYi-Ting Cheng
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friendFilip Bruun Bech-Larsen
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Railsjduff
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScriptJustin Wendlandt
 
Isomorphic JavaScript – future of the web
Isomorphic JavaScript – future of the webIsomorphic JavaScript – future of the web
Isomorphic JavaScript – future of the webSigma Software
 
AEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly toolsAEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly toolsAshokkumar T A
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 yearsjduff
 
Client Vs. Server Rendering
Client Vs. Server RenderingClient Vs. Server Rendering
Client Vs. Server RenderingDavid Amend
 

What's hot (20)

Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G S
 
What I wish I knew about maven years ago
What I wish I knew about maven years agoWhat I wish I knew about maven years ago
What I wish I knew about maven years ago
 
Rails review
Rails reviewRails review
Rails review
 
Rails Engine :: modularize you app
Rails Engine :: modularize you appRails Engine :: modularize you app
Rails Engine :: modularize you app
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
Frameworks and webcomponents
Frameworks and webcomponentsFrameworks and webcomponents
Frameworks and webcomponents
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
SOA on Rails
SOA on RailsSOA on Rails
SOA on Rails
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScript
 
ASP.NET: Present and future
ASP.NET: Present and futureASP.NET: Present and future
ASP.NET: Present and future
 
Isomorphic JavaScript – future of the web
Isomorphic JavaScript – future of the webIsomorphic JavaScript – future of the web
Isomorphic JavaScript – future of the web
 
AEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly toolsAEM - A Collection of developer friendly tools
AEM - A Collection of developer friendly tools
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
 
Client Vs. Server Rendering
Client Vs. Server RenderingClient Vs. Server Rendering
Client Vs. Server Rendering
 

Viewers also liked

Building Real Time App
Building Real Time AppBuilding Real Time App
Building Real Time AppFutureworkz
 
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Justin Gordon
 
Writing Once: Multi-client code sharing in ReactJS
Writing Once: Multi-client code sharing in ReactJSWriting Once: Multi-client code sharing in ReactJS
Writing Once: Multi-client code sharing in ReactJSColin Vernon
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornSimon Bagreev
 
SQL vs NoSQL: 
проблема выбора
SQL vs NoSQL: 
проблема выбораSQL vs NoSQL: 
проблема выбора
SQL vs NoSQL: 
проблема выбораTKConf
 
how-to-disappear-from-the-web
how-to-disappear-from-the-webhow-to-disappear-from-the-web
how-to-disappear-from-the-webRussell Ford
 
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Justin Gordon
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012Justin Gordon
 
Workshop: Social Media for the Fashion & Textile Industries
Workshop: Social Media for the Fashion & Textile IndustriesWorkshop: Social Media for the Fashion & Textile Industries
Workshop: Social Media for the Fashion & Textile IndustriesJennifer Jones
 
Usabilidad - Productos que ame la gente
Usabilidad  - Productos que ame la gente  Usabilidad  - Productos que ame la gente
Usabilidad - Productos que ame la gente UX Nights
 
NBMBAA 2015 Outstanding MBA of the Year Award
NBMBAA 2015 Outstanding MBA of the Year AwardNBMBAA 2015 Outstanding MBA of the Year Award
NBMBAA 2015 Outstanding MBA of the Year AwardMarylyn Harris
 
market research and audience theory
market research and audience theorymarket research and audience theory
market research and audience theorysallymcmanus
 
Linkedin, Creating Your Professional Profile
Linkedin, Creating Your Professional ProfileLinkedin, Creating Your Professional Profile
Linkedin, Creating Your Professional Profilestouffer
 
Nova presentation 2014-03-11 4 new
Nova presentation   2014-03-11 4 newNova presentation   2014-03-11 4 new
Nova presentation 2014-03-11 4 newNova Interiors
 
Capturing the Elusive: Accounting for Study Attrition and Complex Trajectori...
Capturing the Elusive:  Accounting for Study Attrition and Complex Trajectori...Capturing the Elusive:  Accounting for Study Attrition and Complex Trajectori...
Capturing the Elusive: Accounting for Study Attrition and Complex Trajectori...Paul Brown
 
Accessibility of Twitter
Accessibility of TwitterAccessibility of Twitter
Accessibility of Twittercsunwebmaster
 
Revolución del neolítico
Revolución del neolíticoRevolución del neolítico
Revolución del neolíticojisset soto
 
Gradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugGradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugkyon mm
 

Viewers also liked (20)

Building Real Time App
Building Real Time AppBuilding Real Time App
Building Real Time App
 
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
 
Writing Once: Multi-client code sharing in ReactJS
Writing Once: Multi-client code sharing in ReactJSWriting Once: Multi-client code sharing in ReactJS
Writing Once: Multi-client code sharing in ReactJS
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and Unicorn
 
SQL vs NoSQL: 
проблема выбора
SQL vs NoSQL: 
проблема выбораSQL vs NoSQL: 
проблема выбора
SQL vs NoSQL: 
проблема выбора
 
how-to-disappear-from-the-web
how-to-disappear-from-the-webhow-to-disappear-from-the-web
how-to-disappear-from-the-web
 
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Visión
VisiónVisión
Visión
 
Workshop: Social Media for the Fashion & Textile Industries
Workshop: Social Media for the Fashion & Textile IndustriesWorkshop: Social Media for the Fashion & Textile Industries
Workshop: Social Media for the Fashion & Textile Industries
 
Usabilidad - Productos que ame la gente
Usabilidad  - Productos que ame la gente  Usabilidad  - Productos que ame la gente
Usabilidad - Productos que ame la gente
 
NBMBAA 2015 Outstanding MBA of the Year Award
NBMBAA 2015 Outstanding MBA of the Year AwardNBMBAA 2015 Outstanding MBA of the Year Award
NBMBAA 2015 Outstanding MBA of the Year Award
 
market research and audience theory
market research and audience theorymarket research and audience theory
market research and audience theory
 
Linkedin, Creating Your Professional Profile
Linkedin, Creating Your Professional ProfileLinkedin, Creating Your Professional Profile
Linkedin, Creating Your Professional Profile
 
Nova presentation 2014-03-11 4 new
Nova presentation   2014-03-11 4 newNova presentation   2014-03-11 4 new
Nova presentation 2014-03-11 4 new
 
Capturing the Elusive: Accounting for Study Attrition and Complex Trajectori...
Capturing the Elusive:  Accounting for Study Attrition and Complex Trajectori...Capturing the Elusive:  Accounting for Study Attrition and Complex Trajectori...
Capturing the Elusive: Accounting for Study Attrition and Complex Trajectori...
 
Accessibility of Twitter
Accessibility of TwitterAccessibility of Twitter
Accessibility of Twitter
 
Revolución del neolítico
Revolución del neolíticoRevolución del neolítico
Revolución del neolítico
 
Presentación sobre el futbol
Presentación sobre el futbolPresentación sobre el futbol
Presentación sobre el futbol
 
Gradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggugGradle 2.2, 2.3 news #jggug
Gradle 2.2, 2.3 news #jggug
 

Similar to React on rails v6.1 at LA Ruby, November 2016

Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Zach Lendon
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementZach Lendon
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHPTaylor Lovett
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Dimitri de Putte
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfSufalam Technologies
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!David Roberts
 
Rails request & middlewares
Rails request & middlewaresRails request & middlewares
Rails request & middlewaresSantosh Wadghule
 
An Overview of the React Ecosystem
An Overview of the React EcosystemAn Overview of the React Ecosystem
An Overview of the React EcosystemFITC
 
Front End Sadness to Happiness: The React on Rails Story
Front End Sadness to Happiness: The React on Rails StoryFront End Sadness to Happiness: The React on Rails Story
Front End Sadness to Happiness: The React on Rails StoryJustin Gordon
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & CucumberUdaya Kiran
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)scandiweb
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactChen-Tien Tsai
 
React with rails a perfect combination to build modern web application
React with rails a perfect combination to build modern web applicationReact with rails a perfect combination to build modern web application
React with rails a perfect combination to build modern web applicationKaty Slemon
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...MskDotNet Community
 

Similar to React on rails v6.1 at LA Ruby, November 2016 (20)

Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdf
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!
 
Rails request & middlewares
Rails request & middlewaresRails request & middlewares
Rails request & middlewares
 
An Overview of the React Ecosystem
An Overview of the React EcosystemAn Overview of the React Ecosystem
An Overview of the React Ecosystem
 
Front End Sadness to Happiness: The React on Rails Story
Front End Sadness to Happiness: The React on Rails StoryFront End Sadness to Happiness: The React on Rails Story
Front End Sadness to Happiness: The React on Rails Story
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
RoR (Ruby on Rails)
RoR (Ruby on Rails)RoR (Ruby on Rails)
RoR (Ruby on Rails)
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Scala and Lift
Scala and LiftScala and Lift
Scala and Lift
 
React with rails a perfect combination to build modern web application
React with rails a perfect combination to build modern web applicationReact with rails a perfect combination to build modern web application
React with rails a perfect combination to build modern web application
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

React on rails v6.1 at LA Ruby, November 2016

  • 1. React on Rails React + Redux + React-Router on Rails Views via Webpack/NPM including Server Rendering, v 6.1 github.com/shakacode/react_on_rails by Justin Gordon, justin@shakacode.com Presented at LA Ruby, November 10, 2016 1
  • 2. Who is Justin? • Palisades High, undergrad at Harvard, MBA from UC Berkeley • Lived in Boston, then San Francisco, then telecommuting from Maui! • Used to blog a lot at http://www.railsonmaui.com • Started hiring and renamed my company to ShakaCode! • We have our own app! https://www.friendsandguests.com 2
  • 3. Why add React to a Rails Project? 3
  • 4. Task: Build an Interactive Dashboard • Old “Rails Way”: CoffeeScript and jQuery • Client: madroneco.com • JavaScript Frameworks: • Ember.js • AngularJS • React.js 4
  • 5. Why React Inside a Rails App? • You need a rich client interface…You decide on React (smart) • Rails only as an API server? Or all Node.js tooling? • Nah! We ❤ Rails for both front and back-end development. In a large app, only some screens need a high fidelity JavaScript UX. • That’s the sweet spot: the ability to mix and match simple Rails screens with React where and when you need it, with ease! • Use a React navigation header with a Rails content area. 5
  • 6. Two videos =>Sold on React.js! 6 Pete Hunt: React: Rethinking best practices -- JSConf EU 2013 https://youtu.be/x7cQ3mrcKaY Mountain West JavaScript 2014 - Be Predictable, Not Correct. by Pete Hunt https://youtu.be/h3KksH8gfcQ
  • 7. How about the react-rails gem? • react-rails is based on the standard asset pipeline inclusion of assets • Benefits • Simpler for newbies and those used to doing this the Rails way. • Code organization is very much the Rails way, if you like that. (I’d rather run with the JavaScript herd for JavaScript!) 7
  • 8. Why not the react-rails gem? • The custom setup via the Rails asset pipeline is just not anything like the native tooling popular in the JavaScript community. • How do you integrate Redux and React-Router? • This is what led me to custom Webpack integration of Rails with React, and eventually React on Rails! • I just wanted to use an npm package called react-bootstrap, and there was no obvious way to do that with react-rails in 2014. • React-rails may support webpack someday; issues: #301 and #448. 8
  • 9. 9
  • 10. Ruby Gems vs NPM 10
  • 11. 11
  • 12. 12
  • 13. Why create the React on Rails Gem? • Server rendering? • React on Rails Doctrine • Omakase for JavaScript with Ruby on Rails! 13
  • 14. React on Rails • React + Redux + React-Router + Webpack + Babel Rock! • Both a Ruby Gem react_on_rails and a NPM Package react-on- rails! • Used by Friends and Guests, Pivotal Tracker, Blink Inc, and others, listed here. • 2167+ ⭐ as of November 10, 2016 14
  • 15. React on Rails • All files for the client side under /client • React: rendering • Webpack + Babel + NPM: packages files for the browser (for distribution via the Rails asset pipeline or a server for hot reloading assets) • Favorite Libraries: Redux + React-Router: Key major JS components to use with React, supported by React on Rails • Tooling: ESLint, Flow, CSS-Modules, etc.: Many other cutting edge JavaScript technologies enabled by doing things the JavaScript way, and not the Rails way! 15
  • 16. React on Rails Integration with Rails • Production and Tests: Webpack creates JavaScript and CSS assets that are used by the asset pipeline, like any other JS and CSS files. • Development: Can either use statically created JS and CSS files, or special view helpers can grab “hot-reloadable” versions of the JS and CSS from a Webpack Development Server. 16
  • 17. 17
  • 18. Adding React on Rails to a new Rails app 18 https://youtu.be/_bjScw60FBk
  • 19. Code Generated 19 • Demo App and change one line and restart (no hot reloading) • Show generated source in browser • Code walkthrough in RubyMine • Optional: show hot-reloading https://github.com/shakacode/react- webpack-rails-tutorial/
  • 20. Getting Started • Read The React on Rails Doctrine and React on Rails, 2000+ 🌟 Stars • Lots of great docs at github.com/shakacode/react_on_rails • Follow a simple tutorial • Study example apps: • Simple, no DB: test/demo app: github.com/shakacode/react_on_rails/tree/ master/spec/dummy • A more complex example at www.reactrails.com with code: https:// github.com/shakacode/react-webpack-rails-tutorial 20
  • 24. Want More Help? • ShakaCode can build your app, or augment your engineering team. We’re free to use techniques and code from our own app, www.friendsandguests.com. • ShakaCode offers consulting on React on Rails, from a modestly priced starter pack of usage help to full app development. We’re experts at Rails/ React/Redux/React-Router/Webpack JavaScript apps! • Check out forum.shakacode.com for discussions. We have a Slack room! • Follow @railsonmaui for updates on React on Rails. • Aloha from Justin, justin@shakacode.com, and the ShakaCode Team! 24
  • 26. Tips for Newbies • Do simplest things first • Initially skip: • Server Rendering • Hot Reloading • CSS Modules 26
  • 27. Hot Module Reloading in Rails • Statically created assets always used for production and tests. • Why HMR in development? No page refresh to see changes in JS and Sass code! • How? • ReactOnRails view helpers, env_javascript_include_tag and env_stylesheet_link_tag configure getting assets either from HMR server or regular static files. • Procfile.hot sets ENV value so Rails knows and starts HMR server for assets on port 3500, client/server-rails-hot.js • More details: Hot Reloading of Assets for Rails Development 27
  • 28. React on a Rails View via React On Rails • redux_store: Rails helper method, sets up a registered redux store, either in controller or on the view, usable by react components, initialized with props from Rails. If defined on the view and server rendering used, it must go before the react_component call. • react_component: Rails view helper to put a registered component on a Rails View. This component may talk to a registered redux store, or it may create a redux store, getting initialized by props from Rails. • ReactOnRails.register: JavaScript registration of stores and components (actually functions that generate them). 28
  • 29. Client Side Rendering • React on Rails installs a post-load JavaScript function (turbolinks compatible) that scans the HTML, using class matchers on hidden HTML elements, and does initialization, passing in props from rails that is placed in a HTML data attribute. 1. Initialize any Redux Stores, via controller helper or view helper with props from Rails. Note the use of <% and NOT <%= for the ERB call: <% redux_store("SharedReduxStore", props: @app_props_server_render %> 2. Render any react components, optionally with props from Rails. Note the use of <%= <%= react_component("HelloWorld", props: @app_props_server_render %>
 • You don’t need Redux for React on Rails! It’s an option. You also don’t need the redux_store API. You can initialize your redux stores with your components if you have a 1:1 mapping of a redux store to a component. You do this with a “generator function” which is a function that takes props and returns a Redux component attached to a store. 29
  • 30. Server Side Rendering • First, don’t try server rendering until client rendering is working without bugs! • Set option prerender: true in the call to react_component • React on Rails Server side rendering of React roughly does: 1. Sets up the JavaScript “context” with your server side webpack build 2. Create code to hydrate stores for the view 3. Create initialization code to server render react component, maybe passing props. 4. Execute this JavaScript on the Rails Server as part of the rendering process 5. Returns a HTML string placed on the Rails view 30
  • 31. Shared Redux Stores AppReduxStore Header React Component Body React Component Footer React Component • Many React components communicating with the same redux store • Supports server rendering and react-router 31
  • 32. Shared Redux Stores AppReduxStore Header React Component Body React Component Body Rails Partial • Allows a header React component to be paired with either a body react component or a body Rails partial. • Header React component can be dynamic! Notifications indicators! • Why use Rails views? Sometimes Rails is good enough! and WAY less code! Header React Component AppReduxStore 32
  • 33. react-router Integration • react-router is supported including server rendering. • If your server rendered router does a redirect, React on Rails handles this by doing a redirect on the client side. • More details are here. 33
  • 34. CSS Options 1. Standard Rails: Just use React on Rails for JavaScript and your regular Rails techniques for Sass, images, etc. Advantage: simple 2. Webpack Generated CSS: More complex, but not hard to setup with our examples. Advantages: 1. CSS Modules. This is huge. Once you try this, you won’t go back. What is it? Allows very simple CSS class names with small CSS files right next to your JavaScript. Here’s an example in the react-webpack-rails-tutorial. 2. Hot Reloading. You can change the your Sass files, save, and then you’ll see the browser update, without reloading. For configuration of hot reloading, see Hot Reloading of Assets For Rails Development. 34
  • 35. Performance • Turbolinks: Don’t reload the JavaScript and CSS, just the HTML • Fragment caching of Server Rendering: The fast way to generate the HTML is to have it cached! 35
  • 36. Running Tests • React on Rails provides a test helper to optimize building the static assets only when needed. • This is a huge convenience! • Be sure to setup config/initializers/react_on_rails.config • Configure rails_helper: RSpec.configure do |config|
 # Ensure that if we are running js tests, we are using latest webpack assets
 # This will use the defaults of :js and :server_rendering meta tags
 ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config) 36