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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aaron Greenwald
September 13, 2016
Programming
1
850
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
440
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
130
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
970
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
120
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
500
AI活用のコスパを最大化する方法
ochtum
0
120
15年目のiOSアプリを1から作り直す技術
teakun
0
570
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
500
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
130
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
230
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
63
53k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.4k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Become a Pro
speakerdeck
PRO
31
5.8k
WCS-LA-2024
lcolladotor
0
470
Code Review Best Practice
trishagee
74
20k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
230
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
120
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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]