Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
React Native Code Reuse: Architecture that Works
Aaron Greenwald
September 13, 2016
Programming
1
570
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
200
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
72
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
3
690
Other Decks in Programming
See All in Programming
はてなリモートインターンシップ2022 インフラ 講義資料
hatena
4
2.1k
PHPアプリケーションにおけるアーキテクチャメトリクスについて / Architecture Metrics in PHP Applications
isanasan
1
220
(新米)エンジニアリングマネージャーのしごと #RSGT2023
murabayashi
9
5.6k
なぜRubyコミュニティにコミットするのか?
luccafort
0
300
Zynq MP SoC で楽しむエッジコンピューティング ~RTLプログラミングのススメ~
ryuz88
0
330
Remix + Cloudflare Pages + D1 で ポケモン SV のレンタルチームを検索できるアプリを作ってみた
kuroppe1819
4
1.3k
子育てとEMと転職と
_atsushisakai
1
340
[2023년 1월 세미나] 데이터 분석가 되면 어떤 일을 하나요?
datarian
0
570
Azure Functionsをサクッと開発、サクッとデプロイ/vscodeconf2023-baba
nina01
1
330
Listかもしれない
irof
1
230
Makuakeの認証基盤とRe-Architectureチーム
bmf_san
0
470
LIFFで動く割り勘アプリTATEKAをリリースしてみた話
inoue2002
0
240
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
396
63k
Navigating Team Friction
lara
176
12k
Intergalactic Javascript Robots from Outer Space
tanoku
261
26k
Atom: Resistance is Futile
akmur
256
24k
jQuery: Nuts, Bolts and Bling
dougneiner
57
6.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
38
3.6k
Become a Pro
speakerdeck
PRO
6
3.2k
Why Our Code Smells
bkeepers
PRO
326
55k
The Cult of Friendly URLs
andyhume
68
5.1k
Visualization
eitanlees
128
12k
5 minutes of I Can Smell Your CMS
philhawksworth
198
18k
Creatively Recalculating Your Daily Design Routine
revolveconf
207
11k
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]