This document introduces React on Rails, which allows using React, Redux, and React-Router within Ruby on Rails views. It discusses using Webpack and NPM to manage front-end assets, integrating React components with Rails, supporting features like hot reloading and server rendering, and sharing Redux stores between components. React on Rails provides helpers, configuration, and documentation to facilitate building JavaScript-rich UIs with Rails.
Marcin Grzywaczewski, co-author of successful "Rails meets React.js" and "React.js by Example" books describes React in a friendly way to all Rails developers who'd like to learn React, but can't find generic tutorials friendly enough.
In this presentation you'll learn React.js basics by comparing it to a typical Rails views stack - and recognize the problem React.js solves for you. There are also 'mental transition' stages of thinking about frontend explained.
Marcin Grzywaczewski, co-author of successful "Rails meets React.js" and "React.js by Example" books describes React in a friendly way to all Rails developers who'd like to learn React, but can't find generic tutorials friendly enough.
In this presentation you'll learn React.js basics by comparing it to a typical Rails views stack - and recognize the problem React.js solves for you. There are also 'mental transition' stages of thinking about frontend explained.
(DVO201) Scaling Your Web Applications with AWS Elastic BeanstalkAmazon Web Services
AWS Elastic Beanstalk provides an easy way for you to quickly deploy, manage, and scale applications in the AWS cloud. Through interactive demos and code samples, this session will teach you how to deploy your code to Elastic Beanstalk, provision and use additional AWS resources (for example, Amazon SNS, Amazon SQS, and Amazon DynamoDB), use your application’s health metrics to tune performance, scale your application to handle millions of requests, and perform zero-downtime deployments with traffic routing. Demos and code samples will be available to all session attendees.
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Amazon Web Services
Scaling your application as you grow should not mean slow to load and expensive to run. Learn how you can use different AWS building blocks such as Amazon ElastiCache and Amazon CloudFront to “cache everything possible” and increase the performance of your application by caching your frequently-accessed content. This means caching at different layers of the stack: from HTML pages to long-running database queries and search results, from static media content to application objects. And how can caching more actually cost less? Attend this session to find out!
In this session, we will discuss the difficulties of running Docker in production and how Amazon EC2 Container Service (ECS) can be used to reduce the operational burdens. We will give an overview of the core architectural principles underlying Amazon ECS, and we will walk through a number of patterns used by our customers to run their microservices platforms and batch applications.
Save 90% on Your Containerized Workloads - August 2017 AWS Online Tech TalksAmazon Web Services
Learning Objectives:
- Learn how to run containers on a managed cluster of Amazon EC2 instances
- Learn how to then use EC2 Spot with your containers to significantly reduce the cost of running your applications, or grow your application's compute capacity and throughput for the same budget
- Understand the use cases best suited for running containerized workloads on EC2 Spot
Containers lend themselves to flexible and portable application deployments, and when used with the Amazon EC2 Container Service (or other schedulers), provide a simple and effective way to manage fleets of instances and containers at scale. Amazon EC2 Spot instances allow you to utilize spare Amazon EC2 computing capacity for a fraction of the cost. This webinar will help architects, engineers and developers understand when and how to run your containerized environment on EC2 Spot instances, saving up to 90% over On-Demand EC2.
PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...Amazon Web Services
Come learn how Elastic Beanstalk can help you go from code to running application in a matter of minutes, without the need to provision or manage any of the underlying Amazon Web Services (AWS) resources. Hear how Qualcomm is able to migrate application to AWS faster than before through Forge, an internally built application platform that leverages Elastic Beanstalk to simplify the development and deployment of applications to AWS with security and organizational best practices out of the box.
by Harrell Stiles, Sr. Consultant, AWS ProServe
AWS Lambda and Amazon API Gateway have changed how developers build and run their applications or services. But what are the best practices for tasks such as deployment, monitoring, and debugging in a serverless world? In this session, we’ll dive into best practices that serverless developers can use for application lifecycle management, CI/CD, monitoring, and diagnostics. We’ll talk about how you can build CI/CD pipelines that automatically build, test, and deploy your serverless applications using AWS CodePipeline, AWS CodeBuild, and AWS CloudFormation. We’ll also cover the built-in capabilities of Lambda and API Gateway for creating multiple versions, stages, and environments of your functions and APIs. Finally, we’ll cover monitoring and diagnostics of your Lambda functions with Amazon CloudWatch and AWS X-Ray.
(APP402) Serving Billions of Web Requests Each Day with Elastic Beanstalk | A...Amazon Web Services
AWS Elastic Beanstalk provides a number of simple and flexible interfaces for developing and deploying your applications. Follow Thinknear's rapid growth from inception to acquisition, scaling from a few dozen requests per hour to billions of requests served each day with AWS Elastic Beanstalk. Thinknear engineers demonstrate how they extended the AWS Elastic Beanstalk platform to scale to billions of requests while meeting response times below 100 ms, discuss tradeoffs they made in the process, and what did and did not work for their mobile ad bidding business.
Building faster websites: web performance with WordPressJohannes Siipola
Nobody likes a slow website. Faster sites lead to happier users, and happier users lead to more conversions and revenue. That’s why you should take performance into account in your WordPress project. Learn what practical techniques and WordPress plugins to use in order to optimize your site for speed.
(DVO201) Scaling Your Web Applications with AWS Elastic BeanstalkAmazon Web Services
AWS Elastic Beanstalk provides an easy way for you to quickly deploy, manage, and scale applications in the AWS cloud. Through interactive demos and code samples, this session will teach you how to deploy your code to Elastic Beanstalk, provision and use additional AWS resources (for example, Amazon SNS, Amazon SQS, and Amazon DynamoDB), use your application’s health metrics to tune performance, scale your application to handle millions of requests, and perform zero-downtime deployments with traffic routing. Demos and code samples will be available to all session attendees.
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Amazon Web Services
Scaling your application as you grow should not mean slow to load and expensive to run. Learn how you can use different AWS building blocks such as Amazon ElastiCache and Amazon CloudFront to “cache everything possible” and increase the performance of your application by caching your frequently-accessed content. This means caching at different layers of the stack: from HTML pages to long-running database queries and search results, from static media content to application objects. And how can caching more actually cost less? Attend this session to find out!
In this session, we will discuss the difficulties of running Docker in production and how Amazon EC2 Container Service (ECS) can be used to reduce the operational burdens. We will give an overview of the core architectural principles underlying Amazon ECS, and we will walk through a number of patterns used by our customers to run their microservices platforms and batch applications.
Save 90% on Your Containerized Workloads - August 2017 AWS Online Tech TalksAmazon Web Services
Learning Objectives:
- Learn how to run containers on a managed cluster of Amazon EC2 instances
- Learn how to then use EC2 Spot with your containers to significantly reduce the cost of running your applications, or grow your application's compute capacity and throughput for the same budget
- Understand the use cases best suited for running containerized workloads on EC2 Spot
Containers lend themselves to flexible and portable application deployments, and when used with the Amazon EC2 Container Service (or other schedulers), provide a simple and effective way to manage fleets of instances and containers at scale. Amazon EC2 Spot instances allow you to utilize spare Amazon EC2 computing capacity for a fraction of the cost. This webinar will help architects, engineers and developers understand when and how to run your containerized environment on EC2 Spot instances, saving up to 90% over On-Demand EC2.
PaaS – From Code to Running Application using AWS Elastic Beanstalk (DEV323) ...Amazon Web Services
Come learn how Elastic Beanstalk can help you go from code to running application in a matter of minutes, without the need to provision or manage any of the underlying Amazon Web Services (AWS) resources. Hear how Qualcomm is able to migrate application to AWS faster than before through Forge, an internally built application platform that leverages Elastic Beanstalk to simplify the development and deployment of applications to AWS with security and organizational best practices out of the box.
by Harrell Stiles, Sr. Consultant, AWS ProServe
AWS Lambda and Amazon API Gateway have changed how developers build and run their applications or services. But what are the best practices for tasks such as deployment, monitoring, and debugging in a serverless world? In this session, we’ll dive into best practices that serverless developers can use for application lifecycle management, CI/CD, monitoring, and diagnostics. We’ll talk about how you can build CI/CD pipelines that automatically build, test, and deploy your serverless applications using AWS CodePipeline, AWS CodeBuild, and AWS CloudFormation. We’ll also cover the built-in capabilities of Lambda and API Gateway for creating multiple versions, stages, and environments of your functions and APIs. Finally, we’ll cover monitoring and diagnostics of your Lambda functions with Amazon CloudWatch and AWS X-Ray.
(APP402) Serving Billions of Web Requests Each Day with Elastic Beanstalk | A...Amazon Web Services
AWS Elastic Beanstalk provides a number of simple and flexible interfaces for developing and deploying your applications. Follow Thinknear's rapid growth from inception to acquisition, scaling from a few dozen requests per hour to billions of requests served each day with AWS Elastic Beanstalk. Thinknear engineers demonstrate how they extended the AWS Elastic Beanstalk platform to scale to billions of requests while meeting response times below 100 ms, discuss tradeoffs they made in the process, and what did and did not work for their mobile ad bidding business.
Building faster websites: web performance with WordPressJohannes Siipola
Nobody likes a slow website. Faster sites lead to happier users, and happier users lead to more conversions and revenue. That’s why you should take performance into account in your WordPress project. Learn what practical techniques and WordPress plugins to use in order to optimize your site for speed.
Slides with notes from Ruby Conf 2014 on using simple techniques to create sl...Justin Gordon
Slides with notes from Ruby Conf 2014 on using simple techniques to create slimer, clearer models, controllers, and views in Ruby on Rails. Looks better at http://www.slideshare.net/justingordon/rails-conf-2014concernsdecoratorspresentersserviceobjectshelpershelpmedecideapril222014
blog: http://www.railsonmaui.com
Code samples: https://github.com/justin808/fat-code-refactoring-techniques
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Justin Gordon
Slides Ruby Conf 2014 on using simple techniques to create slimer, clearer models, controllers, and views in Ruby on Rails.
blog: http://www.railsonmaui.com
Code samples: https://github.com/justin808/fat-code-refactoring-techniques
xUnit and TDD: Why and How in Enterprise Software, August 2012Justin Gordon
“A comprehensive suite of JUnit tests is one of the most import aspects of a software project because it reduces bugs, facilitates adding new developers, and enables refactoring and performance tuning with confidence. Test-driven development (TDD) is the best way to build a suite of tests. And the Dependent Object Framework is the best way to test against database objects.” This presentation covers the benefits of TDD along with practical advice on how to implement TDD in complex projects.
An Overview of the React Ecosystem
with Rami Sayar
OVERVIEW
React has been named the front-end library to learn in 2016 however few people talk about the React without mentioning Flux (or Redux or React Native or Relay). In this talk, we will explore the ecosystem of tools and libraries that surround React. We will look at the various Flux implementations (including a short explanation of Flux) like Redux, at some of the React routing libraries, at some of the reactive database or reactive API libraries and finally at everyday tools and techniques that make the React developer happy. By the end of this talk, you will have a greater grasp of the ecosystem and leave with new tools in your developer arsenal.
OBJECTIVE
Learn about the React Ecosystem
TARGET AUDIENCE
Front-End Developers with knowledge of JavaScript, React Beginners
ASSUMED AUDIENCE KNOWLEDGE
JavaScript, Front-End Dev, Beginner React
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
What is Flux?
What is Redux
What is React Native
What is Relay (and other Reactive Databases/APIs)
Useful React Dev Tools
Learn how to easily install Webpack in Reactjs with this comprehensive step-by-step guide. Make sure your Reactjs app is optimized with Webpack for maximum performance!
An Intense Overview of the React EcosystemRami Sayar
React has been named the front-end library to learn in 2016 however few people talk about the React without mentioning Flux (or Redux or React Native or Relay). In this talk, we will explore the ecosystem of tools and libraries that surround React. We will look at the various Flux implementations (including a short explanation of Flux) like Redux, at react-router, at some of the reactive database or reactive API libraries and finally at everyday tools and techniques that make the React developer happy. By the end of this talk, you will have a greater grasp of the ecosystem and leave with new tools in your developer arsenal.
React has been named the front-end library to learn in 2016! React Native has also picked up tremendous steam as a way to build cross-platform apps with React. In this talk, Rami will do a quick 5 minute introduction to React's core concepts. Following, Rami will introduce React Native, discuss the differences between React & React Native, and show you how to build a simple Android application. By the end of this talk, you will have a greater grasp of the ecosystem and leave with new tools in your developer arsenal.
Why you should add React to your Rails application now!David Roberts
React is a javascript library for building user interfaces which has many great features going for it. It also happens to be easy to introduce in small increments, particularly when compared to other javascript frameworks, and plays well with Rails. Find out how you can start modernizing the javascript in your Rails application today, without major refactoring.
http://www.learntek.org/product/react-js-training/
http://www.learntek.org
Learntek is global online training provider on Big Data Analytics, Hadoop, Machine Learning, Deep Learning, IOT, AI, Cloud Technology, DEVOPS, Digital Marketing and other IT and Management courses. We are dedicated to designing, developing and implementing training programs for students, corporate employees and business professional.
I prepared this presentation to introduce Ruby on Rails to
a group of students at Università di Catania.
It is not enough to get a good grasp of Rails, the
presentation in fact was supported by live coding, where
I started created a Phrasalbook (no more blog engine
please :) )
Backbonification for dummies - Arrrrug 10/1/2012Dimitri de Putte
This presentation was given on the Arrrrug meeting as a first introduction to backbone.js in combination with rails after playing a couple of weeks with backbone.js.
Note: It is really on introduction level, in the meantime, my level of backbone.js and coffeescript have increased.
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...MskDotNet Community
Поговорим об эволюции в мире вэб-приложений, современных технологиях и фреймворках, которые используют в вэб-разработке сегодня.
Обсудим основные архитектурные принципы при создании вэб-решений для разных клиентов. Обсудим, как сделать и запустить бэк-энд на Asp.NET.Core в Visual Studio 2017. Далее поговорим, как написать и запустить фронт-энд с использованием React.JS, Redux, Routing, Bootstrap в IntelliJ IDEA 2017.
В конце доклада немного заглянем в будущее, что нас ждет в вэб-разработке завтра?
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
React on rails v4
1. React on Rails
React + Redux + React-Router on Rails Views via Webpack/NPM
including Server Rendering
github.com/shakacode/react_on_rails
1
2. Why?
• React + Redux + React-Router + Webpack + Babel Rock!
• Ruby on Rails Rocks!
• Let’s put them together!
• Both a Ruby Gem react_on_rails and a NPM Package react-on-rails!
• Used by Pivotal Tracker, Blink Inc, and others, listed here.
• 1200 ⭐ as of March 18, 2016
2
3. 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!
3
4. 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!)
4
5. 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 react-bootstrap, and there was
no obvious way to do that with react-rails in 2014.
5
6. React on Rails: Key Parts
• All files for the client side under /client
• Webpack + Babel + NPM: packages files for the browser (for
distribution via the Rails asset pipeline or a server for hot reloading
assets)
• Redux + React-Router: Key major JS components to use with React,
supported by React on Rails
• ESLint, JSCS, Flow, CSS-Modules, etc.: Many other cutting edge
JavaScript technologies enabled by doing things the JavaScript way,
and not the Rails way!
6
7. 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.
7
8. 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
8
9. 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).
9
10. 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.
10
11. 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
11
12. 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
12
13. 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
13
14. 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.
14
15. 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.
15
16. 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!
16
17. 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)
17
18. Getting Started
• Read The React on Rails Doctrine
• 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
18
19. Want Personalized Help?
• ShakaCode offers consulting on React on Rails, from a modestly priced
starter pack of usage help ($1500) to full app development. We’re experts
at Rails/React/Redux/React-Router/Webpack JavaScript apps!
• Check out forum.shakacode.com for code discussions.
• Ask Justin for a Slack invite.
• Get in touch with Justin: justin@shakacode.com.
• Follow @railsonmaui for updates on React on Rails.
• Aloha from Justin and the ShakaCode Team!
19