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でアプリのアップデートが楽になる話
Search
Hiromasa Ohno
July 14, 2018
Programming
0
460
React Nativeでアプリのアップデートが楽になる話
SonicGarden Tech #2で話したときに使ったスライドです。
Hiromasa Ohno
July 14, 2018
Tweet
Share
More Decks by Hiromasa Ohno
See All by Hiromasa Ohno
「React Nativeで自社サービスのiOS/Androidアプリをリプレイスした話」 から2年経った今何を思うのか/techplay-mobile-cross-platform-lt-2020-07-15
pi_chan
1
280
テレワークデイズ浜松2019発表 ソニックガーデン大野 / Telework Days Hamamatsu 2019
pi_chan
0
130
Other Decks in Programming
See All in Programming
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Better Code Design in PHP
afilina
PRO
0
130
Click-free releases & the making of a CLI app
oheyadam
2
120
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
Teambox: Starting and Learning
jrom
133
8.8k
Music & Morning Musume
bryan
46
6.2k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Designing for Performance
lara
604
68k
Side Projects
sachag
452
42k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Agile that works and the tools we love
rasmusluckow
327
21k
Visualization
eitanlees
145
15k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Transcript
SonicGarden Tech #2 in Hamamatsu
ࣗݾհ • Hiromasa Ohno • aka @pi-chan || @pi_cha_n •
ιχοΫΨʔσϯ • দੜ·Εদҭͪ • ۠ࡏॅ • Rails / iOS / React Native Λੜۀ
ࠓͷςʔϚ
React NativeͰ ΞϓϦͷΞοϓσʔτ͕ ָʹͳΔ
NativeΞϓϦͷϦϦʔε • Ϗϧυ + Ξοϓϩʔυʹ͕͔͔࣌ؒΔ • ৹ࠪʹ͕͔͔࣌ؒΔ • ϨϏϡϫʔʹΑͬͯٸʹϦδΣΫτ͞ΕΔ •
ʢ͍͍ͩͨiOSͷ͔ʣ • ͪΐͬͱ͚ͩ͢ϋʔυϧ͕ߴ͘ͳΔ͠ɺ ຌϛεͰόάͬͨͱ͖ʹ͙͢ʹͤͳ͍͠ɺࠔΔ
React NativeͳΒ Javascriptͷमਖ਼ΛNo৹ࠪͰϦϦʔε
Native App URL ref JS Bundle RNΞϓϦͷ࣮ମ • ϝΠϯͷίʔυJS •
ωΠςΟϒԼճΓ • ωΠςΟϒͱJS͕ಠཱ • JSϑΝΠϧΛURLͰࢀর
৹ࠪͳ͠ͷϧʔτ Native App URL ref JS Bundle JS Bundle
࠷ˍߴ
ৄࡉͳ
RNΞϓϦͷߏʢ֓ཁʣ ※ Bridge ͜ͷͰ྆ऀΛͭͳ͙ͷͱ͍͏ఔͷҙຯ
RNΞϓϦͷߏʢৄࡉʣ
RNΞϓϦͷϏϧυϓϩηε
RNΞϓϦͷϦϦʔεϏϧυᶃ • JSΛϏϧυˠ main.jsbundle
RNΞϓϦͷϦϦʔεϏϧυᶄ • ωΠςΟϒΞϓϦ෦ͷϏϧυ • ᶃͷJS bundleΛಉࠝ
RNΞϓϦͷϦϦʔεϏϧυᶅ • ࠷৽ͷJSΛؚΜͩঢ়ଶͰϏϧυ • ͋ͱ௨ৗͷΞϓϦΞοϓσʔτͱಉ͡ • ී௨ʹΔͱπϥ͞มΘΒͳ͍ Native App URL
ref JS Bundle
͜ͷ෦ JS Bundle
Native App URL ref JS Bundle RNΞϓϦͷ࣮ମ
RNΞϓϦͷ࣮ମ AppDelegate.m jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; RCTBundleURLProvider.m resourceName
= resourceName ?: @"main"; [[NSBundle mainBundle] URLForResource:resourceName withExtension:@"jsbundle"];
JSΛಈతʹஔ͖͑Ε ྑ͍ͷͰ…ʁ Native App JS Bundle Another JS Bundle
ಈతʹஔ͖͑Δͱ • Ͳ͔͜ͷαʔόʔʹJSΛஔ • ΞϓϦىಈ࣌ʹνΣοΫ • ࠷৽͕͋Εμϯϩʔυ • Έ͍ͨͳ͜ͱΛ͍ͨ͠
Code Push (by Microsoft)
Visual Studio AppCenter Build JS & Deploy to AppCenter Native
App JS Bundle Check New Ver. Download & Update JS Bundle
ίʔυͷมߋʢNativeଆʣ AppDelegate.m jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; AppDelegate.m #ifdef
DEBUG jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; #else jsCodeLocation = [CodePush bundleURL]; #endif
CodePushҎલͷϦϦʔεखॱ • Native࣮ͷมߋΛ͏ϦϦʔε • NativeΞϓϦΛϏϧυ • ϓϥοτϑΥʔϜUpload • ৹ࠪఏग़ •
waiting • ϦϦʔε • JSͷΈͷมߋͷϦϦʔε • ಉࠨ
CodePushҎ߱ͷϦϦʔεखॱ • Native࣮ͷมߋΛ͏ϦϦʔε • NativeΞϓϦΛϏϧυ • ϓϥοτϑΥʔϜUpload • ৹ࠪఏग़ •
waiting • ϦϦʔε • ͬͪ͜ಉ͡ʂ • JSͷΈͷมߋͷϦϦʔε • JSΛϏϧυʢjsbundleʣ • AppCenterCLIͰupload • ͓ΘΓ • ৹ࠪͳ͠ʂ
JSͷΈͷมߋͬͯԿͩΖ͏͔ • JSଆόάमਖ਼ • UIͷมߋ • ը໘૿ • ϨΠΞτมߋ •
APIݺͼग़͠मਖ਼ • JSϥΠϒϥϦͷมߋɾՃ • Native࣮͕ແ͍ͷͰ͋ΕOK Native SDK React Native JS API Application & 3rd-party Lib React Native Bridge React Native Native Implementation Native Code
߈ΊͷΞϓϩʔν • কདྷ͍ͦ͏ͳNativeϥΠϒϥϦ ͋Β͔͡ΊΞϓϦʹಥͬࠐΜ্ͩͰϦϦʔε • ΧϝϥɺࣸਅɺPush௨ͳͲͳͲ • ඞཁʹͳͬͨ࣌ͰJS࣮ˠCodePushʂ • ʢAppleʹౖΒΕΔ͔ʁʣ
໔ • ͨ·ʹϦδΣΫτ͞ΕΔͱ͔͞Εͳ͍ͱ͔