Grokking TechTalk #16: React stack at lozi

React stack
@Lozi
lozi.vn
The front-end heaven
- New libraries everyday
- Project gets old after a few months
- You quickly become old-fashioned man/woman
2
The front-end heaven
- New libraries everyday
- Project gets old after a few months
- You quickly become old-fashioned man/woman
=> https://uptodate.frontendrescue.org/
3
React stack @Lozi
1. Isomorphic App
2. Trinity Force: React, React Router & Redux
3. Self-aware Component
4
by Thinh Nguyen Cuong - cuongthinh@lozi.vn
Web Developer at Lozi.vn
1. Isomorphic App
5
"Isomorphism is the functional aspect of
seamlessly switching between client- and
server-side rendering without losing state."
Source: https://reactjsnews.com/isomorphic-react-in-real-life
Concept
"Universal is a term used to emphasize the fact
that a particular piece of JavaScript code is
able to run in multiple environments."
@ghengeveld on Medium
1. Isomorphic App
6
Server-side Client-side
The kind-of Isomorphic React App
1. Isomorphic App
7
Source: https://reactjsnews.com/isomorphic-react-in-real-life
Concept Real life
8
Flummox: Nice and friendly and do-whatever-you-want Flux
⇒ Anti-pattern: “Cannot dispatch in a middle of a dispatch” a.k.a. Hard to make side effects
⇒ Hard to debug: data comes from nowhere
⇒ Took a lot of time to get on with the project, then to add new features
.
.
.
Life at Lozi before web v3.0
2. Trinity Force: React-React Router-Redux
9
React & React Router: API changes on each release, which
encourages you to build a new app, rather than upgrade the old one
2. Trinity Force: React-React Router-Redux
10
TONS OF
DAMAGE!!
React & React Router: API changes on each release, which
encourages you to build a new app, rather than upgrade the old one
Redux: Keeps you on the right track!
⇒ Completely “predictable”
⇒ Hot reloading & Time travel with Redux Devtool
⇒ Flummox’s creator (@acdlite) recommends Redux
2. Trinity Force: React-React Router-Redux
11
Source: http://slides.com/jenyaterpil/redux-from-twitter-hype-to-production
3. Self-aware Component?
12
Repeating this all the time
3. Self-aware Component?
A component that:
- Is a base component to be extended
- Can check if it has data in store
- Can fetch data from api on its own
- Decide to render itself, based on data status in store
13
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
14
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
15
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
16
The same with componentDidUpdate()
3. Self-aware Component
Self-aware Component required props:
- actionCreator(): Redux’s action object, API is fetched here
- dataGetter(): used in Redux’s connect() to get the specific data from the store
- params: used as params for actionCreator & dataGetter
17
3. Self-aware Component
But first, the component needs to be wrapped by Redux’s connect() so it can access the data.
18
A custom mapStateToProps() will execute dataGetter() to get the data for the component
1 of 18

Recommended

Grokking TechTalk #24: Kafka's principles and protocols by
Grokking TechTalk #24: Kafka's principles and protocolsGrokking TechTalk #24: Kafka's principles and protocols
Grokking TechTalk #24: Kafka's principles and protocolsGrokking VN
951 views67 slides
Apache kafka introduction by
Apache kafka introductionApache kafka introduction
Apache kafka introductionMohammad Mazharuddin
55 views9 slides
Kafka goutam chowdhury-unicom-spark kafka-summit by
Kafka goutam chowdhury-unicom-spark kafka-summitKafka goutam chowdhury-unicom-spark kafka-summit
Kafka goutam chowdhury-unicom-spark kafka-summitGoutam Chowdhury
491 views27 slides
Kafka 101 by
Kafka 101Kafka 101
Kafka 101Aparna Pillai
205 views23 slides
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafka by
Kafka Summit NYC 2017 - Deep Dive Into Apache KafkaKafka Summit NYC 2017 - Deep Dive Into Apache Kafka
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafkaconfluent
3.5K views31 slides
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field by
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the FieldKafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Fieldconfluent
5.4K views45 slides

