SlideShare a Scribd company logo
Building Universal Web
Apps with React
Elyse Kolker Gordon
Twitter: @sfdrummerjs, Github: @elyseko
Web Lead, Vevo
Code: bit.ly/universal-app-react
Get it 40% off!
bit.ly/isomorphicdevjs
Code: ctwforwjs17
Win a free ebook:
http://bit.ly/2m0pCiP
Universal or
Isomorphic?
Write code once, run it in two environments (node & browser).

Recommended for you

React js
React jsReact js
React js

ReactJS for Beginners provides an overview of ReactJS including what it is, advantages, disadvantages, typical setup tools, and examples of basic React code. Key points covered include: - ReactJS is a JavaScript library for building user interfaces and is component-based. - Advantages include high efficiency, easier JavaScript via JSX, good developer tools and SEO, and easy testing. - Disadvantages include React only handling the view layer and requiring other libraries for full MVC functionality. - Examples demonstrate basic components, properties, events, conditional rendering, and lists in ReactJS.

reduxreact nativereactjs
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js

Andy Wood - enjoy the Vue.js Slides from the TechExeter Conference, 8th October 2016. www.techexeter.uk

techexeterfrontendjavascript
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html

What are Web Components and why should we use them, Pros and Cons. What is lit-html and how it helps us develop lightweight JavaScript Apps.

web componentslit-htmlweb
Overview of Universal/Isomorphic Web Apps
Why would you want to build an universal web app
Universal App Architecture
Challenges and Tradeoffs
Topics:
Overview: What is a
Universal App?
Server-side rendered applications
Overview
Server-side rendered applications
Overview

Recommended for you

AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions

AngularJS is a popular JavaScript framework. It is intended to make the implementation of RIA (Rich Internet Applications) easier and convenient. AngularJS is created and maintained by Google. It is relatively, a new JavaScript framework, which is designed to make the front-end development as simple as possible. AngularJS is a useful tool for standardizing the web application structure and it provides a future template to ensure that the client-side applications are developed much effectively. This document by RapidValue is written by Gourav Ajmani, Technical Lead, who has been working on AngularJS for a while, and has read many tutorials and blogs on it. According to Gourav, he could never find any article which gives a clear, concise and step-by-step guide to create the project structure and execute the project. So, he has written this document which will help you to create the Project structure and then execute it in a simple manner.

yeoman generatorjavascript framework yeoman toolsetyeoman install
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer

Entering the multi-screen era means rethinking how we build our applications. Producing a few PSDs doesn't cut it anymore, we have to start seeing the things we design as components within larger systems. Join us to learn how to use Polymer to revolutionize your design process. With these new tools we can create the UIs of the future, and shorten the time between concept and reality.

polymerhtmlhtml5
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)

This document discusses web components and Polymer 1.0. It begins with an introduction to web components and the different specifications that make them possible, including custom elements, HTML imports, shadow DOM, and templates. It then demonstrates how web components can be used to build reusable custom elements and templates for activities. Styles are kept encapsulated using shadow DOM. The document concludes by noting browser support for web components.

polymerweb componentsmaterial design
Server-side rendered applications
Overview
Server-side rendered applications
Overview
Server-side rendered applications
Overview
Server-side rendered applications
Overview

Recommended for you

Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications

It’s trivial today to start writing and debugging some React code, but it’s not 100% clear how to properly deploy the application, manage versions and what implications that has on the build configurations. Especially if you want to allow different versions for different users in order to perform some A/B testing, testing new features in production environment, come up with some UI experiments, or gradually roll out new features for a subset of users. In this presentation I hopefully covered all that.

The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components

On Github: http://andrewrota.github.io/complementarity-of-react-and-web-components-presentation/index.html The component driven, performance focused approach of React is a perfect complement to the modularity and portability of native HTML Web Components. At first glance, React and Web Components might seem like two radically different solutions to the same problem. But when combined properly they complement each other to create an extremely powerful, expressive framework for developing complex web applications.

reactreact.jsshadow dom
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK

The document provides an introduction to developing applications for Palm's webOS using the Mojo SDK. It discusses that the Mojo SDK is a JavaScript framework that uses standard web technologies and allows creating webOS applications using HTML, CSS, and JavaScript. It also describes some key aspects of developing Mojo applications, such as creating scenes, linking between scenes, using data storage with Depot and cookies, and working with common UI widgets.

mobilexwebosmxlex
Single Page Application (SPA)
Overview
Single Page Application (SPA)
Overview
Single Page Application (SPA)
Overview
Single Page Application (SPA)
Overview

Recommended for you

How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!

1. The document discusses integrating Webpack into a Django project to bundle static files. 2. It provides an example Django application and shows how to set up basic Webpack configuration to bundle Vue.js and other static files. 3. Additional Webpack features like hot reloading and code splitting are demonstrated to improve the development and production workflows.

djangowebpackjavascript
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data

A few months after I started working with Ember.js & Ember Data at my new job we began a project to upgrade both. There were parts that were a breeze and others that were quite tricky. This talk walks you through some of the challenges we faced and how we solved them as well as how we began to prepare for the Ember 2.x architectural shift. Hopefully this talk will help save you some time when you decide to upgrade your Ember web application.

ember dataember.jsember
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)

The document discusses using Python to build single-page applications (SPAs). It introduces SPAs and how they work by loading a single HTML page and dynamically updating content via JavaScript. The speaker then outlines a Python-based SPA architecture using a Django REST API and frontend code. As an example, a movie application is presented that separates the API from the AngularJS frontend. The API uses the Django REST framework and is tested programmatically.

pythondjangojavascript
Single Page Application (SPA)
Overview
Why not both?
Overview
Overview
Overview

Recommended for you

Vue business first
Vue business firstVue business first
Vue business first

Vue is JavaScript framework for building component based UI. Why it became popular and what makes Vue business-first.

vuevue.jssoftware development
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components

This document introduces the Vaadin framework, which is a user interface framework for building rich web applications. It discusses how Vaadin enables developer productivity through features like user interface components, automated communication between the client and server, and support for multiple devices. The document also covers trends in web frameworks like AngularJS and web components, and how Vaadin is exploring these trends through new components in Vaadin Labs and building web components with GWT.

vaadinweb componentsangularjs
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js

Have you ever starting working on a large, existing web application and jQuery spaghetti-code is all over the place? Your mind swirls as you try to figure out what code belongs to what component on what page. There are no JavaScript unit tests and you're terrified of making a change and breaking everything? I'm going to talk through the real life story of how Backbone.js helped to bring organization/structure, modularity, and testability to a large multi-page web application.

backbone.jsjasminebrowserify
Overview
Overview
Overview
Overview

Recommended for you

Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer

This document discusses using Polymer to build web component-based applications. It begins by explaining what web components are and how browsers support them through standards like custom elements, HTML imports and templates. It then introduces Polymer as a library that helps build web components and provides ready-made reusable components. The document outlines how to build full-stack apps with Polymer, including using Spring Boot on the backend to provide features like authentication. It also covers tools like Vulcanize, Crisper and build optimizations to improve performance of Polymer apps.

polymerhtml5spring boot
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015

Web Components are touted as the future of front-end web development. In this talk you’ll learn what Web Components are, how to use them and the state of native support in web browsers. Finally I’ll demonstrate what your options are for building componentized web apps right now using AngularJS, Ember, Knockout, React, Polymer etc. And why Web Components probably are the future of front-end web development.

