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
290
テレワークデイズ浜松2019発表 ソニックガーデン大野 / Telework Days Hamamatsu 2019
pi_chan
0
140
Other Decks in Programming
See All in Programming
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
140
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
テストケースの名前はどうつけるべきか?
orgachem
PRO
1
180
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
230
Beyond ORM
77web
11
1.5k
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
100
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
210
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
390
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
140
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
120
Go の GC の不得意な部分を克服したい
taiyow
3
990
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
For a Future-Friendly Web
brad_frost
176
9.5k
Thoughts on Productivity
jonyablonski
68
4.4k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
940
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Done Done
chrislema
182
16k
Music & Morning Musume
bryan
46
6.3k
Building Applications with DynamoDB
mza
92
6.1k
YesSQL, Process and Tooling at Scale
rocio
170
14k
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ʹౖΒΕΔ͔ʁʣ
໔ • ͨ·ʹϦδΣΫτ͞ΕΔͱ͔͞Εͳ͍ͱ͔