More Related Content

What's hot

Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019 by
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019confluent
4.1K views51 slides
Kafka Connect by
Kafka ConnectKafka Connect
Kafka ConnectOleg Kuznetsov
546 views49 slides
Introduction to Apache Kafka by
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaAIMDek Technologies
1.8K views20 slides
Kafka 101 - Meetup Kafka BR - Oracle by
Kafka 101 - Meetup Kafka BR - OracleKafka 101 - Meetup Kafka BR - Oracle
Kafka 101 - Meetup Kafka BR - OracleFábio José Moraes
93 views22 slides
Confluent building a real-time streaming platform using kafka streams and k... by
Confluent   building a real-time streaming platform using kafka streams and k...Confluent   building a real-time streaming platform using kafka streams and k...
Confluent building a real-time streaming platform using kafka streams and k...Thomas Alex
624 views57 slides
APACHE KAFKA / Kafka Connect / Kafka Streams by
APACHE KAFKA / Kafka Connect / Kafka StreamsAPACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka StreamsKetan Gote
491 views29 slides

What's hot(20)

Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019 by confluent
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019
confluent4.1K views
Confluent building a real-time streaming platform using kafka streams and k... by Thomas Alex
Confluent   building a real-time streaming platform using kafka streams and k...Confluent   building a real-time streaming platform using kafka streams and k...
Confluent building a real-time streaming platform using kafka streams and k...
Thomas Alex624 views
APACHE KAFKA / Kafka Connect / Kafka Streams by Ketan Gote
APACHE KAFKA / Kafka Connect / Kafka StreamsAPACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka Streams
Ketan Gote491 views
Apache Kafka by emreakis
Apache KafkaApache Kafka
Apache Kafka
emreakis1.2K views
How Splunk Is Using Pulsar IO by StreamNative
How Splunk Is Using Pulsar IOHow Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IO
StreamNative567 views
Stream processing using Kafka by Knoldus Inc.
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
Knoldus Inc.1.6K views
Apache Kafka Architecture & Fundamentals Explained by confluent
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explained
confluent27.6K views
Building Linux IPv6 DNS Server (Third Review) by Hari
Building Linux IPv6 DNS Server (Third Review)Building Linux IPv6 DNS Server (Third Review)
Building Linux IPv6 DNS Server (Third Review)
Hari 301 views
Until Successful Scope With Mule ESB by Jitendra Bafna
Until Successful Scope With Mule ESBUntil Successful Scope With Mule ESB
Until Successful Scope With Mule ESB
Jitendra Bafna951 views

Viewers also liked

Grokking TechTalk #16: F**k bad CSS by
Grokking TechTalk #16: F**k bad CSSGrokking TechTalk #16: F**k bad CSS
Grokking TechTalk #16: F**k bad CSSGrokking VN
1K views74 slides
Grokking TechTalk #16: Maybe functor in javascript by
Grokking TechTalk #16: Maybe functor in javascriptGrokking TechTalk #16: Maybe functor in javascript
Grokking TechTalk #16: Maybe functor in javascriptGrokking VN
1.1K views23 slides
Grokking TechTalk #16: Html js and three way binding by
Grokking TechTalk #16: Html js and three way bindingGrokking TechTalk #16: Html js and three way binding
Grokking TechTalk #16: Html js and three way bindingGrokking VN
707 views22 slides
Grokking: Data Engineering Course by
Grokking: Data Engineering CourseGrokking: Data Engineering Course
Grokking: Data Engineering CourseGrokking VN
1.5K views7 slides
TechTalk #15 Grokking: The data processing journey at AhaMove by
TechTalk #15 Grokking:  The data processing journey at AhaMoveTechTalk #15 Grokking:  The data processing journey at AhaMove
TechTalk #15 Grokking: The data processing journey at AhaMoveGrokking VN
748 views14 slides
Responsive emails and ZURB Foundation for email by
Responsive emails and ZURB Foundation for emailResponsive emails and ZURB Foundation for email
Responsive emails and ZURB Foundation for emailGeoffroy Baylaender
868 views52 slides