software engineeringweb developmentemberjs
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome

This document provides an overview of React, including initial reactions to it, fundamental concepts like components and one-way data flow, and how the virtual DOM works. Some key points covered include: - Initial reactions to React were mixed, with some finding it "ugly" but others seeing benefits like separation of concerns with components. - Everything in React is a component, with data flowing in one direction from parent to child via props. State is mutable within a component. - By using a virtual DOM, React can efficiently update the real DOM by only making necessary changes, keeping the interface fast and pure.

Overview
Overview
Why build it?
#1 SEO
Getting your website (or cat video) to
rank the highest can make or break
your success as a business.
Why build it?

Recommended for you

Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2

Szybki start z React. Prezentacja przedstawiona na warsztatach z podstaw technologii React w ramach DreamLab Academy. W razie pytań zapraszamy do kontaktu academy@dreamlab.pl

reactdreamlabdreamlabacademy
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers

I've been working a lot with React lately and thought it would be a good idea to share what I've learned with the group. During this talk we'll take a look at Facebook's React library while drawing comparisons to frameworks like Angular. We'll see how we can use React and friends to create a fast and efficient single page app. Attendees are expected to have some familiarity with ES6/ES7 since we the codebase we will be looking at leverages features from the spec. What we'll be taking a look at: • React • React Router • Redux • Redux Sagas • Webpack • Babel

reduxes6es7
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?

The number of web development frameworks and libraries based on JavaScript continue increasing. The most popular client-side technologies are Angular and React, but you might ask - What should I use?

frameworklibraryangular.js
#2 Perceived
Performance
Users should think the site is fast. This
means showing content (not loading
spinners) as soon as possible.
Why build it?
Everything is JavaScript! Most of your
code will run on both the server and
the browser.
#3 Maintenance and Developer
benefits
Why build it?
Universal App
Architecture
In this section
Technologies required to build an
universal app
Loading a single page of the app in
the isomorphic flow
Architecture
Code: bit.ly/universal-app-react

Recommended for you

React js
React jsReact js
React js

This document introduces React, describing it as a JavaScript library for building user interfaces by rendering components rather than mutating the DOM directly. It discusses how React uses a virtual DOM for fast re-rendering, building components instead of templates, and the use of JSX syntax to write HTML-like code. Components have state and props, and the whole app re-renders when state changes to guarantee updates.

Compare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End StackCompare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End Stack

This presentation should help you to understand the front end stack and make the right placement for different JS Libraries in the stack. This will give you the baseline boundaries between different JS libraries and help you to do an apple to apple comparison.

emberlibrariesangular js
Java script framework-roller-coaster
Java script framework-roller-coasterJava script framework-roller-coaster
Java script framework-roller-coaster

A look at the wild world of JavaScript frameworks. In this talk Ember, Angular and React with insights from professional developers.

javascriptsoftware development
In this section
Technologies required to build an
universal app
Loading a single page of the app in
the isomorphic flow
Architecture
Code: bit.ly/universal-app-react
In this section
Technologies required to build an
universal app
Loading a single page of the app in
the isomorphic flow
Architecture
Code: bit.ly/universal-app-react
Architecture
Architecture

Recommended for you

Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts

The important parts of the front end development sphere including CSS3, advanced JavaScript, libraries such as jQuery, RequireJS and Promises. And finally, chrome developer tools for successful debugging and editing.

csscss3javascript
微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)

Weibo Lamp performance improvement

php5.4yafyar
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...

The mobility sector was mainly dominated by native technologies (Android and iOS applications) until the rise of HTML5. For a web developer to build mobile applications can be challenging with variety of platforms to choose from and technologies to learn. HTML is known to be an easy to learn and fast to implement technology, and has the maximum number of web applications to its credit. However, when HTML5 was released by the World Wide Web consortium, it came along with an added advantage in the mobility domain i.e. cross-platform capability with a single code base. The native technologies demand a higher cost to market, since they consist of SDKs and IDEs, and require a higher learning curve for each device platform. HTML is a well-known technology to most of the in-house developers and the enterprises can start entering the mobility sector right away. HTML5 technology though gaining momentum quickly is still not quite ready to be used for complex web applications, particularly line-of-business applications. Many frameworks built on HTML and JavaScript are available to enable easier development. However, the web/desktop applications differ from the mobile applications. The device capabilities and usability are a major factor while developing a mobile application. The common questions which most of the enterprises have in mind, before building mobile applications are which technology framework to choose to build their first mobile app and what factors to consider in making the right choice. This paper provides a guide for developers and solution architects to understand the different software architecture patterns, HTML5 frameworks available to build mobile apps, pros and cons of these application development frameworks and elements to consider for selecting the right framework, while making a decision to build mobile web apps.

html5 frameworkssencha touchbackbone
Node + Express
Architecture
Webpack
Architecture
Why webpack?
NPM packages
ES6/ES7 with babel
CSS in your browser bundle
Advanced features
Architecture: webpack
Architecture: webpack

Recommended for you

Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners

- React is a JavaScript library for building user interfaces that uses a virtual DOM for faster re-rendering on state changes. - Everything in React is a component that can have states, props, and lifecycle methods like render(). Components return JSX elements. - Props are used for passing data to components in a unidirectional flow, while states allow components to re-render on changes. - The render() method returns the view, accessing props and state values. Forms and events also follow React conventions.

facebooklibraryjavascript
Mongodb workshop
Mongodb workshopMongodb workshop
Mongodb workshop

This document discusses MongoDB replication and sharding. It begins with an introduction to MongoDB and its data model. It then covers replication with master-slave and replica sets. It also discusses sharding components including shard servers, config servers, and mongos routers. It provides examples of setting up replica sets, adding shards, and combining replica sets with sharding. The document encourages trying these techniques yourself and sharing experiences.

mongodbreplicationsharding
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison

This document summarizes and compares four popular JavaScript frameworks: Backbone.js, AngularJS, Ember.js, and Knockout.js. It covers key areas like how easy it is to get started with a "Hello World" example, dependencies, data binding capabilities, routing support, how views are defined, testing support, data handling, documentation/community support, and third party integration capabilities.

Architecture: webpack
Code
Architecture: webpack
Code Parser
Architecture: webpack
Code Parser Transforms
Architecture: webpack
Code Parser Transforms
Compiled
App Code

Recommended for you

MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...

Sharding allows you to distribute load across multiple servers and keep your data balanced across those servers. This session will review MongoDB’s sharding support, including an architectural overview, design principles, and automation.

capitalizacion
capitalizacioncapitalizacion
capitalizacion

El documento habla sobre los tipos de capitalización, incluyendo la capitalización simple, donde los intereses se calculan sobre el monto inicial, y la capitalización compuesta, donde los intereses obtenidos al final de cada periodo se añaden al capital principal. También menciona que la capitalización consiste en invertir o prestar un capital para obtener intereses durante el tiempo que dura la inversión o préstamo, y que la tasa efectiva toma en cuenta la acumulación de intereses a lo largo del periodo de la tasa nominal correspondiente.

gustavo perezcapitalizacionpsmingeco
Read aloudwhitepaper
Read aloudwhitepaperRead aloudwhitepaper
Read aloudwhitepaper

