SlideShare a Scribd company logo
1 of 78
Download to read offline
Content-Driven Apps with React
Corsin Decurtins, Netcetera
2016-10-17
/Bern
BärnerJS
Notes
Content-Driven Apps with React
This talk is a story about a family of projects or apps
Actually not just individual apps, but app platforms
Same team, same technology (roughly)
Multiple projects, multiple apps, multiple customers
But the same kind of app or actually app platform
Mobile app, heavily content driven
Customers are publishers, users are readers
It all started with a proof-of-concept…
Notes
Proof of Concept
Customer had a hybrid mobile app, Cordova and Angular (1)
It was too slow for them, which resulted in a bad UX
PoC done with React to see if we can improve the performance
In particular the performance of the home page / start screen
PoC showed, that we can
Goal was a 50% improvement, he had up to 80% improvement
This talk is about the app architecture that started with this PoC
But it will be about anything but performance
Disclaimer
Notes
Disclaimers
I’m just the person giving the talk; other people did the
actual work
If something is wrong or does not make sense, it’s probably
me who messed it up
I’m familiar with the architecture, design and technologies
If you have very detailed questions about the
implementation, I will refer you to my colleagues
Ognen Ivanovski, Netcetera
Principal Architect
Andon Sikavica, Netcetera
Senior Software Engineer
Notes
Who are you?
Who is already familiar with…
… React
… React Native
… Redux
… Immutable Data, ImmutableJS
… Pure Functions, Functional Programming
React
React Native
Redux
Functional Programming
Pure Functions
Immutable Data
immutable.js
Notes
Setting the Scene
Web-Based
Hybrid Mobile Apps
Notes
Web-Based Hybrid Mobile Apps
Mobile apps for smartphones and tablets
Hybrid, i.e. one code base for all the platforms
Based on web technologies, i.e. HTML, Javascript, CSS and
JSON
Based on web tooling (debuggers, CSS, NPM, gulp,
ECMAScript, …)
Cordova is the most common runtime platform for creating
packaged apps that can be delivered to the app store
Web-Based*
Hybrid Mobile** Apps***
Notes
Web-Based Hybrid Mobile Apps
Web based can be interpreted loosely
Instead of HTML, other markup is possible, including
markup for native components
Also not restricted to mobile apps, you can build other apps
as well
Not even restricted to apps, can be used for “websites”
Content-Driven Apps
Notes
Content-Driven Apps
Mobile apps that are mostly used to consume and browse
through content
News apps for example
Get content from a server
Content from the server determines the screens, the
interaction and the navigation
The browser is probably the ultimate example
Notes
Content-Driven Apps
We started out with news apps for publishers
But there are a lot of other examples
Notes
High-Level Architecture
App
Cordova
app.js
Libraries
CMS
DAM
Ads
IAM
Entitlement
Platform
SkinningConfig
API
Cache
Widgets
Metrics
Analytics
Notes
Architecture
Client App, JS, packaged with Cordova
Libraries, Widgets, Generic Platform Code
These are part of the platform and the same for all the apps of
the platform
App-specific configuration and skinning
Content is retrieved from the server-side through an API
Abstracts various backend systems such as the CMS, DAM, …
API might have a server-side cache
Notes
Challenges
App Platform vs. just an app
Reuse of code, platform, configuration, customising,
skinning
API Evolution
Apps are deployed, no instant updates
Performance, User Experience (UX)
Time-To-Market and Price
Notes
Design, Patterns, Concepts,
Technologies, …
React
Notes
React Components
Tree of React Components
JS objects, can be as simple as one function
Every component has a render() function
Can be static (children are hard-coded in the parent) or
dynamic (children are added based on data of the parent-
components)
Notes
State
Every React component can have an inner state
State is optional
State must only be manipulated through an defined interface
Gives React a chance to know when the state has changed
and the component needs to be re-rendered
Notes
Attributes
In addition to the internal state, React components can also
receive data from parent components through attributes
Can be used for rendering
Can be used for initialising state
const CommentForm = React.createClass({
getInitialState: () => {
return {author: '', text: ''};
},
handleAuthorChange: (e) => {
this.setState({author: e.target.value});
},
handleTextChange: (e) => {
this.setState({text: e.target.value});
},
handleSubmit: (e) => {
e.preventDefault();
// do something
},
...
});
const CommentForm = React.createClass({
...
render: function() {
return (
<form className="commentForm" onSubmit={this.handleSubmit}>
<input type=“text" placeholder="Your name"
value={this.state.author} onChange={this.handleAuthorChange}
/>
<input type=“text" placeholder="Say something..."
value={this.state.text} onChange={this.handleTextChange}
/>
<input type="submit" value="Post" />
</form>
);
}
});
React Components Virtual DOM DOM
Notes
React Rendering
React Components have a render() function that produces
HTML
Actually it produces a tree of objects that correspond to
HTML
The React Components are rendered into a Virtual DOM first
The Virtual DOM is then rendered into the actual DOM
Notes
React Rendering
Pure Functions for the transformations (aka rendering)
Events flow in reverse to the transformation flow
React Optimisations
Propagate diffs rather than new trees
Lots and lots of checks for changes for trees and subtrees
Modify data (state or attributes) only through well-defined
interfaces
Immutable Data
React Components Virtual DOM DOM
Notes
Immutable Data
Data cannot be changed
Every change results in a new copy of a data structure
Optimisation: Data structure can contain references to data of
other data structures (since they can never change)
Equality check with immutable data becomes very efficient
Check if the reference is the same
React change check (shouldComponentUpdate) can be
implemented very efficiently
Redux
Dan Abramov
Hot Reloading with Time Travel
https://youtu.be/xsSnOQynTHs
reducerreducerreducerreducer
const newsReducer = (state = {}, action) => {



if (action.type === ‘NEWS_UPDATE’) {

return Object.assign(
{},
state,
{stories: action.stories}
);

}



return state;

};
Notes
Redux
Application state consists of one state object
React components do not have a state anymore
Application state is passed into React as an attribute
Reducers handle all the events and transfer the app from one
state into another
Creation of the React Component tree is a pure function
Rendering of the React Component tree is a pure function
Reducers are pure functions
reducerreducerreducerreducer reducerreducerreducerreducer
reducerreducerreducerreducer
Notes
Loading Content
from the Server
(or from a local cache)
Content API
{
"kind": ["image", "diagram"],
"imageUrl": “http://example.com/diagram.png"
"caption": “Super Cool Diagram"
}
Notes
Content API
Objects in the content tree are called elements
Kind describes the (hierarchical) type of an element
Additional type-specific attributes are part of the element
Above example is the element description for an image
Can for example be a nice diagram
Customer wants to add support for an interactive diagram (zoom and
pan, play around with values, …)
Create a new element, support on the CMS and in the app
Create the new element as an extension/refinement of the old one
Content API
{
"kind": [“image”, “diagram”, “interactive”],
“dataUrl”: “https://example.com/data/diagram.json”,
"imageUrl": “https://example.com/diagram.png"
"caption": “Super Cool Diagram"
}
Notes
Content API
New sub-type ‘interactive’
Data URL for loading the data for the diagram
But the component is also an [‘image’, ‘diagram’] with
‘imageUrl’ and ‘caption’
If a client does not support ‘interactive’ yet, the component
can also just be rendered as an image/diagram
reducerreducerreducerreducer reducerreducerreducerreducer
reducerreducerreducerreducer
Notes
Loading Content (Simplified)
Reducer triggers a request for loading content
Technically, this is a side-effect and the reducer is not a pure function
anymore
Side-Effect is on an external system, asynchronous handling
When the data arrives, that triggers a new event for the reducers
Data passes through a series of transformers (“pure” functions) that
transform the received data into data that can be incorporated into the
application state … as well as side-effect events for loading additional
data
Notes
React / Redux / Immutable
Pure functions everywhere
Logically, everything is immutable and pure functions
Physically, React makes optimisations
Notes
Interesting Properties
Serialisable application state
Testing
Time-Machine
Performance
Code Quality
Code Reuse
Notes
Excursions
Web Applications
Notes
Web Applications
Nothing mentioned above is specific to mobile apps
You can also use the architecture for “normal” web
applications
Desktop web applications, mobile apps, responsive apps, …
React Native
React
React DOM React Native
Notes
React Native
Relatively recent extension of the React Framework
Everything remains the same, React Components and if you
use it Redux, …
Instead of rendering HTML objects (using ReactDOM and
JSX), you render markup for Native Components
Native Runtime, Native Apps, Javascript as Scripting Engine
Native Performance, but still Hybrid
Server-Side Rendering
React Components Virtual DOM HTML Document
HTML
Notes
Server-Side Rendering
React Components can be rendered into a string
HTML code only
HTML code is dead, i.e. it does not contain any active parts
(Javascript)
Can be used for pre-rendering on the server-side
Make content available for search engine and other non-browser
clients
Testing
Notes
Summary
Technologies and Concepts
reducerreducerreducerreducer reducerreducerreducerreducer
reducerreducerreducerreducer
Notes
Technologies and Concepts
Technology choices have a big impact on design and fundamental
concepts
React, Redux and other members of this family have a clear heritage of
functional programming
This has a learning curve
It takes some time until you “get it”
And then it takes some more time until you really “get it”
Concepts are very different from what our developers were used too
There was a learning curve until it really clicks
Notes
Technologies and Concepts
Some things seem unnecessarily complicated and limiting
Most of the time, they are actually not
They seem complicated, because they are unfamiliar and you have
not started to think in a React/Redux/Functional way
Code Base in the end is much more fragmented
More small granular components than with other core technologies
Complexity is still smaller though, because the small components
follow very clear, simple and orthogonal concepts
Notes
Technologies and Concepts
Concepts (and technologies) allow for really cool and helpful
things
Testing, Time-Machine, React DevTools
Clean, simple, well-abstracted and clean code
Reusable and extensible code
Content API allows for very powerful customisation and
extension … of existing apps and use cases
Girders Elements
https://github.com/netceteragroup/girders-elements
Notes
Girders Elements
We had the chance to go through multiple iterations with the described
architecture
Both with React DOM and React Native
One of the current customers gave us the chance to extract the core
framework of the architecture and open-source it
This is called Girders Elements
It is currently being developed … in parallel with the platform and some
apps for the mentioned customer
Not production-ready yet
Notes
Girders Elements
React, React DOM or React Native, Redux and other core
libraries
Framework, Wiring, Configuration, UI Widgets
(Customisable, Skinnable)
Notes
Girders Elements
If you are very familiar with the concepts and libraries that I
mentioned -> use it and contribute to it
If you are not familiar with the concepts and libraries yet ->
wait for a few months
Girders Elements is still under development
Documentation is not there yet
But we will get there eventually
Corsin Decurtins, Netcetera
Chief Technology Officer
corsin.decurtins@netcetera.com
@corsin
reducerreducerreducerreducer reducerreducerreducerreducer
reducerreducerreducerreducer
Content-Driven Apps with React
Corsin Decurtins, Netcetera
2016-10-17
/Bern
BärnerJS