Viewers also liked(13)

Grokking TechTalk #16: F**k bad CSS by Grokking VN
Grokking TechTalk #16: F**k bad CSSGrokking TechTalk #16: F**k bad CSS
Grokking TechTalk #16: F**k bad CSS
Grokking VN1K views
Grokking TechTalk #16: Maybe functor in javascript by Grokking VN
Grokking TechTalk #16: Maybe functor in javascriptGrokking TechTalk #16: Maybe functor in javascript
Grokking TechTalk #16: Maybe functor in javascript
Grokking VN1.1K views
Grokking TechTalk #16: Html js and three way binding by Grokking VN
Grokking TechTalk #16: Html js and three way bindingGrokking TechTalk #16: Html js and three way binding
Grokking TechTalk #16: Html js and three way binding
Grokking VN707 views
Grokking: Data Engineering Course by Grokking VN
Grokking: Data Engineering CourseGrokking: Data Engineering Course
Grokking: Data Engineering Course
Grokking VN1.5K views
TechTalk #15 Grokking: The data processing journey at AhaMove by Grokking VN
TechTalk #15 Grokking:  The data processing journey at AhaMoveTechTalk #15 Grokking:  The data processing journey at AhaMove
TechTalk #15 Grokking: The data processing journey at AhaMove
Grokking VN748 views
Hotel Vermont and Community Entrepreneurship (v2) by hansvw
Hotel Vermont and Community Entrepreneurship (v2)Hotel Vermont and Community Entrepreneurship (v2)
Hotel Vermont and Community Entrepreneurship (v2)
hansvw116 views
10 Weird Bans Around The World by ixigo.com
10 Weird Bans Around The World10 Weird Bans Around The World
10 Weird Bans Around The World
ixigo.com256 views
Employee advocacy - guide opérationnel by Alexandre George
Employee advocacy - guide opérationnelEmployee advocacy - guide opérationnel
Employee advocacy - guide opérationnel
Alexandre George1.2K views
Breaking the Server-Client Divide with Node.js and React by Dejan Glozic
Breaking the Server-Client Divide with Node.js and ReactBreaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic2.5K views

Similar to Grokking TechTalk #16: React stack at lozi

GITS Class #20: Building A Fast and Responsive UI in React Native by
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Indonesia
176 views23 slides
React gsg presentation with ryan jung & elias malik by
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malikLama K Banna
91 views32 slides
Redux by
ReduxRedux
ReduxMaulik Shah
146 views28 slides
Full Stack React Workshop [CSSC x GDSC] by
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
46 views45 slides
Beginning MEAN Stack by
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
1.5K views141 slides
A React Journey by
A React JourneyA React Journey
A React JourneyLinkMe Srl
925 views44 slides

Similar to Grokking TechTalk #16: React stack at lozi(20)

GITS Class #20: Building A Fast and Responsive UI in React Native by GITS Indonesia
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React Native
GITS Indonesia176 views
React gsg presentation with ryan jung & elias malik by Lama K Banna
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malik
Lama K Banna91 views
Beginning MEAN Stack by Rob Davarnia
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia1.5K views
A React Journey by LinkMe Srl
A React JourneyA React Journey
A React Journey
LinkMe Srl925 views
Better web apps with React and Redux by Ali Sa'o
Better web apps with React and ReduxBetter web apps with React and Redux
Better web apps with React and Redux
Ali Sa'o203 views
Corso su ReactJS by LinkMe Srl
Corso su ReactJSCorso su ReactJS
Corso su ReactJS
LinkMe Srl724 views
React Native +Redux + ES6 (Updated) by Chiew Carol
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
Chiew Carol694 views
How to implement Micro-frontends using Qiankun by Fibonalabs
How to implement Micro-frontends using QiankunHow to implement Micro-frontends using Qiankun
How to implement Micro-frontends using Qiankun
Fibonalabs95 views
Client-side Development 2016 by Huge
Client-side Development 2016Client-side Development 2016
Client-side Development 2016
Huge2.6K views
Plone FSR by fulv
Plone FSRPlone FSR
Plone FSR
fulv476 views
Reactive web applications by Juan Sandoval
Reactive web applicationsReactive web applications
Reactive web applications
Juan Sandoval339 views
an Introduction to Redux by Amin Ashtiani
an Introduction to Reduxan Introduction to Redux
an Introduction to Redux
Amin Ashtiani316 views
React JS: A Secret Preview by valuebound
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound3.3K views
Adventures building 3 realtime single-page apps 6 different ways by Henrik Joreteg
Adventures building 3 realtime single-page apps 6 different waysAdventures building 3 realtime single-page apps 6 different ways
Adventures building 3 realtime single-page apps 6 different ways
Henrik Joreteg2.2K views
Strange Async Code - ReaxtiveX by Matthew Will
Strange Async Code - ReaxtiveXStrange Async Code - ReaxtiveX
Strange Async Code - ReaxtiveX
Matthew Will216 views

