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
770
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
350
Learn Once, Write Anywhere - Intro to React Native (2)
aarongreenwald
0
100
Learn Once, Write Anywhere: Intro to React Native
aarongreenwald
4
890
Other Decks in Programming
See All in Programming
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
110
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
命名をリントする
chiroruxx
1
420
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
270
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
MCP with Cloudflare Workers
yusukebe
2
220
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
160
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.5k
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Unsuck your backbone
ammeep
669
57k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
How GitHub (no longer) Works
holman
311
140k
Bash Introduction
62gerente
608
210k
Navigating Team Friction
lara
183
15k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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]