The document discusses a reading program called SAS Read Aloud that aims to enhance shared reading experiences for early readers. It provides an interactive tool with over 50 story titles that are pre-recorded so children can listen along. The program incorporates research-based design elements like reading modes, leveled content, and word highlighting. Shared reading is highlighted as an important practice for developing early reading skills, but the quality and frequency of shared reading experiences can be improved. SAS Read Aloud aims to supplement shared reading time and optimize children's learning through its interactive features.

reading
Architecture: wepack
"scripts": {

"build:browser": "webpack",

"prestart": "npm run build:browser",

"start": "node src/server.js"

}
package.json
module.exports = {

entry: "./src/main.jsx",

devtool: "source-map",

output: {

path: __dirname + '/
src/',

filename: "browser.js"

},
Architecture: webpack
webpack.config.js
module.exports = {

...
Architecture: webpack
module: {

loaders: [

{

test: /.(jsx|es6)$/,

exclude: /node_modules|examples/,

loader: "babel-loader"

},

{

test: /.css$/,

loaders: ['style', 'css']

}

]
webpack.config.js
React
Architecture

Recommended for you

MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster

This document provides instructions for setting up MongoDB sharding across multiple servers. It describes installing MongoDB on router, config, and shard servers. The config servers store metadata about the cluster, router servers route queries to shards, and data is partitioned across multiple shard servers. The steps shown add a shard to the cluster, check the cluster status, test by sharding a sample database and collection with an indexed key, and suggest adding more shards and data to validate the setup.

shardingmongodb
Biosfera ict
Biosfera ictBiosfera ict
Biosfera ict

La biósfera es el sistema que abarca a todos los seres vivientes de la Tierra y su hábitat, donde se desarrolla su ciclo vital en el aire, agua y suelo. Está compuesta de biomasa, materia biogénica y materiales minerales. Su estructura incluye la atmósfera de gases como oxígeno y dióxido de carbono, la geósfera de rocas y suelos, y la hidrósfera de agua.

Wikispaces
WikispacesWikispaces
Wikispaces

El documento proporciona instrucciones para crear una wiki en la plataforma Wikispaces. Indica que los usuarios deben registrarse en el sitio web con su nombre, correo electrónico y contraseña, darle un nombre a su wiki, y luego pueden personalizarla agregando una foto de perfil y configurando opciones en la sección de ajustes. Una vez creada, los usuarios pueden administrar y editar su wiki agregando páginas, imágenes, y videos.

informártica
Virtual DOM
Architecture: React
Virtual DOM
Architecture: React
Virtual DOM
Architecture: React
Virtual DOM
Architecture: React

Recommended for you

Apresentação1
Apresentação1Apresentação1
Apresentação1

Trabalho Atividade Lúdica

Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...

A workshop to introduce Universal JavaScript with React (interactive version at http://loige.link/uni-js-workshop )

reactreact-routeruniversal
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs

Introducción a las librerías ReactJS y ReduxJS. Exploramos las APIs de cada librería y el uso de ambos módulos con sus mejores prácticas.

reactreactjsredux
Architecture: React
import ReactDOM from 'react-dom';

ReactDOM.render(
<RootComponent {...props} />,
document.getElementById(‘react-
content’)
);
Architecture: React
import { renderToString } from 'react-dom/
server';

renderToString(<RootComponent {...props} />);
React Router
Architecture
Architecture: React Router

Recommended for you

React outbox
React outboxReact outbox
React outbox

React is a JavaScript library for building user interfaces and single-page applications. It allows developers to create reusable UI components called elements that can be rendered to the DOM. Components can contain state that updates the UI and respond to user events. The key concepts in React include JSX for building UI elements, components, props for passing data between components, and state for dynamic data. Setting up a React project involves installing dependencies like React, ReactDOM, and Babel to transpile JSX and enable component-based development.

reactjsprogrammingweb development
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...

This document outlines a presentation about building universal JavaScript web applications with React. It discusses: 1. The term "universal" in relation to JavaScript and some advantages it provides like maintainability and faster load times. 2. Building a frontend single page application with React and then making it universal by rendering on the server as well with React and Express. 3. Key aspects of universal apps like module sharing, routing, data retrieval and state management that work across client and server. 4. An example of building a universal JavaScript app with React called "Judo Heroes" that shows athlete data and profiles, using components, routing, data and building tools like Babel and Webpack.

romeuniversalconference
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...

Since we started to see JS on the server side, the dream of developers has been to reduce the gap and the cost of switch between frontend/backend. Today with Node.js, React and a whole ecosystem of tools, this dream is becoming true! In this talk I am going to discuss about Universal (a.k.a. Isomorphic) JS and present some practical example regarding the major patterns related to routing, data retrieval and rendering. I will use Node, React, Webpack, Babel and React Router and give you a series of example to get you started easily with this new technology trend.

codemotion rome 2017
Architecture: React Router
ReactDOM.render(

<Router routes={sharedRoutes(store)}
history={browserHistory} />,

document.getElementById('react-content')

);
Architecture: React RouterrenderView.jsx
import React from 'react';

import { match, RouterContext } from 'react-router';

import { routes } from '../shared/sharedRoutes';



export default function renderView(req, res, next) {

}

Architecture: React RouterrenderView.jsx
import React from 'react';

import { match, RouterContext } from 'react-router';

import { routes } from '../shared/sharedRoutes';



export default function renderView(req, res, next) {

}

Architecture: React Router
match(matchOpts, handleMatchResult);
renderView.jsx

Recommended for you

Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup

Presentations includes following topics :- Introduction of ReactJS. Component workflow. State management and useful life-cycles. React hooks. Server Side Rendering.

reactreactjsredux
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack

Webpack tutorial with tips for Symfony users. Topics covered include: current frontend trends, setup, loaders, dev tools, optimization in production, bundle splitting and tips and tricks for using webpack with existing projects. Symfony Munich Meetup 2016.

webpackfrontendsymfony
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony

This document discusses server-side rendering (SSR) of React components with Symfony. It begins with an overview of the problems SSR addresses like slow page loads. It then covers key React concepts like components, state, and rendering. Finally, it discusses integrating React and Symfony through tools like React on Rails, React Router for routing, and extracting meta tags from components. It also briefly mentions using an external JavaScript server to render components on the server-side.

reactreactjsphp
import React from 'react';

import { match, RouterContext } from 'react-router';

import { routes } from '../shared/sharedRoutes';



export default function renderView(req, res, next) {

const matchOpts = {

routes: routes(),

location: req.url

};





}

Architecture: React Router
match(matchOpts, handleMatchResult);
renderView.jsx
match(matchOpts, handleMatchResult);
import React from 'react';

import { match, RouterContext } from 'react-router';

import { routes } from '../shared/sharedRoutes';



export default function renderView(req, res, next) {

const matchOpts = {

routes: routes(),

location: req.url

};





}

Architecture: React Router
const handleMatchResult = (error, redirectLocation, renderProps) =>
{

if (!error && !redirectLocation && renderProps) {
// render code
}
}
match(matchOpts, handleMatchResult);
renderView.jsx
match(matchOpts, handleMatchResult);
const matchOpts = {

routes: routes(),

location: req.url

};

Redux
Architecture
Architecture: Redux

Recommended for you

React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban

This document provides an overview and comparison of different approaches for building mobile applications, including native and hybrid approaches. It discusses React Native specifically and its advantages, such as allowing developers to build mobile apps for Android and iOS using React with a single codebase, while still providing access to native platform features and a native user experience. It also covers topics like navigation, testing, publishing apps, and some challenges with React Native like dealing with JavaScript errors in production.

react native
React on Rails - RailsConf 2017 (Phoenix)
 React on Rails - RailsConf 2017 (Phoenix) React on Rails - RailsConf 2017 (Phoenix)
React on Rails - RailsConf 2017 (Phoenix)

The document summarizes the evolution of using React within a Rails application. It describes initially using jQuery and Bootstrap for front-end development needs. It then covers adopting React to take advantage of its one-way data flow and component-based approach. Key steps included embracing ES6 syntax, adding Webpack, introducing Jest for testing, and migrating from Sprockets to manage assets. Over time, React Router and Redux were added for routing and state management. The document concludes by noting ongoing work to improve consistency.

How to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptxHow to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptx

in this article, you will learn how to add multiple layouts using the new version of React router v4. You will see complete details about React router and a step-by-step guide to implementing the multiple layouts using React router v4.

react developmentprogrammingreact library
View
Architecture: Redux
View
Actions
Architecture: Redux
View
Actions
Architecture: Redux
Reducers
View
Actions
Store
Architecture: Redux
Reducers

Recommended for you

125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용

The document discusses ways to improve the performance of hybrid mobile applications that use WebView. It describes how WebView has less powerful capabilities and worse web standard compatibility compared to mobile browsers. This can cause issues like fragmentation across device versions. The document proposes techniques for creating a high-performance WebView, including adding new capabilities like WebSockets, and replacing slower native elements like Canvas 2D with optimized custom implementations. It provides code examples for calling JavaScript from native and vice versa on Android and iOS. Lessons learned emphasize minimizing native/JavaScript communication and dealing with threading issues.

Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...

Since we started to see JS on the server side, the dream of developers has been to reduce the gap and the cost of switch between frontend/backend. Today with Node.js, React and a whole ecosystem of tools, this dream is becoming true! In this talk I am going to discuss about Universal (a.k.a. Isomorphic) JS and present some practical example regarding the major patterns related to routing, data retrieval and rendering. I will use Node, React, Webpack, Babel and React Router and give you a series of example to get you started easily with this new technology trend.

codemotion milan 2016
React js
React jsReact js
React js

This document provides an overview of React including: - React is a JavaScript library created by Facebook for building user interfaces - It uses virtual DOM to efficiently re-render components on updates rather than entire page - React supports ES6 features and uses classes, arrow functions, and other syntax - Popular tools for React include Create React App for setting up projects and React Dev Tools for debugging

reactjsspainsingle page application
View
Actions
Store
Architecture: Redux
Reducers
Build the cart
Architecture
Architecture: Create the Cart
Architecture: Create the Cart
sharedRoutes.jsx

Recommended for you

Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native

React Native is a framework that allows building of native mobile apps using JavaScript and React. It allows for quick development and a shared codebase between Android and iOS. The document discusses directory structure, components, layout and styling, organizing JavaScript code, testing apps, and deploying apps to internal and external users. It promotes React Native as enabling fast development cycles and easy team onboarding while avoiding vendor lock-in.

Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16

With these slides you will learn how to build your first functional component and how to get started with React using Webpack and Babel. We will also discover the JSX syntax and by the end of the the slides you will be able to render your first site using React components.

reactjsreactwebpack
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router

Here’s a step-by-step guideline on implementing basic and dynamic Vue routing with the Vue Router example. Learn and code with the Vue Router tutorial

vue.jsvue routingvuejs development company
<Route path="/" component={App}>

<Route path="/cart" component={Cart} />

<Route path="/cart/payment" component={Payment} />

<Route path="/products" component={Products} />

<Route path="/profile" component={Profile} />

<Route path="/login" component={Login} />

</Route>
Architecture: Create the Cart
sharedRoutes.jsx
Architecture: Create the Cart
export const routes = () => {
}
<Route path="/" component={App}>

<Route path="/cart" component={Cart} />

<Route path="/cart/payment" component={Payment} />

<Route path="/products" component={Products} />

<Route path="/profile" component={Profile} />

<Route path="/login" component={Login} />

</Route>
sharedRoutes.jsx
Architecture: Create the Cart
Architecture: Create the Cart

Recommended for you

Vue js and Dyploma
Vue js and DyplomaVue js and Dyploma
Vue js and Dyploma

An introduction to Vue.js. Using Vue.js to build a web application Dyploma Web UI to manage containerized applications and services in Outbrain.

vuejsjavascriptfrontend
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast

Connect add-ons deliver better user experience when they load fast. Between CDN, server-side rendering, service workers, and code splitting, there are loads of techniques you can use to achieve this. In this session, Atlassian Developer Peter Plewa will reveal Bitbucket Pipelines' secret for fast loads, and what they can do in the future to make Pipelines even faster. Peter Plewa, Development Principal, Atlassian

atlassian summit europe 2017atlascamp 2017atlassian
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)

The document discusses how Angular components can "parasitize" the React ecosystem. It begins by providing code examples of basic Angular component creation. It then explores terminology related to parasitism and parasitoids. Various approaches for communicating between Angular components using services, properties, and Redux are presented. The document also discusses ideas for libraries that could help convert React components to Angular. It covers tools and patterns for state management in Angular like Redux and MobX. Finally, it discusses how Angular components could potentially "parasitize" the React ecosystem in both helpful and harmful ways.

рит++ 2017frontend сonf
Architecture: Create the Cart
Architecture: Create the Cart
item.jsx
const Item = (props) => {

};

Architecture: Create the Cart
item.jsx
return (

<div className="item">

<div className="ui tiny image">

<img src={props.thumbnail} alt="cart" />

</div>

<div className="middle aligned content">

{props.name}

</div>

<div className="right aligned content">

${props.price}

</div>

</div>

);

const Item = (props) => {

};

Architecture: Create the Cart
item.jsx

Recommended for you

DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition

The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf

In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.

social media hackerfacebook hackerhire a instagram hacker
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck

YOUR RELIABLE WEB DESIGN & DEVELOPMENT TEAM — FOR LASTING SUCCESS WPRiders is a web development company specialized in WordPress and WooCommerce websites and plugins for customers around the world. The company is headquartered in Bucharest, Romania, but our team members are located all over the world. Our customers are primarily from the US and Western Europe, but we have clients from Australia, Canada and other areas as well. Some facts about WPRiders and why we are one of the best firms around: More than 700 five-star reviews! You can check them here. 1500 WordPress projects delivered. We respond 80% faster than other firms! Data provided by Freshdesk. We’ve been in business since 2015. We are located in 7 countries and have 22 team members. With so many projects delivered, our team knows what works and what doesn’t when it comes to WordPress and WooCommerce. Our team members are: - highly experienced developers (employees & contractors with 5 -10+ years of experience), - great designers with an eye for UX/UI with 10+ years of experience - project managers with development background who speak both tech and non-tech - QA specialists - Conversion Rate Optimisation - CRO experts They are all working together to provide you with the best possible service. We are passionate about WordPress, and we love creating custom solutions that help our clients achieve their goals. At WPRiders, we are committed to building long-term relationships with our clients. We believe in accountability, in doing the right thing, as well as in transparency and open communication. You can read more about WPRiders on the About us page.

web development agencywpriderswordpress development
return (

<div className="item">

<div className="ui tiny image">

<img src={props.thumbnail} alt="cart" />

</div>

<div className="middle aligned content">

{props.name}

</div>

<div className="right aligned content">

${props.price}

</div>

</div>

);

const Item = (props) => {

};

Architecture: Create the Cart
item.jsx
return (

<div className="item">

<div className="ui tiny image">

<img src={props.thumbnail} alt="cart" />

</div>

<div className="middle aligned content">

{props.name}

</div>

<div className="right aligned content">

${props.price}

</div>

</div>

);

return (

<div className="item">

<div className="ui tiny image">

<img src={props.thumbnail} alt="cart" />

</div>

<div className="middle aligned content">

{props.name}

</div>

<div className="right aligned content">

${props.price}

</div>

</div>

);

const Item = (props) => {

};

const Item = (props) => {

};

Architecture: Create the Cart
item.jsx
Architecture: Create the Cartcart.jsx
render() {

return (

<div className="cart main ui segment">

<div className="ui segment divided items">

{this.renderItems()}

</div>
</div>

);

}
Architecture: Create the Cartcart.jsx

Recommended for you

Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure

Recent advancements in the NIST-JARVIS infrastructure: JARVIS-Overview, JARVIS-DFT, AtomGPT, ALIGNN, JARVIS-Leaderboard

jarvisjarvis-dftalignn
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024

Everything that I found interesting about machines behaving intelligently during June 2024

quantumfaxmachine
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

render() {

return (

<div className="cart main ui segment">

<div className="ui segment divided items">

{this.renderItems()}

</div>
</div>

);

}
Architecture: Create the Cart
<div className="ui right rail">

<div className="ui segment">

<span>Total: </span><span>${this.getTotal()}</span>

<button onClick={this.proceedToCheckout} className="ui positive basic button">

Checkout

</button>

</div>
</div>
render() {

return (

<div className="cart main ui segment">

<div className="ui segment divided items">

{this.renderItems()}

</div>
</div>

);

}
cart.jsx


import cartActions from '../shared/cart-action-creators.es6';



export class CartComponent extends Component {



static loadData() {

return [

cartActions.getCartItems

];

}

render() {}

}

Architecture: Create the Cart
cart.jsx




export class CartComponent extends Component {}


function mapStateToProps(state) {}



function mapDispatchToProps(dispatch) {}



export default connect(mapStateToProps, mapDispatchToProps)
(CartComponent);
Architecture: Create the Cart
cart.jsx
import fetch from 'isomorphic-fetch';



export const GET_CART_ITEMS = 'GET_CART_ITEMS';



export function getCartItems() {
Architecture: Create the Cart
cart-action-creators.es6

Recommended for you

Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf

To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.

data recoverydatadiskwarrior
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx

This is a slide deck that showcases the updates in Microsoft Copilot for May 2024

microsoftmicrosoft copilot
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops

This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization. Key Takeaways: * Understand why connection pooling is essential for high-traffic applications * Explore various connection poolers available for PostgreSQL, including pgbouncer * Learn the configuration options and functionalities of pgbouncer * Discover best practices for monitoring and troubleshooting connection pooling setups * Gain insights into real-world use cases and considerations for production environments This presentation is ideal for: * Database administrators (DBAs) * Developers working with PostgreSQL * DevOps engineers * Anyone interested in optimizing PostgreSQL performance Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services

postgresqlpgsqldatabase
import fetch from 'isomorphic-fetch';



export const GET_CART_ITEMS = 'GET_CART_ITEMS';



export function getCartItems() {

return (dispatch) => {

return fetch('http://localhost:3000/api/user/cart', {

method: 'GET'

})
Architecture: Create the Cart
cart-action-creators.es6
import fetch from 'isomorphic-fetch';



export const GET_CART_ITEMS = 'GET_CART_ITEMS';



export function getCartItems() {

return (dispatch) => {

return fetch('http://localhost:3000/api/user/cart', {

method: 'GET'

})
Architecture: Create the Cart
cart-action-creators.es6
.then((response) => {

return response.json().then((data) => {

return dispatch({

type: GET_CART_ITEMS,

data: data.items

});

});

})
Architecture: Create the Cart
import { GET_CART_ITEMS } from './cart-action-creators.es6';



export default function cart(state = {}, action) {

switch (action.type) {

case GET_CART_ITEMS:

return {

...state,

items: action.data

};

}

}
cart-reducer.es6
Architecture: Create the Cart
import { GET_CART_ITEMS } from './cart-action-creators.es6';



export default function cart(state = {}, action) {

switch (action.type) {

case GET_CART_ITEMS:

return {

...state,

items: action.data

};

}

}
import { GET_CART_ITEMS } from './cart-action-creators.es6';



export default function cart(state = {}, action) {

switch (action.type) {

case GET_CART_ITEMS:

return {

...state,

items: action.data

};

}

}
cart-reducer.es6

Recommended for you

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...

Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.

insider securitycybersecurity threatsenterprise security
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...

Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)

user modelinguser profilinguser model
Server setup
Architecture
HTML output from server
Architecture: Server setup
Architecture: Server setup
export default function renderView(req, res, next) {

const matchOpts = {};

const handleMatchResult = (error, redirectLocation, renderProps) => {

if (!error && !redirectLocation && renderProps) {

const store = initRedux();

let actions = renderProps.components.map((component) => {

// return actions from loadData() on each component

});
renderView.jsx
Architecture: Server setup


Promise.all(promises).then(() => {

const serverState = store.getState();



renderView.jsx

Recommended for you

find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges

accommodate the strengths, weaknesses, threats and opportunities of autonomous vehicles

automotive self-driving car technology
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf

These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.

air force fighter planebiggest submarinezambia port
Architecture: Server setup


Promise.all(promises).then(() => {

const serverState = store.getState();



const stringifiedServerState = JSON.stringify(serverState);


Promise.all(promises).then(() => {

const serverState = store.getState();



renderView.jsx
Architecture: Server setup


Promise.all(promises).then(() => {

const serverState = store.getState();



const stringifiedServerState = JSON.stringify(serverState);


Promise.all(promises).then(() => {

const serverState = store.getState();





const app = renderToString(

<Provider store={store}>

<RouterContext routes={routes} {...renderProps} />

</Provider>

);
const stringifiedServerState = JSON.stringify(serverState);
renderView.jsx
Architecture: Server setup


Promise.all(promises).then(() => {

const serverState = store.getState();



const stringifiedServerState = JSON.stringify(serverState);


Promise.all(promises).then(() => {

const serverState = store.getState();





const app = renderToString(

<Provider store={store}>

<RouterContext routes={routes} {...renderProps} />

</Provider>

);
const stringifiedServerState = JSON.stringify(serverState);


const html = renderToString(

<HTML html={app} serverState={stringifiedServerState} />

);





const app = renderToString(

<Provider store={store}>

<RouterContext routes={routes} {...renderProps} />

</Provider>

);
renderView.jsx
Architecture: Server setup


Promise.all(promises).then(() => {

const serverState = store.getState();



const stringifiedServerState = JSON.stringify(serverState);


Promise.all(promises).then(() => {

const serverState = store.getState();





const app = renderToString(

<Provider store={store}>

<RouterContext routes={routes} {...renderProps} />

</Provider>

);
const stringifiedServerState = JSON.stringify(serverState);


const html = renderToString(

<HTML html={app} serverState={stringifiedServerState} />

);



return res.send(`<!DOCTYPE html>${html}`);


const app = renderToString(

<Provider store={store}>

<RouterContext routes={routes} {...renderProps} />

</Provider>

);

const html = renderToString(

<HTML html={app} serverState={stringifiedServerState} />

);



renderView.jsx

Recommended for you

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides

If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights. During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to: - Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value - Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems - Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors - Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported - Look Ahead: Gain insights into where FME is headed with coordinate systems in the future Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!

WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf

Profile portofolio

Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM

Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.

quantum communicationsshannon's channel theoremclassical theory
Architecture: Server setup
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
html.jsx
Architecture: Server setup
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
html.jsx
Architecture: Server setup
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
html.jsx
Architecture: Server setup
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
const HTML = (props) => {

return (

<html lang="en">

<head></head>

<body>

<div

id="react-content"

dangerouslySetInnerHTML={{ __html: props.html }}/>

<script dangerouslySetInnerHTML={{

__html: `

window.__SERIALIZED_STATE__ =

JSON.stringify(${props.serverState})

`

}}/>

<script type="application/javascript" src="/browser.js" />

</body>

</html>

);

};
html.jsx

Recommended for you

How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence

Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently. Visit- https://onliveserver.com/linux-web-hosting/

cheap linux hosting
Clicking the button results doesn’t do anything
Architecture: Server Setup
App State available in the browser.
Architecture: Server setup
Browser setup
Architecture


const initialState = JSON.parse(window.__SERIALIZED_STATE__);

const store = initRedux(initialState);

Architecture: Browser setup

Recommended for you



const initialState = JSON.parse(window.__SERIALIZED_STATE__);

const store = initRedux(initialState);

Architecture: Browser setup


function init() {

ReactDOM.render(

<Provider store={store}>

<Router routes={sharedRoutes(store)} history={browserHistory}
/>

</Provider>, document.getElementById('react-content'));

}



init();


const initialState = JSON.parse(window.__SERIALIZED_STATE__);

const store = initRedux(initialState);

Architecture: Browser setup
Challenges and
Tradeoffs
Competing envs
Challenges and Tradeoffs

Recommended for you

Challenges and Tradeoffs
Challenges and Tradeoffs
if (process.env.BROWSER) {

// browser only code

}
Performance
Challenges and Tradeoffs
Server Performance Strategies
Only render above the fold content on the server (SEO tradeoff)
Use streams
Caching
Challenges and Tradeoffs

Recommended for you

Caching
Challenges and Tradeoffs
Challenges and Tradeoffs
Challenges and Tradeoffs
Challenges and Tradeoffs

Recommended for you

Two Options
In memory caching
CDN/Edge caching
Walmart Labs Server Side Render Cache (Electrode)
Challenges and Tradeoffs
Complexity
Challenges and Tradeoffs
Building Universal Apps requires you to think about your
application flow in a new way.

More Related Content

What's hot

Getting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIGetting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUI
Scott Gardner
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and Combine
Tai Lun Tseng
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
Joonas Lehtinen
 
React js
React jsReact js
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
TechExeter
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
Ilia Idakiev
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
RapidValue
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer
Rob Dodson
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
Hendrik Ebbers
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
Astrails
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
Andrew Rota
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
Brendan Lim
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
David Gibbons
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
Stacy London
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
David Gibbons
 
Vue business first
Vue business firstVue business first
Vue business first
Vitalii Ratyshnyi
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
Joonas Lehtinen
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
Stacy London
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
Marcus Hellberg
 
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Phil Leggetter
 

What's hot (20)

Getting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUIGetting Started with Combine And SwiftUI
Getting Started with Combine And SwiftUI
 
MVVM with SwiftUI and Combine
MVVM with SwiftUI and CombineMVVM with SwiftUI and Combine
MVVM with SwiftUI and Combine
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
React js
React jsReact js
React js
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
 
Vue business first
Vue business firstVue business first
Vue business first
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
 

Viewers also liked

React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
Andrew Hull
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2
DreamLab
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
Jamal Sinclair O'Garro
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
TechMagic
 
React js
React jsReact js
React js
Jai Santhosh
 
Compare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End StackCompare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End Stack
Deepu S Nath
 
Java script framework-roller-coaster
Java script framework-roller-coasterJava script framework-roller-coaster
Java script framework-roller-coaster
Ryan McColeman
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)
Xinchen Hui
 
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
RapidValue
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
Mongodb workshop
Mongodb workshopMongodb workshop
Mongodb workshop
Harun Yardımcı
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
Deepu S Nath
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB
 
capitalizacion
capitalizacioncapitalizacion
capitalizacion
gustavoangel92
 
Read aloudwhitepaper
Read aloudwhitepaperRead aloudwhitepaper
Read aloudwhitepaper
nyia hill
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
Anuchit Chalothorn
 
Biosfera ict
Biosfera ictBiosfera ict
Biosfera ict
Deynna Morales
 
Wikispaces
WikispacesWikispaces
Wikispaces
erika moreno
 
Apresentação1
Apresentação1Apresentação1
Apresentação1
ana paula amorim
 

Viewers also liked (20)

React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
 
React js
React jsReact js
React js
 
Compare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End StackCompare Javascript libraries in Front End Stack
Compare Javascript libraries in Front End Stack
 
Java script framework-roller-coaster
Java script framework-roller-coasterJava script framework-roller-coaster
Java script framework-roller-coaster
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)微博Lamp性能优化之路(2014)
微博Lamp性能优化之路(2014)
 
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
Choosing the Right HTML5 Framework to Build your Mobile Web Application White...
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Mongodb workshop
Mongodb workshopMongodb workshop
Mongodb workshop
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
MongoDB San Francisco 2013: Basic Sharding in MongoDB presented by Brandon Bl...
 
capitalizacion
capitalizacioncapitalizacion
capitalizacion
 
Read aloudwhitepaper
Read aloudwhitepaperRead aloudwhitepaper
Read aloudwhitepaper
 
MongoDB Shard Cluster
MongoDB Shard ClusterMongoDB Shard Cluster
MongoDB Shard Cluster
 
Biosfera ict
Biosfera ictBiosfera ict
Biosfera ict
 
Wikispaces
WikispacesWikispaces
Wikispaces
 
Apresentação1
Apresentação1Apresentação1
Apresentação1
 

Similar to Building Universal Web Apps with React ForwardJS 2017

Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Luciano Mammino
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
[T]echdencias
 
React outbox
React outboxReact outbox
React outbox
Angela Lehru
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Luciano Mammino
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Codemotion
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
RAJNISH KATHAROTIYA
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack
Ignacio Martín
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
Ignacio Martín
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
Lohika_Odessa_TechTalks
 
React on Rails - RailsConf 2017 (Phoenix)
 React on Rails - RailsConf 2017 (Phoenix) React on Rails - RailsConf 2017 (Phoenix)
React on Rails - RailsConf 2017 (Phoenix)
Jo Cranford
 
How to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptxHow to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptx
BOSC Tech Labs
 
125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용
NAVER D2
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Codemotion
 
React js
React jsReact js
React js
Rajesh Kolla
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Ryan Boland
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
Benny Neugebauer
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
Katy Slemon
 
Vue js and Dyploma
Vue js and DyplomaVue js and Dyploma
Vue js and Dyploma
Yoram Kornatzky
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
Atlassian
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Ontico
 

Similar to Building Universal Web Apps with React ForwardJS 2017 (20)

Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
 
React outbox
React outboxReact outbox
React outbox
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
 
React on Rails - RailsConf 2017 (Phoenix)
 React on Rails - RailsConf 2017 (Phoenix) React on Rails - RailsConf 2017 (Phoenix)
React on Rails - RailsConf 2017 (Phoenix)
 
How to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptxHow to implement multiple layouts using React router V4.pptx
How to implement multiple layouts using React router V4.pptx
 
125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용
 
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
 
React js
React jsReact js
React js
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
Vue js and Dyploma
Vue js and DyplomaVue js and Dyploma
Vue js and Dyploma
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 

Recently uploaded

DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 

Recently uploaded (20)

DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 

Building Universal Web Apps with React ForwardJS 2017

  • 1. Building Universal Web Apps with React Elyse Kolker Gordon Twitter: @sfdrummerjs, Github: @elyseko Web Lead, Vevo Code: bit.ly/universal-app-react
  • 2. Get it 40% off! bit.ly/isomorphicdevjs Code: ctwforwjs17 Win a free ebook: http://bit.ly/2m0pCiP
  • 4. Write code once, run it in two environments (node & browser).
  • 5. Overview of Universal/Isomorphic Web Apps Why would you want to build an universal web app Universal App Architecture Challenges and Tradeoffs Topics:
  • 6. Overview: What is a Universal App?
  • 13. Single Page Application (SPA) Overview
  • 14. Single Page Application (SPA) Overview
  • 15. Single Page Application (SPA) Overview
  • 16. Single Page Application (SPA) Overview
  • 17. Single Page Application (SPA) Overview
  • 28. #1 SEO Getting your website (or cat video) to rank the highest can make or break your success as a business. Why build it?
  • 29. #2 Perceived Performance Users should think the site is fast. This means showing content (not loading spinners) as soon as possible. Why build it?
  • 30. Everything is JavaScript! Most of your code will run on both the server and the browser. #3 Maintenance and Developer benefits Why build it?
  • 32. In this section Technologies required to build an universal app Loading a single page of the app in the isomorphic flow Architecture Code: bit.ly/universal-app-react
  • 33. In this section Technologies required to build an universal app Loading a single page of the app in the isomorphic flow Architecture Code: bit.ly/universal-app-react
  • 34. In this section Technologies required to build an universal app Loading a single page of the app in the isomorphic flow Architecture Code: bit.ly/universal-app-react
  • 39. Why webpack? NPM packages ES6/ES7 with babel CSS in your browser bundle Advanced features Architecture: webpack
  • 44. Architecture: webpack Code Parser Transforms Compiled App Code
  • 45. Architecture: wepack "scripts": {
 "build:browser": "webpack",
 "prestart": "npm run build:browser",
 "start": "node src/server.js"
 } package.json
  • 46. module.exports = {
 entry: "./src/main.jsx",
 devtool: "source-map",
 output: {
 path: __dirname + '/ src/',
 filename: "browser.js"
 }, Architecture: webpack webpack.config.js
  • 47. module.exports = {
 ... Architecture: webpack module: {
 loaders: [
 {
 test: /.(jsx|es6)$/,
 exclude: /node_modules|examples/,
 loader: "babel-loader"
 },
 {
 test: /.css$/,
 loaders: ['style', 'css']
 }
 ] webpack.config.js
  • 53. Architecture: React import ReactDOM from 'react-dom';
 ReactDOM.render( <RootComponent {...props} />, document.getElementById(‘react- content’) );
  • 54. Architecture: React import { renderToString } from 'react-dom/ server';
 renderToString(<RootComponent {...props} />);
  • 57. Architecture: React Router ReactDOM.render(
 <Router routes={sharedRoutes(store)} history={browserHistory} />,
 document.getElementById('react-content')
 );
  • 59. import React from 'react';
 import { match, RouterContext } from 'react-router';
 import { routes } from '../shared/sharedRoutes';
 
 export default function renderView(req, res, next) {
 }
 Architecture: React RouterrenderView.jsx
  • 60. import React from 'react';
 import { match, RouterContext } from 'react-router';
 import { routes } from '../shared/sharedRoutes';
 
 export default function renderView(req, res, next) {
 }
 Architecture: React Router match(matchOpts, handleMatchResult); renderView.jsx
  • 61. import React from 'react';
 import { match, RouterContext } from 'react-router';
 import { routes } from '../shared/sharedRoutes';
 
 export default function renderView(req, res, next) {
 const matchOpts = {
 routes: routes(),
 location: req.url
 };
 
 
 }
 Architecture: React Router match(matchOpts, handleMatchResult); renderView.jsx match(matchOpts, handleMatchResult);
  • 62. import React from 'react';
 import { match, RouterContext } from 'react-router';
 import { routes } from '../shared/sharedRoutes';
 
 export default function renderView(req, res, next) {
 const matchOpts = {
 routes: routes(),
 location: req.url
 };
 
 
 }
 Architecture: React Router const handleMatchResult = (error, redirectLocation, renderProps) => {
 if (!error && !redirectLocation && renderProps) { // render code } } match(matchOpts, handleMatchResult); renderView.jsx match(matchOpts, handleMatchResult); const matchOpts = {
 routes: routes(),
 location: req.url
 };

  • 72. Architecture: Create the Cart sharedRoutes.jsx
  • 73. <Route path="/" component={App}>
 <Route path="/cart" component={Cart} />
 <Route path="/cart/payment" component={Payment} />
 <Route path="/products" component={Products} />
 <Route path="/profile" component={Profile} />
 <Route path="/login" component={Login} />
 </Route> Architecture: Create the Cart sharedRoutes.jsx
  • 74. Architecture: Create the Cart export const routes = () => { } <Route path="/" component={App}>
 <Route path="/cart" component={Cart} />
 <Route path="/cart/payment" component={Payment} />
 <Route path="/products" component={Products} />
 <Route path="/profile" component={Profile} />
 <Route path="/login" component={Login} />
 </Route> sharedRoutes.jsx
  • 78. Architecture: Create the Cart item.jsx
  • 79. const Item = (props) => {
 };
 Architecture: Create the Cart item.jsx
  • 80. return (
 <div className="item">
 <div className="ui tiny image">
 <img src={props.thumbnail} alt="cart" />
 </div>
 <div className="middle aligned content">
 {props.name}
 </div>
 <div className="right aligned content">
 ${props.price}
 </div>
 </div>
 );
 const Item = (props) => {
 };
 Architecture: Create the Cart item.jsx
  • 81. return (
 <div className="item">
 <div className="ui tiny image">
 <img src={props.thumbnail} alt="cart" />
 </div>
 <div className="middle aligned content">
 {props.name}
 </div>
 <div className="right aligned content">
 ${props.price}
 </div>
 </div>
 );
 const Item = (props) => {
 };
 Architecture: Create the Cart item.jsx
  • 82. return (
 <div className="item">
 <div className="ui tiny image">
 <img src={props.thumbnail} alt="cart" />
 </div>
 <div className="middle aligned content">
 {props.name}
 </div>
 <div className="right aligned content">
 ${props.price}
 </div>
 </div>
 );
 return (
 <div className="item">
 <div className="ui tiny image">
 <img src={props.thumbnail} alt="cart" />
 </div>
 <div className="middle aligned content">
 {props.name}
 </div>
 <div className="right aligned content">
 ${props.price}
 </div>
 </div>
 );
 const Item = (props) => {
 };
 const Item = (props) => {
 };
 Architecture: Create the Cart item.jsx
  • 83. Architecture: Create the Cartcart.jsx
  • 84. render() {
 return (
 <div className="cart main ui segment">
 <div className="ui segment divided items">
 {this.renderItems()}
 </div> </div>
 );
 } Architecture: Create the Cartcart.jsx
  • 85. render() {
 return (
 <div className="cart main ui segment">
 <div className="ui segment divided items">
 {this.renderItems()}
 </div> </div>
 );
 } Architecture: Create the Cart <div className="ui right rail">
 <div className="ui segment">
 <span>Total: </span><span>${this.getTotal()}</span>
 <button onClick={this.proceedToCheckout} className="ui positive basic button">
 Checkout
 </button>
 </div> </div> render() {
 return (
 <div className="cart main ui segment">
 <div className="ui segment divided items">
 {this.renderItems()}
 </div> </div>
 );
 } cart.jsx
  • 86. 
 import cartActions from '../shared/cart-action-creators.es6';
 
 export class CartComponent extends Component {
 
 static loadData() {
 return [
 cartActions.getCartItems
 ];
 }
 render() {}
 }
 Architecture: Create the Cart cart.jsx
  • 87. 
 
 export class CartComponent extends Component {} 
 function mapStateToProps(state) {}
 
 function mapDispatchToProps(dispatch) {}
 
 export default connect(mapStateToProps, mapDispatchToProps) (CartComponent); Architecture: Create the Cart cart.jsx
  • 88. import fetch from 'isomorphic-fetch';
 
 export const GET_CART_ITEMS = 'GET_CART_ITEMS';
 
 export function getCartItems() { Architecture: Create the Cart cart-action-creators.es6
  • 89. import fetch from 'isomorphic-fetch';
 
 export const GET_CART_ITEMS = 'GET_CART_ITEMS';
 
 export function getCartItems() {
 return (dispatch) => {
 return fetch('http://localhost:3000/api/user/cart', {
 method: 'GET'
 }) Architecture: Create the Cart cart-action-creators.es6
  • 90. import fetch from 'isomorphic-fetch';
 
 export const GET_CART_ITEMS = 'GET_CART_ITEMS';
 
 export function getCartItems() {
 return (dispatch) => {
 return fetch('http://localhost:3000/api/user/cart', {
 method: 'GET'
 }) Architecture: Create the Cart cart-action-creators.es6 .then((response) => {
 return response.json().then((data) => {
 return dispatch({
 type: GET_CART_ITEMS,
 data: data.items
 });
 });
 })
  • 91. Architecture: Create the Cart import { GET_CART_ITEMS } from './cart-action-creators.es6';
 
 export default function cart(state = {}, action) {
 switch (action.type) {
 case GET_CART_ITEMS:
 return {
 ...state,
 items: action.data
 };
 }
 } cart-reducer.es6
  • 92. Architecture: Create the Cart import { GET_CART_ITEMS } from './cart-action-creators.es6';
 
 export default function cart(state = {}, action) {
 switch (action.type) {
 case GET_CART_ITEMS:
 return {
 ...state,
 items: action.data
 };
 }
 } import { GET_CART_ITEMS } from './cart-action-creators.es6';
 
 export default function cart(state = {}, action) {
 switch (action.type) {
 case GET_CART_ITEMS:
 return {
 ...state,
 items: action.data
 };
 }
 } cart-reducer.es6
  • 94. HTML output from server Architecture: Server setup
  • 95. Architecture: Server setup export default function renderView(req, res, next) {
 const matchOpts = {};
 const handleMatchResult = (error, redirectLocation, renderProps) => {
 if (!error && !redirectLocation && renderProps) {
 const store = initRedux();
 let actions = renderProps.components.map((component) => {
 // return actions from loadData() on each component
 }); renderView.jsx
  • 96. Architecture: Server setup 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 renderView.jsx
  • 97. Architecture: Server setup 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 const stringifiedServerState = JSON.stringify(serverState); 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 renderView.jsx
  • 98. Architecture: Server setup 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 const stringifiedServerState = JSON.stringify(serverState); 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 
 const app = renderToString(
 <Provider store={store}>
 <RouterContext routes={routes} {...renderProps} />
 </Provider>
 ); const stringifiedServerState = JSON.stringify(serverState); renderView.jsx
  • 99. Architecture: Server setup 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 const stringifiedServerState = JSON.stringify(serverState); 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 
 const app = renderToString(
 <Provider store={store}>
 <RouterContext routes={routes} {...renderProps} />
 </Provider>
 ); const stringifiedServerState = JSON.stringify(serverState); 
 const html = renderToString(
 <HTML html={app} serverState={stringifiedServerState} />
 );
 
 
 const app = renderToString(
 <Provider store={store}>
 <RouterContext routes={routes} {...renderProps} />
 </Provider>
 ); renderView.jsx
  • 100. Architecture: Server setup 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 const stringifiedServerState = JSON.stringify(serverState); 
 Promise.all(promises).then(() => {
 const serverState = store.getState();
 
 
 const app = renderToString(
 <Provider store={store}>
 <RouterContext routes={routes} {...renderProps} />
 </Provider>
 ); const stringifiedServerState = JSON.stringify(serverState); 
 const html = renderToString(
 <HTML html={app} serverState={stringifiedServerState} />
 );
 
 return res.send(`<!DOCTYPE html>${html}`); 
 const app = renderToString(
 <Provider store={store}>
 <RouterContext routes={routes} {...renderProps} />
 </Provider>
 );
 const html = renderToString(
 <HTML html={app} serverState={stringifiedServerState} />
 );
 
 renderView.jsx
  • 101. Architecture: Server setup const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; html.jsx
  • 102. Architecture: Server setup const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; html.jsx
  • 103. Architecture: Server setup const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; html.jsx
  • 104. Architecture: Server setup const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; const HTML = (props) => {
 return (
 <html lang="en">
 <head></head>
 <body>
 <div
 id="react-content"
 dangerouslySetInnerHTML={{ __html: props.html }}/>
 <script dangerouslySetInnerHTML={{
 __html: `
 window.__SERIALIZED_STATE__ =
 JSON.stringify(${props.serverState})
 `
 }}/>
 <script type="application/javascript" src="/browser.js" />
 </body>
 </html>
 );
 }; html.jsx
  • 105. Clicking the button results doesn’t do anything Architecture: Server Setup
  • 106. App State available in the browser. Architecture: Server setup
  • 108. 
 const initialState = JSON.parse(window.__SERIALIZED_STATE__);
 const store = initRedux(initialState);
 Architecture: Browser setup
  • 109. 
 const initialState = JSON.parse(window.__SERIALIZED_STATE__);
 const store = initRedux(initialState);
 Architecture: Browser setup 
 function init() {
 ReactDOM.render(
 <Provider store={store}>
 <Router routes={sharedRoutes(store)} history={browserHistory} />
 </Provider>, document.getElementById('react-content'));
 }
 
 init(); 
 const initialState = JSON.parse(window.__SERIALIZED_STATE__);
 const store = initRedux(initialState);

  • 114. Challenges and Tradeoffs if (process.env.BROWSER) {
 // browser only code
 }
  • 116. Server Performance Strategies Only render above the fold content on the server (SEO tradeoff) Use streams Caching Challenges and Tradeoffs
  • 121. Two Options In memory caching CDN/Edge caching Walmart Labs Server Side Render Cache (Electrode) Challenges and Tradeoffs
  • 123. Building Universal Apps requires you to think about your application flow in a new way.