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
760
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
330
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
92
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
870
Other Decks in Programming
See All in Programming
色々なIaCツールを実際に触って比較してみる
iriikeita
0
130
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.3k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
1.7k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
4
13k
Honoの来た道とこれから
yusukebe
19
3k
RailsのPull requestsのレビューの時に私が考えていること
yahonda
4
1.5k
とにかくAWS GameDay!AWSは世界の共通言語!.pdf / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
0
160
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
2
2k
Vue.js学習の振り返り
hiro_xre
2
130
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
8
730
WEBエンジニア向けAI活用入門
sutetotanuki
0
290
テスト駆動開発✅️
akitoshiga
1
210
Featured
See All Featured
Fireside Chat
paigeccino
32
3k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
41
2.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
What's new in Ruby 2.0
geeforr
342
31k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
How to train your dragon (web standard)
notwaldorf
88
5.6k
Practical Orchestrator
shlominoach
186
10k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
The Language of Interfaces
destraynor
154
24k
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]