SlideShare a Scribd company logo
1 of 39
Download to read offline
REACT FUNDAMENTALS
JAKARTA JS
Simon Sturmer
: @sstur_
CTO / Fouder - KodeFox
WHY REACT?
Part One
WHAT IS REACT?
▸ So you've heard the hype, but what is React?
▸ React is an opinionated View library.
▸ It is a fundamentally different way to build UIs.
▸ It leads to thinking in terms of pure functions and
immutability and other good practices.
WHY REACT?
▸ Why are so many top companies choosing React?
▸ Netflix, Yahoo, Apple, AirBnB, WhatsApp, CloudFlare,
Dropbox, Instagram, Twitter, Uber, WordPress even
SaleStock Indonesia
▸ Performance, Testability, Code Reuse
▸ Developer Experience.
WHY REACT?
▸ How is React different from Angular/Ember/etc?
▸ Everything is a component.
▸ A component is a pure function of application state.
▸ Components can be reused, composed to create other
components, isolated for testing.
▸ UI is easy to reason about as state changes over time.
REACT IS A BUSINESS
DECISION, NOT JUST A
TECHNOLOGY CHOICE!
REACT AS A BUSINESS DECISION
▸ Fewer, more versatile software engineers!
▸ Same dev team! Web, iOS, Android, Desktop
▸ Improved Testability, Reliability
▸ Performant by Default
▸ Real Code Reuse
▸ Velocity: shorten the edit-reload cycle; less time debugging
▸ Future proof: As your software evolves, replace individual
components.
WHY BUSINESSES STILL CHOOSE ANGULAR/EMBER?
▸ New tech can be overwhelming. Where to start?
▸ How to train your dev team?
▸ Some have large, legacy code-bases with a lot of
resources invested.
HOW IS REACT
DIFFERENT?
Part Two
WHAT PROBLEM DOES REACT TRY TO SOLVE?
▸ App state changing over time is hard to reason about.
▸ UI components get out of sync with each other and it's
hard to debug.
▸ When changes happen, we have to reach deep into our
view and mutate objects.
SHARED MUTABLE STATE IS
THE ROOT OF ALL EVIL
Pete Hunt, React.js Conf 2015
REACT + REDUX GIVES YOU IMMUTABLE STATE
REMEMBER THE OLD DAYS?
▸ Server-side Rendering
▸ Generating HTML views was easy!
▸ Why? … because we had the full application state at
one moment in time (a snapshot)
▸ All we have to do is query stuff and generate HTML
from that stuff.
▸ When an action happens, re-generate the entire view!
SERVER-SIDE RENDERING
SPRINKLING JS ON TOP
▸ Web apps slowly started doing more client-side
▸ DOM Manipulation: jQuery
▸ Client-side templating: mustache, handlebars
▸ Must wire-up events every time you generate new DOM
▸ Still need to manipulate the DOM!
EVENTS UPDATING VIEW
THE PROBLEM:
▸ There's way too much complexity around keeping your
app in a consistent state.
▸ It's almost impossible to reason about.
▸ The bookkeeping makes for a poor developer experience.
THE SOLUTION:
▸ We never had that problem with server-side rendering!
▸ … because we just re-generated the entire view when a
piece of state changed (url change).
▸ Can we do the same thing client-side?
CLIENT-SIDE FULL RE-RENDER
EVENTS UPDATING STATE
THAT'S EXACTLY
HOW REACT WORKS.
VIEW IS A FUNCTION OF STATE:
▸ This means you can reason about your view just like you
used to do with server-generated views.
▸ Your view is a deterministic function of your state.

(the same state will always produce the same view)
▸ Even if you serialize that state, save it to disk and restore it
next week.
MORE EXCELLENT

THINGS WILL FOLLOW
Once you start down this path…
YOU START DISCOVERING BONUS STUFF LIKE:
▸ Trivial undo/redo
▸ Easy hot-reloading during development
▸ Atomic/Optimistic updates
▸ Imagine if an HTTP request fails, you just load a
previously stable state
▸ Time-travel debugging
▸ Imagine stepping back in time through your app state
LET'S LOOK AT

