SlideShare a Scribd company logo
React in 2018
by Michael Yagudaev
About Michael
• Co-Founder @ Nano 3 Labs & PictureThat

• Full-stack Developer Rails/React

• Been working with React since 2014

• Web dev since 2001

• Passionate about AR

• Fun Fact: Snowboarding is my freedom
Outline
• The Web Before React
• The History of React
• Lessons We Learned
• Our hope for a better tomorrow
Before React
2006
2010
2010
2010-2011
React is Born!
• In May 2013, Facebook brought us React
• Idea for Virtual DOM came from Doom 3 Engine
• Based on solid Computer Science design principles:
• Composition
• Encapsulation
• Unidirectional dependency
Flux Architecture
• In 2014 Facebook introduced us to Flux
• Solved the problem of State management on a global
(application) level
Redux is Born
• In 2015 Dan Abramov introduced us to Redux
• Inspired by Flux and Elm
• Single store architecture
• Composable reducers
• Focus on immutable data
Create React App is Born
• In 2016 we got a zero-config, official way to start a
react project
• Comes with
• Webpack
• Jest Test framework
• ES6
• ESLint
2017
• Static Typing became important: TypeScript
• GraphQL as Replacement of REST
+
2018?
• Let’s switch gears…
• What else do we need to create a real app?
• beyond create-react-app
• Is it really zero-config?
• wait, where is the server in all of this?
Apps We Want to Build
• Single Page Applications
• Responsive User Interface
• Easy for new developers to work with
• Extendable beyond browser, native desktop, mobile,
etc
• Fault tolerant (i.e. less bugs)
Let’s add the usual suspects
• Add eslint-config-standard
• Add React Router
• Add Redux
• Easy to do, just go to README and follow instructions
• Still… it takes time… :(
What about CSS?
• CSS is global scope, not great
• It is often used for state level changes (:hover, :visited,
.active)
• We need something better
• inline-styles are great, but there are better things:
• JSS or Styled Components
• See Material UI @ 1.0.0 for e.g.
How do we get data?
users
posts
Server
comments
users
posts
Client
comments
normalized normalized
REACT UI
REST/GraphQL
Http
Http
denormalized
Post 1
by John Doe
4 Comments
Post 2
by John Doe
7 Comments
Http
new
sync
How does it look like in
Redux?
{
users: {
items: {
1: { id: 1, name: 'Bob Smith', ... }
...
},
meta: { fetching: false, errors: [] }
}
posts: {
items: {
1: { id: 1, userId: 1, comments: [1, 2, 3] }
},
...
},
comments: { ... }
}
Redux (cont’d)
// actions/users.js
import { fetch } from 'fetch-redux-crud'
export const fetchUsers = _ => dispatch =>
dispatch(fetch('users', { path: 'users' }))
// reducers/users.js
import { reducersFor } from 'fetch-redux-crud'
export default reducersFor('users')
Redux (cont’d)
// selectors/users.js
import values from 'lodash/values'
const getUsers = (state) => values(state.users.items)
const getUsersById = (state) => state.users.items
// e.g. getUsersById(state)[2]
Where do you denormalize?
• Denormalize inside of selectors
• Before passing down to React
• Remember, keep the # of containers in the app low
Tips for using APIs
• Take only what you need (easier with GraphQL)
• Go through a single entry point e.g.`/lib/api.js`
• Keep it DRY, just because it is Redux
• look at `redux-crud` library
• Develop a naming convention for selectors
• Use React 16 Error Boundaries
File Structure
./src
actions/
components/
routes/
containers/
routes/
lib/
reducers/
selectors/
services/ <- optional
styles/ <- theme
index.js <- entry point
./tests
structure by type, than by feature
Wish List
• End-to-End Testing Framework
• create-react-app option to run a full-setup with redux
out-of-the-box
• Generators
• Library authors creating Test Helpers
Questions?
• twitter: @yagudaev, @nano3labs
• P.S. We’re Hiring…

More Related Content

What's hot

Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
Isuru Madusanka
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
Senthil Kumar
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
Kevin Ball
 
Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5
Brij Mishra
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
Brij Mishra
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQuery
Chris O'Connor
 
JetvsAdf
JetvsAdfJetvsAdf
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performance
Mike North
 
IBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with AngularjsIBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with Angularjs
Dominopoint - Italian Lotus User Group
 
Single page application
Single page applicationSingle page application
Single page application
Ismaeel Enjreny
 
Stencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven ZelekStencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven Zelek
IlyaDmitriev11
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6
Rob Eisenberg
 
Single page application
Single page applicationSingle page application
Single page application
Jeremy Lee
 
Scaling Tech in Asia
Scaling Tech in AsiaScaling Tech in Asia
Scaling Tech in Asia
Lester Chan
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
Ben McCormick
 
single page application
single page applicationsingle page application
single page application
Ravindra K
 
Getting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmetaGetting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmeta
Will Haire
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
John Need
 

What's hot (20)

Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
 
Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5
 
Asp.net
Asp.netAsp.net
Asp.net
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQuery
 
JetvsAdf
JetvsAdfJetvsAdf
JetvsAdf
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performance
 
IBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with AngularjsIBM Domino Modernizing apps with Angularjs
IBM Domino Modernizing apps with Angularjs
 
Single page application
Single page applicationSingle page application
Single page application
 
Stencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven ZelekStencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven Zelek
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6
 
Single page application
Single page applicationSingle page application
Single page application
 
Scaling Tech in Asia
Scaling Tech in AsiaScaling Tech in Asia
Scaling Tech in Asia
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
 
single page application
single page applicationsingle page application
single page application
 
Getting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmetaGetting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmeta
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 

Similar to React in 2018

An Angular developer moving to React
An Angular developer moving to ReactAn Angular developer moving to React
An Angular developer moving to React
Souvik Basu
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
Geoff Harcourt
 
Learning React - I
Learning React - ILearning React - I
Learning React - I
Mitch Chen
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
Mike Melusky
 
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettatoSalvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Codemotion
 
Drew madelung sp designer workflows - sp-biz
Drew madelung   sp designer workflows - sp-bizDrew madelung   sp designer workflows - sp-biz
Drew madelung sp designer workflows - sp-biz
Drew Madelung
 
React js
React jsReact js
React js
Nikhil Karkra
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
Mike Melusky
 
My Resume_Uday -
My Resume_Uday -My Resume_Uday -
My Resume_Uday -Uday Kiran
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAs
Jennifer Estrada
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
Derek Jacoby
 
SharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and ExamplesSharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and Examples
Drew Madelung
 
Suguk Southampton CodePlex - March 2014
Suguk Southampton   CodePlex - March 2014Suguk Southampton   CodePlex - March 2014
Suguk Southampton CodePlex - March 2014
Steven Andrews
 
How we built a job board in one week with JHipster
How we built a job board in one week with JHipsterHow we built a job board in one week with JHipster
How we built a job board in one week with JHipster
Kile Niklawski
 
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSAHow we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
Kile Niklawski
 
Sumit_SharePoint
Sumit_SharePointSumit_SharePoint
Sumit_SharePointSumit Y
 
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
FITC
 
Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.
TWG
 
2012.10 Oldfield
2012.10 Oldfield2012.10 Oldfield
2012.10 Oldfield
Emeldi Group
 

Similar to React in 2018 (20)

An Angular developer moving to React
An Angular developer moving to ReactAn Angular developer moving to React
An Angular developer moving to React
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Learning React - I
Learning React - ILearning React - I
Learning React - I
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettatoSalvatore Laisa - Da Angular a React - Un viaggio inaspettato
Salvatore Laisa - Da Angular a React - Un viaggio inaspettato
 
Drew madelung sp designer workflows - sp-biz
Drew madelung   sp designer workflows - sp-bizDrew madelung   sp designer workflows - sp-biz
Drew madelung sp designer workflows - sp-biz
 
React js
React jsReact js
React js
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
My Resume_Uday -
My Resume_Uday -My Resume_Uday -
My Resume_Uday -
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAs
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
SharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and ExamplesSharePoint Designer Workflows - Nuts, Bolts and Examples
SharePoint Designer Workflows - Nuts, Bolts and Examples
 
Resume
ResumeResume
Resume
 
Suguk Southampton CodePlex - March 2014
Suguk Southampton   CodePlex - March 2014Suguk Southampton   CodePlex - March 2014
Suguk Southampton CodePlex - March 2014
 
How we built a job board in one week with JHipster
How we built a job board in one week with JHipsterHow we built a job board in one week with JHipster
How we built a job board in one week with JHipster
 
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSAHow we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
How we built a job board in one week with JHipster - @KileNiklawski @IpponUSA
 
Sumit_SharePoint
Sumit_SharePointSumit_SharePoint
Sumit_SharePoint
 
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
 
Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.
 
2012.10 Oldfield
2012.10 Oldfield2012.10 Oldfield
2012.10 Oldfield
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

React in 2018

  • 1. React in 2018 by Michael Yagudaev
  • 2. About Michael • Co-Founder @ Nano 3 Labs & PictureThat • Full-stack Developer Rails/React • Been working with React since 2014 • Web dev since 2001 • Passionate about AR • Fun Fact: Snowboarding is my freedom
  • 3. Outline • The Web Before React • The History of React • Lessons We Learned • Our hope for a better tomorrow
  • 5. React is Born! • In May 2013, Facebook brought us React • Idea for Virtual DOM came from Doom 3 Engine • Based on solid Computer Science design principles: • Composition • Encapsulation • Unidirectional dependency
  • 6. Flux Architecture • In 2014 Facebook introduced us to Flux • Solved the problem of State management on a global (application) level
  • 7. Redux is Born • In 2015 Dan Abramov introduced us to Redux • Inspired by Flux and Elm • Single store architecture • Composable reducers • Focus on immutable data
  • 8. Create React App is Born • In 2016 we got a zero-config, official way to start a react project • Comes with • Webpack • Jest Test framework • ES6 • ESLint
  • 9. 2017 • Static Typing became important: TypeScript • GraphQL as Replacement of REST +
  • 10. 2018? • Let’s switch gears… • What else do we need to create a real app? • beyond create-react-app • Is it really zero-config? • wait, where is the server in all of this?
  • 11. Apps We Want to Build • Single Page Applications • Responsive User Interface • Easy for new developers to work with • Extendable beyond browser, native desktop, mobile, etc • Fault tolerant (i.e. less bugs)
  • 12. Let’s add the usual suspects • Add eslint-config-standard • Add React Router • Add Redux • Easy to do, just go to README and follow instructions • Still… it takes time… :(
  • 13. What about CSS? • CSS is global scope, not great • It is often used for state level changes (:hover, :visited, .active) • We need something better • inline-styles are great, but there are better things: • JSS or Styled Components • See Material UI @ 1.0.0 for e.g.
  • 14. How do we get data? users posts Server comments users posts Client comments normalized normalized REACT UI REST/GraphQL Http Http denormalized Post 1 by John Doe 4 Comments Post 2 by John Doe 7 Comments Http new sync
  • 15. How does it look like in Redux? { users: { items: { 1: { id: 1, name: 'Bob Smith', ... } ... }, meta: { fetching: false, errors: [] } } posts: { items: { 1: { id: 1, userId: 1, comments: [1, 2, 3] } }, ... }, comments: { ... } }
  • 16. Redux (cont’d) // actions/users.js import { fetch } from 'fetch-redux-crud' export const fetchUsers = _ => dispatch => dispatch(fetch('users', { path: 'users' })) // reducers/users.js import { reducersFor } from 'fetch-redux-crud' export default reducersFor('users')
  • 17. Redux (cont’d) // selectors/users.js import values from 'lodash/values' const getUsers = (state) => values(state.users.items) const getUsersById = (state) => state.users.items // e.g. getUsersById(state)[2]
  • 18. Where do you denormalize? • Denormalize inside of selectors • Before passing down to React • Remember, keep the # of containers in the app low
  • 19. Tips for using APIs • Take only what you need (easier with GraphQL) • Go through a single entry point e.g.`/lib/api.js` • Keep it DRY, just because it is Redux • look at `redux-crud` library • Develop a naming convention for selectors • Use React 16 Error Boundaries
  • 20. File Structure ./src actions/ components/ routes/ containers/ routes/ lib/ reducers/ selectors/ services/ <- optional styles/ <- theme index.js <- entry point ./tests structure by type, than by feature
  • 21. Wish List • End-to-End Testing Framework • create-react-app option to run a full-setup with redux out-of-the-box • Generators • Library authors creating Test Helpers
  • 22. Questions? • twitter: @yagudaev, @nano3labs • P.S. We’re Hiring…