More Related Content

What's hot

What's hot (20)

React-js
React-jsReact-js
React-js
 
The productive developer guide to React
The productive developer guide to ReactThe productive developer guide to React
The productive developer guide to React
 
reactJS
reactJSreactJS
reactJS
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and Redux
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
React and redux
React and reduxReact and redux
React and redux
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
React js basics
React js basicsReact js basics
React js basics
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
React js
React jsReact js
React js
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Accessible web applications
Accessible web applications Accessible web applications
Accessible web applications
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 

Viewers also liked

Netcetera Innovation Summit 2016: The Past 12 Months - What's New & Exciting
Netcetera Innovation Summit 2016: The Past 12 Months - What's New & ExcitingNetcetera Innovation Summit 2016: The Past 12 Months - What's New & Exciting
Netcetera Innovation Summit 2016: The Past 12 Months - What's New & ExcitingNetcetera
 
SwissWallet - Die digitale Währung heisst Vertrauen
SwissWallet - Die digitale Währung heisst Vertrauen SwissWallet - Die digitale Währung heisst Vertrauen
SwissWallet - Die digitale Währung heisst Vertrauen Netcetera
 
Die Herausforderungen in der Payment-Industrie
Die Herausforderungen in der Payment-IndustrieDie Herausforderungen in der Payment-Industrie
Die Herausforderungen in der Payment-IndustrieNetcetera
 