SOME REACT CODE…
REACT VERSION OF PREVIOUS EXAMPLE
EVENTS JUST UPDATE STATE!
…but there are
<div>s in your JS!
IN REALITY IT WILL LOOK MORE LIKE THIS:
REACT ELEMENTS
▸ That stuff is JSX and it’s really incredible
▸ It looks weird at first, but it is just [optional] sugar.
▸ JSX:
▸ Concise Syntax
▸ Static code analysis
▸ Directly compiles to JS
COMPOSITION OF COMPONENTS
▸ You build view components from other view components
▸ This is extremely powerful.
▸ Benefits:
▸ Code Reuse
▸ Separation of Concerns
▸ Clean layers of abstraction
React leaves it up to you to
separate concerns however
you like.
MOST PEOPLE HAVE:
▸ Presentational components:
▸ Purely for layout/styling
▸ CSS designers can work on these
▸ Container components:
▸ Know about data structure and logic
▸ Don’t know anything about layout/styling
So what's the price
you pay for using React?
REACT DRAWBACKS:
▸ Some setup complexity. Choices can be overwhelming.
▸ A moderate learning curve
▸ React will change the way you think about your UI. This
takes some getting used to.
▸ Rapidly evolving ecosystem.
VASTLY OUTWEIGHS THE
COST.
But what you get in return…
DEVELOPER EXPERIENCE
▸ Move fast: shorten the edit-reload cycle; spend less time
debugging
▸ Write testable code!
▸ Iterate with confidence and build more reliable
software.
▸ Learn once, write anywhere
▸ Web, iOS, Android, Mac/Windows, even console apps
: @sstur_
https://kodefox.com
Simon Sturmer
Thanks!

More Related Content

What's hot

Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_jsMicroPyramid .
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to reactkiranabburi
 
Getting started with Redux js
Getting started with Redux jsGetting started with Redux js
Getting started with Redux jsCitrix
 
Best Practice-React
Best Practice-ReactBest Practice-React
Best Practice-ReactYang Yang
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with ReactjsThinh VoXuan
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop Ahmed rebai
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online TrainingLearntek1
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.jsEmanuele DelBono
 
Understanding Facebook's React.js
Understanding Facebook's React.jsUnderstanding Facebook's React.js
Understanding Facebook's React.jsFederico Torre
 
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 ReduxMaxime Najim
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Previewvaluebound
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil MemonRahilMemon5
 

What's hot (20)

How to Redux
How to ReduxHow to Redux
How to Redux
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
Reactjs
Reactjs Reactjs
Reactjs
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to react
 
Getting started with Redux js
Getting started with Redux jsGetting started with Redux js
Getting started with Redux js
 
React js
React jsReact js
React js
 
Best Practice-React
Best Practice-ReactBest Practice-React
Best Practice-React
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with Reactjs
 
React introduction
React introductionReact introduction
React introduction
 
React.js
React.jsReact.js
React.js
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
JOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and ReduxJOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and Redux
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
Understanding Facebook's React.js
Understanding Facebook's React.jsUnderstanding Facebook's React.js
Understanding Facebook's React.js
 
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: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil Memon
 

Viewers also liked

BWD Apr 2012 - Disruptive innovation
BWD Apr 2012 - Disruptive innovationBWD Apr 2012 - Disruptive innovation
BWD Apr 2012 - Disruptive innovationSimon Sturmer
 
The disaster of mutable state
The disaster of mutable stateThe disaster of mutable state
The disaster of mutable statekenbot
 
Teaching old java script new tricks
Teaching old java script new tricksTeaching old java script new tricks
Teaching old java script new tricksSimon Sturmer
 
APPSCoast Pitch Deck
APPSCoast Pitch DeckAPPSCoast Pitch Deck
APPSCoast Pitch DeckRiza Fahmi
 
Mobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurMobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurRiza Fahmi
 
Meteor Talk At TokoPedia
Meteor Talk At TokoPediaMeteor Talk At TokoPedia
Meteor Talk At TokoPediaRiza Fahmi
 
