Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Lessons learned: Architecting react apps
Ankita Kulkarni
September 15, 2020
Technology
1
74
Lessons learned: Architecting react apps
Ankita Kulkarni
September 15, 2020
Tweet
Share
More Decks by Ankita Kulkarni
See All by Ankita Kulkarni
5 things you must know to take your Next app to the next level
kulkarniankita09
0
37
Oh Hello Apollo client, Goodbye Redux!
kulkarniankita09
1
320
Beyond the React Native Benchmark
kulkarniankita09
0
11
Accessibility 360 - Web -> Mobile
kulkarniankita09
0
21
Make your React Native apps accessible 🙌
kulkarniankita09
0
87
Let's fight - Redux side-effects showdown
kulkarniankita09
0
110
The Art of Humanizing Pull Requests
kulkarniankita09
0
270
Being Agile - Scrum and Extreme Programming
kulkarniankita09
0
38
Other Decks in Technology
See All in Technology
Who owns the Service Level?
chaspy
5
590
失敗しない条件付きアクセス Season 3
sophiakunii
0
1.1k
Web Intelligence and Visual Media Analytics
weblyzard
PRO
1
2.8k
Power BI Premiumでデータ準備!
hanaseleb
1
170
jaws-ug-asa-datasync-20220510
hiashisan
0
430
20220510_簡単にできるコスト異常検出(Cost Anomaly Detection) /jaws-ug-asa-cost-anomaly-detection-20220510
emiki
2
300
Microsoft 365の中でのPower BIの利用 / M365VM2022
ishiayaya
0
1.3k
LINEのData Platform室が実践する大規模分散環境のCapacity Planning
line_developers
PRO
0
140
Power BI ”を” 可視化しよう!
hanaseleb
0
140
Devに力を授けたいSREのあゆみ / SRE that wants to empower developers
tocyuki
3
390
Power BI Report Ops
hanaseleb
0
140
Power BIのモバイルと都 +1 / Tokyo
ishiayaya
0
130
Featured
See All Featured
A designer walks into a library…
pauljervisheath
196
16k
Thoughts on Productivity
jonyablonski
43
2.2k
Bash Introduction
62gerente
596
210k
Building Adaptive Systems
keathley
25
1.1k
Designing the Hi-DPI Web
ddemaree
272
32k
Visualization
eitanlees
124
11k
The Illustrated Children's Guide to Kubernetes
chrisshort
14
34k
Making Projects Easy
brettharned
98
4.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
15k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.4k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
11
4.6k
Designing on Purpose - Digital PM Summit 2013
jponch
106
5.6k
Transcript
@kulkarniankita9 10 consulting lessons: architecting react apps Ankita Kulkarni, Tech
Lead, Loblaw Digital
@kulkarniankita9 Hi, I’m Ankita!
@kulkarniankita9 What have I built?
@kulkarniankita9
@kulkarniankita9 Use cases • Monitor your credit score - using
biometrics • Food delivery app • Reporting
@kulkarniankita9
@kulkarniankita9 1. Project structure
@kulkarniankita9 Directory structure index.js src auth index.js actions/epic/reducer/selector common components
button primaryButton/secondaryButton/tertiaryButton utils constants store storybook locale Modules
@kulkarniankita9 Challenges • A lot of shared context made it
difficult to share code Vertical slicing modules eg: auth, biometrics
@kulkarniankita9 2. React context and state management
@kulkarniankita9 Project
@kulkarniankita9 Is Context a state management solution?
@kulkarniankita9 Does Context replace redux?
@kulkarniankita9 Do you need redux?
@kulkarniankita9 We couldn’t get rid of state management library
@kulkarniankita9 Common context examples ✨ • Auth context • Orders
context
@kulkarniankita9 Challenges • Context was used as a state management
solution When the app was small, this worked fine but not when it grew Look into a state management solution Examples: Redux, Apollo cache
@kulkarniankita9 3. How storybook helped and evolved?
@kulkarniankita9 What is storybook?
@kulkarniankita9 Storybook is
@kulkarniankita9 Design tokens
@kulkarniankita9 Component library
@kulkarniankita9 Examples
@kulkarniankita9 4. With ❤ and without GQL
@kulkarniankita9 What is GQL? • Only get what you ask
for
@kulkarniankita9 Without GQL
@kulkarniankita9 Without GQL
@kulkarniankita9 With GQL
@kulkarniankita9 With GQL
@kulkarniankita9 Challenges • We were missing data transformation using Apollo
hooks Added validation on top of this to check for null values
@kulkarniankita9 5. Performance
@kulkarniankita9 Container and presentational components
@kulkarniankita9 • Container and Presentational components • Use memoization •
Use pure functions • Code splitting
@kulkarniankita9 6. Documentation and on-boarding
@kulkarniankita9 Docs! • Add a task to add some documentation
to every Jira ticket • Practice what you preach
@kulkarniankita9 7. Accessibility
@kulkarniankita9 React a11y • https://github.com/dequelabs/react-axe • Lighthouse
@kulkarniankita9 Lighthouse
@kulkarniankita9 8. With hooks ⚓
@kulkarniankita9 Common hooks ✨ • Translation hook • Accessibility hook
for reducing motion • Responsive breakpoints
@kulkarniankita9 9. Testing
@kulkarniankita9 What gave us more confidence?
@kulkarniankita9 Testing • Unit testing • React component testing: react-testing-library
• API data transformation layer testing • Integration testing • Automation testing
@kulkarniankita9 10. Forms are hard, use a library
@kulkarniankita9
@kulkarniankita9 Libraries used • Formik • redux-form
@kulkarniankita9 Example
@kulkarniankita9 Design pattern • Multi-step sign-up process • JSON form
builder
@kulkarniankita9 Bonus: Be Empathetic!
@kulkarniankita9 This is pretty much the end.. Questions? Comments? Feedback…make
it positive— Catch me after!!
@kulkarniankita9 You did it