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
820
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
410
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
120
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
950
Other Decks in Programming
See All in Programming
Improving my own Ruby thereafter
sisshiki1969
1
160
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
1.7k
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
130
速いWebフレームワークを作る
yusukebe
5
1.7k
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
150
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
310
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
160
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
私の後悔をAWS DMSで解決した話
hiramax
4
210
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.2k
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
320
個人軟體時代
ethanhuang13
0
320
Featured
See All Featured
Practical Orchestrator
shlominoach
190
11k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
4 Signs Your Business is Dying
shpigford
184
22k
Designing for humans not robots
tammielis
253
25k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
It's Worth the Effort
3n
187
28k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
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]