How to sell your company
How to sell your company How to sell your company
How to sell your company Netcetera
 
Managers - The Missing Manual
Managers - The Missing ManualManagers - The Missing Manual
Managers - The Missing ManualNetcetera
 
SkopjePulse: Designing a better city with IoT
SkopjePulse: Designing a better city with IoTSkopjePulse: Designing a better city with IoT
SkopjePulse: Designing a better city with IoTNetcetera
 
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016Netcetera now and in 20 Years - Netcetera Innovation Summit 2016
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016Netcetera
 
Introduction to 3rd sequencing
Introduction to 3rd sequencing Introduction to 3rd sequencing
Introduction to 3rd sequencing Eric Lee
 
Algorithm of NGS Data
Algorithm of NGS DataAlgorithm of NGS Data
Algorithm of NGS DataEric Lee
 
Genome sequences as media files
Genome sequences as media filesGenome sequences as media files
Genome sequences as media filestparidae
 
Curoverse Presentation at ICG-11 (November 2016)
Curoverse Presentation at ICG-11 (November 2016)Curoverse Presentation at ICG-11 (November 2016)
Curoverse Presentation at ICG-11 (November 2016)Arvados
 
Compact Genome Format
Compact Genome FormatCompact Genome Format
Compact Genome FormatArvados
 
