Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React Native Code Reuse: Architecture that Works
Search
Aaron Greenwald
September 13, 2016
Programming
1
690
React Native Code Reuse: Architecture that Works
Talk from React Native Tel Aviv (RN_TLV) meetup on the Wix roof, 2016/09/13
Aaron Greenwald
September 13, 2016
Tweet
Share
More Decks by Aaron Greenwald
See All by Aaron Greenwald
Learn Once, Write Anywhere: Intro to React Native (3)
aarongreenwald
0
270
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
88
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
810
Other Decks in Programming
See All in Programming
Site Reliability Engineering for GMO
pyama86
8
1k
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
760
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
0
170
Goのエラースタックトレースの歴史と今後
sonatard
7
1.2k
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Code Reviews
bkuhlmann
4
890
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
2 週間で Twitter Bot を作ってみた
contour_gara
0
370
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
530
Featured
See All Featured
Done Done
chrislema
178
15k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
What's in a price? How to price your products and services
michaelherold
237
11k
Building Your Own Lightsaber
phodgson
99
5.7k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
YesSQL, Process and Tooling at Scale
rocio
164
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
GitHub's CSS Performance
jonrohan
1025
450k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Transcript
Architecture that Works React Native Code Reuse Aaron Greenwald github.com/aarongreenwald
@aaronjgreenwald
[email protected]
01 / The Promise
“...that approach yielded around 85% reuse of app code” -
Facebook
“...that approach yielded around 85% reuse of app code” -
Facebook “Don’t repeat yourself. It’s not only repetitive, it’s redundant, and people have heard it before.” - Lemony Snicket
Is it true?
Yes!
(Mostly)
Android & iOS
Web Apps Android & iOS
Web Apps Other RN Projects Android & iOS
02 / Android & iOS
Platform-Specific Code Platform Module Conditional statements in code
Platform-Specific Code Filename Suffixes Separate files per platform
Composition > Inheritance
Platform-Specific Code Platform Module Conditional statements in code Filename Suffixes
Separate files per platform
Architecture Matters
Keep logic out of views
Presenters/Dispatchers Keep logic out of views
Presenters/Dispatchers Logic should be cross-platform Keep logic out of views
Presenters/Dispatchers Logic should be cross-platform Keep logic out of views
Small & modular views
03 / Web Apps
Architecture Matters
Reusable application logic
Compilation gets complicated Reusable application logic
Create a separate module Compilation gets complicated Reusable application logic
Create a separate module Compilation gets complicated Reusable application logic
npm link...
04 / Multiple Projects
Architecture Matters
Binaries
Dependency Hell Binaries
Is it worthwhile? Dependency Hell Binaries
Architecture Matters
#architecture_matters github.com/aarongreenwald @aaronjgreenwald
[email protected]