Sony lazuardi native mobile app with javascript
Sony lazuardi   native mobile app with javascriptSony lazuardi   native mobile app with javascript
Sony lazuardi native mobile app with javascriptPHP Indonesia
 
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons Learned
Building Scalable, Highly Concurrent & Fault Tolerant Systems -  Lessons LearnedBuilding Scalable, Highly Concurrent & Fault Tolerant Systems -  Lessons Learned
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons LearnedJonas Bonér
 
Muhammad azamuddin introduction-to-reactjs
Muhammad azamuddin   introduction-to-reactjsMuhammad azamuddin   introduction-to-reactjs
Muhammad azamuddin introduction-to-reactjsPHP Indonesia
 
Fellow Developers, Let's Discover Your Superpower
Fellow Developers, Let's Discover Your SuperpowerFellow Developers, Let's Discover Your Superpower
Fellow Developers, Let's Discover Your SuperpowerRiza Fahmi
 
Styling Your React App
Styling Your React AppStyling Your React App
Styling Your React AppRiza Fahmi
 
Mobile Programming - 3 UDP
Mobile Programming - 3 UDPMobile Programming - 3 UDP
Mobile Programming - 3 UDPRiza Fahmi
 
Serverless NodeJS With AWS Lambda
Serverless NodeJS With AWS LambdaServerless NodeJS With AWS Lambda
Serverless NodeJS With AWS LambdaRiza Fahmi
 
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapakBrief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapakRiza Fahmi
 
React Webinar With CodePolitan
React Webinar With CodePolitanReact Webinar With CodePolitan
React Webinar With CodePolitanRiza Fahmi
 
Team 101: How to Build The A Team For Your Startup
Team 101: How to Build The A Team For Your StartupTeam 101: How to Build The A Team For Your Startup
Team 101: How to Build The A Team For Your StartupRiza Fahmi
 

Viewers also liked (18)

BWD Apr 2012 - Disruptive innovation
BWD Apr 2012 - Disruptive innovationBWD Apr 2012 - Disruptive innovation
BWD Apr 2012 - Disruptive innovation
 
The disaster of mutable state
The disaster of mutable stateThe disaster of mutable state
The disaster of mutable state
 
Teaching old java script new tricks
Teaching old java script new tricksTeaching old java script new tricks
Teaching old java script new tricks
 
APPSCoast Pitch Deck
APPSCoast Pitch DeckAPPSCoast Pitch Deck
APPSCoast Pitch Deck
 
Mobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurMobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi Luhur
 
Meteor Talk At TokoPedia
Meteor Talk At TokoPediaMeteor Talk At TokoPedia
Meteor Talk At TokoPedia
 
Sony lazuardi native mobile app with javascript
Sony lazuardi   native mobile app with javascriptSony lazuardi   native mobile app with javascript
Sony lazuardi native mobile app with javascript
 
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons Learned
Building Scalable, Highly Concurrent & Fault Tolerant Systems -  Lessons LearnedBuilding Scalable, Highly Concurrent & Fault Tolerant Systems -  Lessons Learned
Building Scalable, Highly Concurrent & Fault Tolerant Systems - Lessons Learned
 
Muhammad azamuddin introduction-to-reactjs
Muhammad azamuddin   introduction-to-reactjsMuhammad azamuddin   introduction-to-reactjs
Muhammad azamuddin introduction-to-reactjs
 
Fellow Developers, Let's Discover Your Superpower
Fellow Developers, Let's Discover Your SuperpowerFellow Developers, Let's Discover Your Superpower
Fellow Developers, Let's Discover Your Superpower
 
Styling Your React App
Styling Your React AppStyling Your React App
Styling Your React App
 
Mobile Programming - 3 UDP
Mobile Programming - 3 UDPMobile Programming - 3 UDP
Mobile Programming - 3 UDP
 
Serverless NodeJS With AWS Lambda
Serverless NodeJS With AWS LambdaServerless NodeJS With AWS Lambda
Serverless NodeJS With AWS Lambda
 
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapakBrief Intro to Phoenix - Elixir Meetup at BukaLapak
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
 