Towards using multimedia technology for biological data processing
Towards using multimedia technology for biological data processingTowards using multimedia technology for biological data processing
Towards using multimedia technology for biological data processingWesley De Neve
 
Digital transformation of card payments - About SwissWallet
Digital transformation of card payments - About SwissWallet Digital transformation of card payments - About SwissWallet
Digital transformation of card payments - About SwissWallet Netcetera
 
Innovative Payment Solutions
Innovative Payment SolutionsInnovative Payment Solutions
Innovative Payment SolutionsNetcetera
 
Top Swiss Financial Institutions of 2016
Top Swiss Financial Institutions of 2016Top Swiss Financial Institutions of 2016
Top Swiss Financial Institutions of 2016Etienne Kiss-Borlase
 
COSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jCOSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jEric Lee
 
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...Wesley De Neve
 
Authentication requirements and application of PSD2 in e-Commerce - Presentat...
Authentication requirements and application of PSD2 in e-Commerce - Presentat...Authentication requirements and application of PSD2 in e-Commerce - Presentat...
Authentication requirements and application of PSD2 in e-Commerce - Presentat...Netcetera
 

Viewers also liked (20)

Netcetera Innovation Summit 2016: The Past 12 Months - What's New & Exciting
Netcetera Innovation Summit 2016: The Past 12 Months - What's New & ExcitingNetcetera Innovation Summit 2016: The Past 12 Months - What's New & Exciting
Netcetera Innovation Summit 2016: The Past 12 Months - What's New & Exciting
 
SwissWallet - Die digitale Währung heisst Vertrauen
SwissWallet - Die digitale Währung heisst Vertrauen SwissWallet - Die digitale Währung heisst Vertrauen
SwissWallet - Die digitale Währung heisst Vertrauen
 
Die Herausforderungen in der Payment-Industrie
Die Herausforderungen in der Payment-IndustrieDie Herausforderungen in der Payment-Industrie
Die Herausforderungen in der Payment-Industrie
 
How to sell your company
How to sell your company How to sell your company
How to sell your company
 
Managers - The Missing Manual
Managers - The Missing ManualManagers - The Missing Manual
Managers - The Missing Manual
 
SkopjePulse: Designing a better city with IoT
SkopjePulse: Designing a better city with IoTSkopjePulse: Designing a better city with IoT
SkopjePulse: Designing a better city with IoT
 
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016Netcetera now and in 20 Years - Netcetera Innovation Summit 2016
Netcetera now and in 20 Years - Netcetera Innovation Summit 2016
 
Introduction to 3rd sequencing
Introduction to 3rd sequencing Introduction to 3rd sequencing
Introduction to 3rd sequencing
 
Algorithm of NGS Data
Algorithm of NGS DataAlgorithm of NGS Data
Algorithm of NGS Data
 
Genome sequences as media files
Genome sequences as media filesGenome sequences as media files
Genome sequences as media files
 
Curoverse Presentation at ICG-11 (November 2016)
Curoverse Presentation at ICG-11 (November 2016)Curoverse Presentation at ICG-11 (November 2016)
Curoverse Presentation at ICG-11 (November 2016)
 
Compact Genome Format
Compact Genome FormatCompact Genome Format
Compact Genome Format
 
Towards using multimedia technology for biological data processing
Towards using multimedia technology for biological data processingTowards using multimedia technology for biological data processing
Towards using multimedia technology for biological data processing
 
Digital transformation of card payments - About SwissWallet
Digital transformation of card payments - About SwissWallet Digital transformation of card payments - About SwissWallet
Digital transformation of card payments - About SwissWallet
 
Innovative Payment Solutions
Innovative Payment SolutionsInnovative Payment Solutions
Innovative Payment Solutions
 
Top Swiss Financial Institutions of 2016
Top Swiss Financial Institutions of 2016Top Swiss Financial Institutions of 2016
Top Swiss Financial Institutions of 2016
 
COSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4jCOSCUP 2016 Workshop : 快快樂樂學Neo4j
COSCUP 2016 Workshop : 快快樂樂學Neo4j
 
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...
Deep Machine Learning for Making Sense of Biotech Data - From Clean Energy to...
 
Authentication requirements and application of PSD2 in e-Commerce - Presentat...
Authentication requirements and application of PSD2 in e-Commerce - Presentat...Authentication requirements and application of PSD2 in e-Commerce - Presentat...
Authentication requirements and application of PSD2 in e-Commerce - Presentat...
 
2015 genome-center
2015 genome-center2015 genome-center
2015 genome-center
 

Similar to Content-Driven Apps with React

React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 
Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Katy Slemon
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malikLama K Banna
 