More from Grokking VN

Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks by
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banksGrokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banksGrokking VN
698 views32 slides
Grokking Techtalk #45: First Principles Thinking by
Grokking Techtalk #45: First Principles ThinkingGrokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles ThinkingGrokking VN
276 views97 slides
Grokking Techtalk #42: Engineering challenges on building data platform for M... by
Grokking Techtalk #42: Engineering challenges on building data platform for M...Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...Grokking VN
199 views30 slides
Grokking Techtalk #43: Payment gateway demystified by
Grokking Techtalk #43: Payment gateway demystifiedGrokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystifiedGrokking VN
298 views35 slides
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster by
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking VN
1K views35 slides
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform by
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking VN
581 views25 slides

More from Grokking VN(20)

Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks by Grokking VN
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banksGrokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking VN698 views
Grokking Techtalk #45: First Principles Thinking by Grokking VN
Grokking Techtalk #45: First Principles ThinkingGrokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles Thinking
Grokking VN276 views
Grokking Techtalk #42: Engineering challenges on building data platform for M... by Grokking VN
Grokking Techtalk #42: Engineering challenges on building data platform for M...Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking VN199 views
Grokking Techtalk #43: Payment gateway demystified by Grokking VN
Grokking Techtalk #43: Payment gateway demystifiedGrokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystified
Grokking VN298 views
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster by Grokking VN
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking VN1K views
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform by Grokking VN
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking VN581 views
Grokking Techtalk #39: Gossip protocol and applications by Grokking VN
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
Grokking VN635 views
Grokking Techtalk #39: How to build an event driven architecture with Kafka ... by Grokking VN
 Grokking Techtalk #39: How to build an event driven architecture with Kafka ... Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking VN902 views
Grokking Techtalk #38: Escape Analysis in Go compiler by Grokking VN
 Grokking Techtalk #38: Escape Analysis in Go compiler Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking VN429 views
Grokking Techtalk #37: Data intensive problem by Grokking VN
 Grokking Techtalk #37: Data intensive problem Grokking Techtalk #37: Data intensive problem
Grokking Techtalk #37: Data intensive problem
Grokking VN823 views
Grokking Techtalk #37: Software design and refactoring by Grokking VN
 Grokking Techtalk #37: Software design and refactoring Grokking Techtalk #37: Software design and refactoring
Grokking Techtalk #37: Software design and refactoring
Grokking VN856 views
Grokking TechTalk #35: Efficient spellchecking by Grokking VN
Grokking TechTalk #35: Efficient spellcheckingGrokking TechTalk #35: Efficient spellchecking
Grokking TechTalk #35: Efficient spellchecking
Grokking VN877 views
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer... by Grokking VN
 Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer... Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking VN1.1K views
