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
880
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Aaron Greenwald
See All by Aaron Greenwald
Learn Once, Write Anywhere: Intro to React Native (3)
aarongreenwald
0
460
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
140
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
1k
Other Decks in Programming
See All in Programming
FDEが実現するAI駆動経営の現在地
gonta
2
280
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
790
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
250
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
仕様駆動開発の消費期限
watany
20
8.1k
React本体のコードリーディング
high_g_engineer
1
140
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
180
yield再入門 #phpcon
o0h
PRO
0
1k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
460
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
Making the Leap to Tech Lead
cromwellryan
135
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The browser strikes back
jonoalderson
0
1.5k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
660
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
370
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
200
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]