what is context API and How it works in React.pptx
what is context API and How it works in React.pptxwhat is context API and How it works in React.pptx
what is context API and How it works in React.pptxBOSC Tech Labs
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...Codemotion
 
React native - Unleash the power of your device
React native - Unleash the power of your deviceReact native - Unleash the power of your device
React native - Unleash the power of your deviceEduard Tomàs
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and reduxCuong Ho
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdfArthyR3
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react jsdhanushkacnd
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - Reactrbl002
 

Similar to Content-Driven Apps with React (20)

React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...
 
Intro react js
Intro react jsIntro react js
Intro react js
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malik
 
what is context API and How it works in React.pptx
what is context API and How it works in React.pptxwhat is context API and How it works in React.pptx
what is context API and How it works in React.pptx
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
 
ReactJS
ReactJSReactJS
ReactJS
 
React native - Unleash the power of your device
React native - Unleash the power of your deviceReact native - Unleash the power of your device
React native - Unleash the power of your device
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
Simple React Todo List
Simple React Todo ListSimple React Todo List
Simple React Todo List
 
SharePoint Framework y React
SharePoint Framework y ReactSharePoint Framework y React
SharePoint Framework y React
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
 
ReactJs
ReactJsReactJs
ReactJs
 
Copy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdfCopy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdf
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - React
 
React a11y-csun
React a11y-csunReact a11y-csun
React a11y-csun
 

More from Netcetera

Payment trend scouting - Kurt Schmid, Netcetera
Payment trend scouting - Kurt Schmid, NetceteraPayment trend scouting - Kurt Schmid, Netcetera
Payment trend scouting - Kurt Schmid, NetceteraNetcetera
 
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, Netcetera
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, NetceteraBoost your approved transaction volume - Ana Vuksanovikj Vaneska, Netcetera
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, NetceteraNetcetera
 
Increase conversion, convenience and security in e-commerce checkouts - Silke...
Increase conversion, convenience and security in e-commerce checkouts - Silke...Increase conversion, convenience and security in e-commerce checkouts - Silke...
Increase conversion, convenience and security in e-commerce checkouts - Silke...Netcetera
 
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORMNetcetera
 
Digital Payment in 2020 - Kurt Schmid, Netcetera
Digital Payment in 2020 - Kurt Schmid, NetceteraDigital Payment in 2020 - Kurt Schmid, Netcetera
Digital Payment in 2020 - Kurt Schmid, NetceteraNetcetera
 
AI First. Erfolgsfaktoren für künstliche Intelligenz im Unternehmen
AI First. Erfolgsfaktoren für künstliche Intelligenz im UnternehmenAI First. Erfolgsfaktoren für künstliche Intelligenz im Unternehmen
AI First. Erfolgsfaktoren für künstliche Intelligenz im UnternehmenNetcetera
 
Augmenting Maintenance
Augmenting MaintenanceAugmenting Maintenance
Augmenting MaintenanceNetcetera
 
Front-end up front
Front-end up frontFront-end up front
Front-end up frontNetcetera
 
The future of Prototpying
The future of PrototpyingThe future of Prototpying
The future of PrototpyingNetcetera
 
EMV Secure Remote Commerce (SRC)
EMV Secure Remote Commerce (SRC)EMV Secure Remote Commerce (SRC)
EMV Secure Remote Commerce (SRC)Netcetera
 
Online shopping technology in the fast lane?
Online shopping technology in the fast lane?Online shopping technology in the fast lane?
Online shopping technology in the fast lane?Netcetera
 
Merchant tokenization and EMV® Secure Remote Commerce
Merchant tokenization and EMV® Secure Remote CommerceMerchant tokenization and EMV® Secure Remote Commerce
Merchant tokenization and EMV® Secure Remote CommerceNetcetera
 
Seamless 3-D Secure e-commerce experience
Seamless 3-D Secure e-commerce experienceSeamless 3-D Secure e-commerce experience
Seamless 3-D Secure e-commerce experienceNetcetera
 
Augmenting Health Care
Augmenting Health CareAugmenting Health Care
Augmenting Health CareNetcetera
 
Driving transactional growth with 3-D Secure
Driving transactional growth with 3-D SecureDriving transactional growth with 3-D Secure
Driving transactional growth with 3-D SecureNetcetera
 
Digital Payment Quo Vadis
Digital Payment Quo VadisDigital Payment Quo Vadis
Digital Payment Quo VadisNetcetera
 
EMV® Secure Remote Commerce
EMV® Secure Remote CommerceEMV® Secure Remote Commerce
EMV® Secure Remote CommerceNetcetera
 
Context: The missing ingredient in multilingual software translation
Context: The missing ingredient in multilingual software translationContext: The missing ingredient in multilingual software translation
Context: The missing ingredient in multilingual software translationNetcetera
 