Grokking TechTalk #33: High Concurrency Architecture at TIKI by Grokking VN
Grokking TechTalk #33: High Concurrency Architecture at TIKIGrokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking VN2.6K views
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big... by Grokking VN
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking VN1.3K views
SOLID & Design Patterns by Grokking VN
SOLID & Design PatternsSOLID & Design Patterns
SOLID & Design Patterns
Grokking VN711 views
Grokking TechTalk #31: Asynchronous Communications by Grokking VN
Grokking TechTalk #31: Asynchronous CommunicationsGrokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #31: Asynchronous Communications
Grokking VN5.1K views
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale by Grokking VN
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at ScaleGrokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking VN528 views
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn by Grokking VN
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedInGrokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking VN639 views
Grokking TechTalk #27: Optimal Binary Search Tree by Grokking VN
Grokking TechTalk #27: Optimal Binary Search TreeGrokking TechTalk #27: Optimal Binary Search Tree
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking VN2.3K views

Recently uploaded

Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
53 views46 slides
SAP Automation Using Bar Code and FIORI.pdf by
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdfVirendra Rai, PMP
22 views38 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
13 views49 slides
Kyo - Functional Scala 2023.pdf by
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
298 views92 slides
Attacking IoT Devices from a Web Perspective - Linux Day by
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Simone Onofri
15 views68 slides
Transcript: The Details of Description Techniques tips and tangents on altern... by
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
135 views15 slides

Recently uploaded(20)

SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada135 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely12 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst476 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn21 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views

Grokking TechTalk #16: React stack at lozi

  • 2. The front-end heaven - New libraries everyday - Project gets old after a few months - You quickly become old-fashioned man/woman 2
  • 3. The front-end heaven - New libraries everyday - Project gets old after a few months - You quickly become old-fashioned man/woman => https://uptodate.frontendrescue.org/ 3
  • 4. React stack @Lozi 1. Isomorphic App 2. Trinity Force: React, React Router & Redux 3. Self-aware Component 4 by Thinh Nguyen Cuong - cuongthinh@lozi.vn Web Developer at Lozi.vn
  • 5. 1. Isomorphic App 5 "Isomorphism is the functional aspect of seamlessly switching between client- and server-side rendering without losing state." Source: https://reactjsnews.com/isomorphic-react-in-real-life Concept "Universal is a term used to emphasize the fact that a particular piece of JavaScript code is able to run in multiple environments." @ghengeveld on Medium
  • 6. 1. Isomorphic App 6 Server-side Client-side The kind-of Isomorphic React App
  • 7. 1. Isomorphic App 7 Source: https://reactjsnews.com/isomorphic-react-in-real-life Concept Real life
  • 8. 8 Flummox: Nice and friendly and do-whatever-you-want Flux ⇒ Anti-pattern: “Cannot dispatch in a middle of a dispatch” a.k.a. Hard to make side effects ⇒ Hard to debug: data comes from nowhere ⇒ Took a lot of time to get on with the project, then to add new features . . . Life at Lozi before web v3.0
  • 9. 2. Trinity Force: React-React Router-Redux 9 React & React Router: API changes on each release, which encourages you to build a new app, rather than upgrade the old one
  • 10. 2. Trinity Force: React-React Router-Redux 10 TONS OF DAMAGE!! React & React Router: API changes on each release, which encourages you to build a new app, rather than upgrade the old one Redux: Keeps you on the right track! ⇒ Completely “predictable” ⇒ Hot reloading & Time travel with Redux Devtool ⇒ Flummox’s creator (@acdlite) recommends Redux
  • 11. 2. Trinity Force: React-React Router-Redux 11 Source: http://slides.com/jenyaterpil/redux-from-twitter-hype-to-production
  • 13. 3. Self-aware Component? A component that: - Is a base component to be extended - Can check if it has data in store - Can fetch data from api on its own - Decide to render itself, based on data status in store 13
  • 14. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 14
  • 15. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 15
  • 16. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 16 The same with componentDidUpdate()
  • 17. 3. Self-aware Component Self-aware Component required props: - actionCreator(): Redux’s action object, API is fetched here - dataGetter(): used in Redux’s connect() to get the specific data from the store - params: used as params for actionCreator & dataGetter 17
  • 18. 3. Self-aware Component But first, the component needs to be wrapped by Redux’s connect() so it can access the data. 18 A custom mapStateToProps() will execute dataGetter() to get the data for the component