Basic Operating System
Basic Operating SystemBasic Operating System
Basic Operating System
 
React Webinar With CodePolitan
React Webinar With CodePolitanReact Webinar With CodePolitan
React Webinar With CodePolitan
 
Team 101: How to Build The A Team For Your Startup
Team 101: How to Build The A Team For Your StartupTeam 101: How to Build The A Team For Your Startup
Team 101: How to Build The A Team For Your Startup
 
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
 

Similar to React Fundamentals - Jakarta JS, Apr 2016

Continuous Testing With React Storybook & WebdriverIO
Continuous Testing With React Storybook & WebdriverIOContinuous Testing With React Storybook & WebdriverIO
Continuous Testing With React Storybook & WebdriverIOJosh Cypher
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortalscgack
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernizationdevObjective
 
VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best PracticesFatih Acet
 
React js intro
React js introReact js intro
React js introJessica Le
 
Reactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOMReactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOMTamir Azrab
 
Redux at scale
Redux at scaleRedux at scale
Redux at scaleinovia
 
10 tips for Redux at scale
10 tips for Redux at scale10 tips for Redux at scale
10 tips for Redux at scaleinovia
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular SlidesJim Lynch
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistMark Fayngersh
 
7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challengesreactima
 
Review on React JS
Review on React JSReview on React JS
Review on React JSijtsrd
 
Reactjs workshop (1)
Reactjs workshop (1)Reactjs workshop (1)
Reactjs workshop (1)Ahmed rebai
 

Similar to React Fundamentals - Jakarta JS, Apr 2016 (20)

Intro to react_v2
Intro to react_v2Intro to react_v2
Intro to react_v2
 
Reactjs
ReactjsReactjs
Reactjs
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
Continuous Testing With React Storybook & WebdriverIO
Continuous Testing With React Storybook & WebdriverIOContinuous Testing With React Storybook & WebdriverIO
Continuous Testing With React Storybook & WebdriverIO
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernization
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernization
 
VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best Practices
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
React js intro
React js introReact js intro
React js intro
 
Reactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOMReactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOM
 
Redux at scale
Redux at scaleRedux at scale
Redux at scale
 
10 tips for Redux at scale
10 tips for Redux at scale10 tips for Redux at scale
10 tips for Redux at scale
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
React native
React nativeReact native
React native
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challenges
 
Review on React JS
Review on React JSReview on React JS
Review on React JS
 
Reactjs workshop (1)
Reactjs workshop (1)Reactjs workshop (1)
Reactjs workshop (1)
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