Digital Payments - Netcetera Innovation Summit 2018
Digital Payments - Netcetera Innovation Summit 2018Digital Payments - Netcetera Innovation Summit 2018
Digital Payments - Netcetera Innovation Summit 2018Netcetera
 
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018Netcetera
 

More from Netcetera (20)

Payment trend scouting - Kurt Schmid, Netcetera
Payment trend scouting - Kurt Schmid, NetceteraPayment trend scouting - Kurt Schmid, Netcetera
Payment trend scouting - Kurt Schmid, Netcetera
 
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, Netcetera
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, NetceteraBoost your approved transaction volume - Ana Vuksanovikj Vaneska, Netcetera
Boost your approved transaction volume - Ana Vuksanovikj Vaneska, Netcetera
 
Increase conversion, convenience and security in e-commerce checkouts - Silke...
Increase conversion, convenience and security in e-commerce checkouts - Silke...Increase conversion, convenience and security in e-commerce checkouts - Silke...
Increase conversion, convenience and security in e-commerce checkouts - Silke...
 
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM
3-D Secure 2.0 - Stephan Rüdisüli, Netcetera & Patrick Juffern, INFORM
 
Digital Payment in 2020 - Kurt Schmid, Netcetera
Digital Payment in 2020 - Kurt Schmid, NetceteraDigital Payment in 2020 - Kurt Schmid, Netcetera
Digital Payment in 2020 - Kurt Schmid, Netcetera
 
AI First. Erfolgsfaktoren für künstliche Intelligenz im Unternehmen
AI First. Erfolgsfaktoren für künstliche Intelligenz im UnternehmenAI First. Erfolgsfaktoren für künstliche Intelligenz im Unternehmen
AI First. Erfolgsfaktoren für künstliche Intelligenz im Unternehmen
 
Augmenting Maintenance
Augmenting MaintenanceAugmenting Maintenance
Augmenting Maintenance
 
Front-end up front
Front-end up frontFront-end up front
Front-end up front
 
The future of Prototpying
The future of PrototpyingThe future of Prototpying
The future of Prototpying
 
EMV Secure Remote Commerce (SRC)
EMV Secure Remote Commerce (SRC)EMV Secure Remote Commerce (SRC)
EMV Secure Remote Commerce (SRC)
 
Online shopping technology in the fast lane?
Online shopping technology in the fast lane?Online shopping technology in the fast lane?
Online shopping technology in the fast lane?
 
Merchant tokenization and EMV® Secure Remote Commerce
Merchant tokenization and EMV® Secure Remote CommerceMerchant tokenization and EMV® Secure Remote Commerce
Merchant tokenization and EMV® Secure Remote Commerce
 
Seamless 3-D Secure e-commerce experience
Seamless 3-D Secure e-commerce experienceSeamless 3-D Secure e-commerce experience
Seamless 3-D Secure e-commerce experience
 
Augmenting Health Care
Augmenting Health CareAugmenting Health Care
Augmenting Health Care
 
Driving transactional growth with 3-D Secure
Driving transactional growth with 3-D SecureDriving transactional growth with 3-D Secure
Driving transactional growth with 3-D Secure
 
Digital Payment Quo Vadis
Digital Payment Quo VadisDigital Payment Quo Vadis
Digital Payment Quo Vadis
 
EMV® Secure Remote Commerce
EMV® Secure Remote CommerceEMV® Secure Remote Commerce
EMV® Secure Remote Commerce
 
Context: The missing ingredient in multilingual software translation
Context: The missing ingredient in multilingual software translationContext: The missing ingredient in multilingual software translation
Context: The missing ingredient in multilingual software translation
 
Digital Payments - Netcetera Innovation Summit 2018
Digital Payments - Netcetera Innovation Summit 2018Digital Payments - Netcetera Innovation Summit 2018
Digital Payments - Netcetera Innovation Summit 2018
 
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018
"Whats up and new at Netcetera?" - Netcetera Innovation Summit 2018
 

Recently uploaded

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

Content-Driven Apps with React

  • 1. Content-Driven Apps with React Corsin Decurtins, Netcetera 2016-10-17 /Bern BärnerJS
  • 2. Notes Content-Driven Apps with React This talk is a story about a family of projects or apps Actually not just individual apps, but app platforms Same team, same technology (roughly) Multiple projects, multiple apps, multiple customers But the same kind of app or actually app platform Mobile app, heavily content driven Customers are publishers, users are readers It all started with a proof-of-concept…
  • 3.
  • 4. Notes Proof of Concept Customer had a hybrid mobile app, Cordova and Angular (1) It was too slow for them, which resulted in a bad UX PoC done with React to see if we can improve the performance In particular the performance of the home page / start screen PoC showed, that we can Goal was a 50% improvement, he had up to 80% improvement This talk is about the app architecture that started with this PoC But it will be about anything but performance
  • 6. Notes Disclaimers I’m just the person giving the talk; other people did the actual work If something is wrong or does not make sense, it’s probably me who messed it up I’m familiar with the architecture, design and technologies If you have very detailed questions about the implementation, I will refer you to my colleagues
  • 7. Ognen Ivanovski, Netcetera Principal Architect Andon Sikavica, Netcetera Senior Software Engineer
  • 8. Notes Who are you? Who is already familiar with… … React … React Native … Redux … Immutable Data, ImmutableJS … Pure Functions, Functional Programming
  • 11. Redux
  • 16. Notes Web-Based Hybrid Mobile Apps Mobile apps for smartphones and tablets Hybrid, i.e. one code base for all the platforms Based on web technologies, i.e. HTML, Javascript, CSS and JSON Based on web tooling (debuggers, CSS, NPM, gulp, ECMAScript, …) Cordova is the most common runtime platform for creating packaged apps that can be delivered to the app store
  • 18. Notes Web-Based Hybrid Mobile Apps Web based can be interpreted loosely Instead of HTML, other markup is possible, including markup for native components Also not restricted to mobile apps, you can build other apps as well Not even restricted to apps, can be used for “websites”
  • 20. Notes Content-Driven Apps Mobile apps that are mostly used to consume and browse through content News apps for example Get content from a server Content from the server determines the screens, the interaction and the navigation The browser is probably the ultimate example
  • 21. Notes Content-Driven Apps We started out with news apps for publishers But there are a lot of other examples
  • 24. Notes Architecture Client App, JS, packaged with Cordova Libraries, Widgets, Generic Platform Code These are part of the platform and the same for all the apps of the platform App-specific configuration and skinning Content is retrieved from the server-side through an API Abstracts various backend systems such as the CMS, DAM, … API might have a server-side cache
  • 25. Notes Challenges App Platform vs. just an app Reuse of code, platform, configuration, customising, skinning API Evolution Apps are deployed, no instant updates Performance, User Experience (UX) Time-To-Market and Price
  • 27. React
  • 28.
  • 29. Notes React Components Tree of React Components JS objects, can be as simple as one function Every component has a render() function Can be static (children are hard-coded in the parent) or dynamic (children are added based on data of the parent- components)
  • 30.
  • 31. Notes State Every React component can have an inner state State is optional State must only be manipulated through an defined interface Gives React a chance to know when the state has changed and the component needs to be re-rendered
  • 32.
  • 33. Notes Attributes In addition to the internal state, React components can also receive data from parent components through attributes Can be used for rendering Can be used for initialising state
  • 34. const CommentForm = React.createClass({ getInitialState: () => { return {author: '', text: ''}; }, handleAuthorChange: (e) => { this.setState({author: e.target.value}); }, handleTextChange: (e) => { this.setState({text: e.target.value}); }, handleSubmit: (e) => { e.preventDefault(); // do something }, ... });
  • 35. const CommentForm = React.createClass({ ... render: function() { return ( <form className="commentForm" onSubmit={this.handleSubmit}> <input type=“text" placeholder="Your name" value={this.state.author} onChange={this.handleAuthorChange} /> <input type=“text" placeholder="Say something..." value={this.state.text} onChange={this.handleTextChange} /> <input type="submit" value="Post" /> </form> ); } });
  • 37. Notes React Rendering React Components have a render() function that produces HTML Actually it produces a tree of objects that correspond to HTML The React Components are rendered into a Virtual DOM first The Virtual DOM is then rendered into the actual DOM
  • 38. Notes React Rendering Pure Functions for the transformations (aka rendering) Events flow in reverse to the transformation flow React Optimisations Propagate diffs rather than new trees Lots and lots of checks for changes for trees and subtrees Modify data (state or attributes) only through well-defined interfaces
  • 41. Notes Immutable Data Data cannot be changed Every change results in a new copy of a data structure Optimisation: Data structure can contain references to data of other data structures (since they can never change) Equality check with immutable data becomes very efficient Check if the reference is the same React change check (shouldComponentUpdate) can be implemented very efficiently
  • 42. Redux
  • 43. Dan Abramov Hot Reloading with Time Travel https://youtu.be/xsSnOQynTHs
  • 45. const newsReducer = (state = {}, action) => {
 
 if (action.type === ‘NEWS_UPDATE’) {
 return Object.assign( {}, state, {stories: action.stories} );
 }
 
 return state;
 };
  • 46. Notes Redux Application state consists of one state object React components do not have a state anymore Application state is passed into React as an attribute Reducers handle all the events and transfer the app from one state into another Creation of the React Component tree is a pure function Rendering of the React Component tree is a pure function Reducers are pure functions
  • 48. Notes Loading Content from the Server (or from a local cache)
  • 49. Content API { "kind": ["image", "diagram"], "imageUrl": “http://example.com/diagram.png" "caption": “Super Cool Diagram" }
  • 50. Notes Content API Objects in the content tree are called elements Kind describes the (hierarchical) type of an element Additional type-specific attributes are part of the element Above example is the element description for an image Can for example be a nice diagram Customer wants to add support for an interactive diagram (zoom and pan, play around with values, …) Create a new element, support on the CMS and in the app Create the new element as an extension/refinement of the old one
  • 51. Content API { "kind": [“image”, “diagram”, “interactive”], “dataUrl”: “https://example.com/data/diagram.json”, "imageUrl": “https://example.com/diagram.png" "caption": “Super Cool Diagram" }
  • 52. Notes Content API New sub-type ‘interactive’ Data URL for loading the data for the diagram But the component is also an [‘image’, ‘diagram’] with ‘imageUrl’ and ‘caption’ If a client does not support ‘interactive’ yet, the component can also just be rendered as an image/diagram
  • 54. Notes Loading Content (Simplified) Reducer triggers a request for loading content Technically, this is a side-effect and the reducer is not a pure function anymore Side-Effect is on an external system, asynchronous handling When the data arrives, that triggers a new event for the reducers Data passes through a series of transformers (“pure” functions) that transform the received data into data that can be incorporated into the application state … as well as side-effect events for loading additional data
  • 55. Notes React / Redux / Immutable Pure functions everywhere Logically, everything is immutable and pure functions Physically, React makes optimisations
  • 56. Notes Interesting Properties Serialisable application state Testing Time-Machine Performance Code Quality Code Reuse
  • 59. Notes Web Applications Nothing mentioned above is specific to mobile apps You can also use the architecture for “normal” web applications Desktop web applications, mobile apps, responsive apps, …
  • 62. Notes React Native Relatively recent extension of the React Framework Everything remains the same, React Components and if you use it Redux, … Instead of rendering HTML objects (using ReactDOM and JSX), you render markup for Native Components Native Runtime, Native Apps, Javascript as Scripting Engine Native Performance, but still Hybrid
  • 64. React Components Virtual DOM HTML Document HTML
  • 65. Notes Server-Side Rendering React Components can be rendered into a string HTML code only HTML code is dead, i.e. it does not contain any active parts (Javascript) Can be used for pre-rendering on the server-side Make content available for search engine and other non-browser clients Testing
  • 69. Notes Technologies and Concepts Technology choices have a big impact on design and fundamental concepts React, Redux and other members of this family have a clear heritage of functional programming This has a learning curve It takes some time until you “get it” And then it takes some more time until you really “get it” Concepts are very different from what our developers were used too There was a learning curve until it really clicks
  • 70. Notes Technologies and Concepts Some things seem unnecessarily complicated and limiting Most of the time, they are actually not They seem complicated, because they are unfamiliar and you have not started to think in a React/Redux/Functional way Code Base in the end is much more fragmented More small granular components than with other core technologies Complexity is still smaller though, because the small components follow very clear, simple and orthogonal concepts
  • 71. Notes Technologies and Concepts Concepts (and technologies) allow for really cool and helpful things Testing, Time-Machine, React DevTools Clean, simple, well-abstracted and clean code Reusable and extensible code Content API allows for very powerful customisation and extension … of existing apps and use cases
  • 73. Notes Girders Elements We had the chance to go through multiple iterations with the described architecture Both with React DOM and React Native One of the current customers gave us the chance to extract the core framework of the architecture and open-source it This is called Girders Elements It is currently being developed … in parallel with the platform and some apps for the mentioned customer Not production-ready yet
  • 74. Notes Girders Elements React, React DOM or React Native, Redux and other core libraries Framework, Wiring, Configuration, UI Widgets (Customisable, Skinnable)
  • 75. Notes Girders Elements If you are very familiar with the concepts and libraries that I mentioned -> use it and contribute to it If you are not familiar with the concepts and libraries yet -> wait for a few months Girders Elements is still under development Documentation is not there yet But we will get there eventually
  • 76. Corsin Decurtins, Netcetera Chief Technology Officer corsin.decurtins@netcetera.com @corsin
  • 78. Content-Driven Apps with React Corsin Decurtins, Netcetera 2016-10-17 /Bern BärnerJS