React Fundamentals - Jakarta JS, Apr 2016

  • 2. Simon Sturmer : @sstur_ CTO / Fouder - KodeFox
  • 4. WHAT IS REACT? ▸ So you've heard the hype, but what is React? ▸ React is an opinionated View library. ▸ It is a fundamentally different way to build UIs. ▸ It leads to thinking in terms of pure functions and immutability and other good practices.
  • 5. WHY REACT? ▸ Why are so many top companies choosing React? ▸ Netflix, Yahoo, Apple, AirBnB, WhatsApp, CloudFlare, Dropbox, Instagram, Twitter, Uber, WordPress even SaleStock Indonesia ▸ Performance, Testability, Code Reuse ▸ Developer Experience.
  • 6. WHY REACT? ▸ How is React different from Angular/Ember/etc? ▸ Everything is a component. ▸ A component is a pure function of application state. ▸ Components can be reused, composed to create other components, isolated for testing. ▸ UI is easy to reason about as state changes over time.
  • 7. REACT IS A BUSINESS DECISION, NOT JUST A TECHNOLOGY CHOICE!
  • 8. REACT AS A BUSINESS DECISION ▸ Fewer, more versatile software engineers! ▸ Same dev team! Web, iOS, Android, Desktop ▸ Improved Testability, Reliability ▸ Performant by Default ▸ Real Code Reuse ▸ Velocity: shorten the edit-reload cycle; less time debugging ▸ Future proof: As your software evolves, replace individual components.
  • 9. WHY BUSINESSES STILL CHOOSE ANGULAR/EMBER? ▸ New tech can be overwhelming. Where to start? ▸ How to train your dev team? ▸ Some have large, legacy code-bases with a lot of resources invested.
  • 11. WHAT PROBLEM DOES REACT TRY TO SOLVE? ▸ App state changing over time is hard to reason about. ▸ UI components get out of sync with each other and it's hard to debug. ▸ When changes happen, we have to reach deep into our view and mutate objects.
  • 12. SHARED MUTABLE STATE IS THE ROOT OF ALL EVIL Pete Hunt, React.js Conf 2015 REACT + REDUX GIVES YOU IMMUTABLE STATE
  • 13. REMEMBER THE OLD DAYS? ▸ Server-side Rendering ▸ Generating HTML views was easy! ▸ Why? … because we had the full application state at one moment in time (a snapshot) ▸ All we have to do is query stuff and generate HTML from that stuff. ▸ When an action happens, re-generate the entire view!
  • 15. SPRINKLING JS ON TOP ▸ Web apps slowly started doing more client-side ▸ DOM Manipulation: jQuery ▸ Client-side templating: mustache, handlebars ▸ Must wire-up events every time you generate new DOM ▸ Still need to manipulate the DOM!
  • 17. THE PROBLEM: ▸ There's way too much complexity around keeping your app in a consistent state. ▸ It's almost impossible to reason about. ▸ The bookkeeping makes for a poor developer experience.
  • 18. THE SOLUTION: ▸ We never had that problem with server-side rendering! ▸ … because we just re-generated the entire view when a piece of state changed (url change). ▸ Can we do the same thing client-side?
  • 20.
  • 23. VIEW IS A FUNCTION OF STATE: ▸ This means you can reason about your view just like you used to do with server-generated views. ▸ Your view is a deterministic function of your state.
 (the same state will always produce the same view) ▸ Even if you serialize that state, save it to disk and restore it next week.
  • 24. MORE EXCELLENT
 THINGS WILL FOLLOW Once you start down this path…
  • 25. YOU START DISCOVERING BONUS STUFF LIKE: ▸ Trivial undo/redo ▸ Easy hot-reloading during development ▸ Atomic/Optimistic updates ▸ Imagine if an HTTP request fails, you just load a previously stable state ▸ Time-travel debugging ▸ Imagine stepping back in time through your app state
  • 26. LET'S LOOK AT
 SOME REACT CODE…
  • 27. REACT VERSION OF PREVIOUS EXAMPLE
  • 29. …but there are <div>s in your JS!
  • 30. IN REALITY IT WILL LOOK MORE LIKE THIS:
  • 31. REACT ELEMENTS ▸ That stuff is JSX and it’s really incredible ▸ It looks weird at first, but it is just [optional] sugar. ▸ JSX: ▸ Concise Syntax ▸ Static code analysis ▸ Directly compiles to JS
  • 32. COMPOSITION OF COMPONENTS ▸ You build view components from other view components ▸ This is extremely powerful. ▸ Benefits: ▸ Code Reuse ▸ Separation of Concerns ▸ Clean layers of abstraction
  • 33. React leaves it up to you to separate concerns however you like.
  • 34. MOST PEOPLE HAVE: ▸ Presentational components: ▸ Purely for layout/styling ▸ CSS designers can work on these ▸ Container components: ▸ Know about data structure and logic ▸ Don’t know anything about layout/styling
  • 35. So what's the price you pay for using React?
  • 36. REACT DRAWBACKS: ▸ Some setup complexity. Choices can be overwhelming. ▸ A moderate learning curve ▸ React will change the way you think about your UI. This takes some getting used to. ▸ Rapidly evolving ecosystem.
  • 37. VASTLY OUTWEIGHS THE COST. But what you get in return…
  • 38. DEVELOPER EXPERIENCE ▸ Move fast: shorten the edit-reload cycle; spend less time debugging ▸ Write testable code! ▸ Iterate with confidence and build more reliable software. ▸ Learn once, write anywhere ▸ Web, iOS, Android, Mac/Windows, even console apps