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
Mercari iOSにおける きらやばArchitectureとAutomation
Search
kagemiku
November 22, 2019
Technology
0
1.5k
Mercari iOSにおける きらやばArchitectureとAutomation
kagemiku
November 22, 2019
Tweet
Share
More Decks by kagemiku
See All by kagemiku
WWDC20 Recap of SwiftUI & Combine
kagemiku
0
4.6k
WWDC19 Recap of ML
kagemiku
0
600
Other Decks in Technology
See All in Technology
株式会社Awarefy(アウェアファイ)会社説明資料 / Awarefy-Company-Deck
awarefy
3
12k
みんなで育てるNewsPicksのSLO
troter
0
200
TechBullエンジニアコミュニティの取り組みについて
rvirus0817
0
530
Streamlitの細かい話
nishikawadaisuke
10
1.3k
eBPF-based Process Lifecycle Monitoring
yukinakanaka
1
120
Scala meets WebAssembly
tanishiking
0
150
사이드 프로젝트를 20번 실패한 주니어의 오답노트 훔쳐보기(feat. KMP)
yjyoon
0
530
EM初心者として半年間マネジャーをやってみて分かったこと
sansantech
PRO
0
110
リポジトリをまるっとAIに食わせるRepomixの話
yamadashy
0
170
I tried leaving the presentation to AI.
zzzzico
3
130
組織に持ち込む脅威モデリング
nikinusu
1
570
越境するプロダクトエンジニアリング
liaoziyang
0
170
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Being A Developer After 40
akosma
89
590k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
50
2.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Writing Fast Ruby
sferik
628
61k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
22
2.5k
Optimizing for Happiness
mojombo
377
70k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Into the Great Unknown - MozCon
thekraken
35
1.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Transcript
1 Mercari iOSにおける きらやばArchitectureとAutomation Akira Fukunaga (@kagemiku) iOS Engineer 2019/11/25
2 Today’s Outlines 01 • 自己紹介 02 03 • MercariにおけるiOS
Engineer • きらやばArchitectureとAutomation
3 01 自己紹介
4 Akira Fukunaga (@kagemiku) Software Engineer (iOS) Tech Lead at
NewBiz & Category
5 人生 学校 Mercari 東京工業大学 情報理工学院 2018.04 休学 2018.07 退学
2019.03 Merpay Integration 2018.08 (サマーインターン) Merpay Integration 2018.09 - 2019.02 (内定者インターン) 退学旅行 2019.03 新卒入社 2019.04 New Customer Growth 2019.07 - 09 NewBiz 2019.10 - (Tech Lead)
6 • Merpay Integration (2018.08 - 2019.02) ◦ メルカリアプリへのメルペイ導入を行うチーム ▪
サイドメニュー撤廃 & 下タブ導入 ▪ マイページ追加 ▪ タイムラインUIの変更 ▪ その他、必要な作業すべて ... • (Sub) Developer Menu Rearchitecture ◦ 社内向けの開発者機能の Rearchitecture (後述) ◦ Objc-C && 1 Storyboard でやばかったので勝手にやった インターン時代 (2018.08 - 2019.02)
7 • New Customer Growth (2019.07 - 2019.09) ◦ 新規お客様向けの施策チーム
▪ 新規会員登録 ▪ 各種オンボーディング ▪ まだ A/B テスト段階のため、詳細は割愛 • NewBiz & Category (2019.10 - ) ◦ 新規領域の開拓やカテゴリ特化を行う施策チーム ▪ 絶賛新機能開発中 ◦ iOSのTech Lead 新卒入社後 (2019.04 -)
8 02 MercariにおけるiOS Engineer
9 • お客様に機能を届ける最後のまとめ役 ◦ どんなに良いUI DesignやMLのモデルがあっても クライアントアプリに落とし込まないとお客様へは届けられない ◦ スーパー大事 •
バックグラウンド・国籍は様々 ◦ 現在は全員で27人ほど (Mercari JPのみ) ◦ PR・Slack・Document 全てにおいて英語 iOS Engineerについて
10 チーム構成 mercari-ios Productivity Technical Problems Architect Client Feature1 Feature1
Feature1 Feature1 Feature N CI & CD
11 チーム構成 mercari-ios Productivity Technical Problems Architect Client Feature1 Feature1
Feature1 Feature1 Feature N CI & CD 20数人で同時に 開発、無理では
12 03 きらやばArchitectureとAutomation
13 03 きらやばArchitectureとAutomation
14 きらやばArchitecture = MVVM + μVC + Store (※僕が勝手にそう呼んでるだけです )
15 MVVM ViewController (VC) ViewModel Model
16 MVVM + μVC VC View Model Model View Model
View Model View Model VC VC VC
17 MVVM + μVC VC VC μVC μVC μVC VC
μVC μVC Component oriented architecture, like React
18 MVVM + μVC
19 • Rearchitectureチームの発足とコードベースの刷新 (2018年) ◦ iOSエンジニアが100人体制になっても スピードを落とさずに開発できるようなコードベースを作る ◦ 現在はその役割の一部を Architectチームが担う
◦ 共同開発でありがちな XIB(View)ファイルのconflictを見ることはほぼなくなった ◦ 事実として、現在20数人が同時に一つのアプリを開発できている => ✅成功 • 参考 ◦ メルカリJP初のiOSリアーキテクチャは、なぜ「最高に楽しい」のか ◦ MicroViewControllerで無限にスケールするiOS開発 - iOSDC 2018 MVVM + μVC
20 MVVM + μVC VM VM VM VM VM VM
VM VM State State State State State State State State Each VM has own State It’s hard to pass state changes to other VMs...
21 MVVM + μVC + Store Root VM VM VM
VM VM VM VM VM State Store Dispatcher Action Introduce Store like Flux own
22 Architectureの歴史 2013: Pure MVC (Objc-C) 2014: Pure MVC (Objc-C)
2015: Pure MVC, heading to MVVM (Objc-C) 2016: MVVM (Objc-C + Swift) 2017: MVVM (Objc-C + Swift) 2018: MVVM + μVC (Swift) 2019: MVVM + μVC + Store (Swift) 2020: heading to SwiftUI + Combine… Swift SwiftUI
23 きらやばArchitecture = MVVM + μVC + Store (※僕が勝手にそう呼んでるだけです )
24 03 きらやばArchitectureとAutomation
25 Automation 一ヶ月で約665 commitsが developに入る develop branchとのconflict解 決がやばいのでは
26 Automation (GitHub Label) • In House Dev ◦ 内製のバイナリ配布システムにより
commit されるたび自動配布 • Nightly Merge ◦ 自動的にdevelopのmergeを行うPRを毎 晩作成する • Auto Merge ◦ CIが終わり次第、自動で mergeする
27 • Nightly Merge + Auto Mergeの組み合わせが強力 ◦ CIがNightly Merge
PR作成時に、conflictがない場合は自動で mergeする ◦ 朝会社に来ると 「feature branchは既に最新のdevelop branchに追従した状態」になっている ◦ つまり、勝手にdevelop branchとの差分が解消されているため、 develop へ mergeする際 に大量のconflictが発生することがほとんどなくなる Automation (GitHub Label) 最高
28 • 最強のBotを社内で飼っている ◦ Binary Submit, App Release, Crash Report,
Distribute Binary, etc…. ◦ 諸般の事情により、その姿をお見せすることはまだできない。。。。 ◦ (最強すぎるため) Automation (Bot)
29 • Mercari iOSのコードベースは日々進化を遂げている ◦ 100人で同時に開発できるスケーラブルな Architectureを目指して ◦ 数々の技術的な挑戦が積み重なっている •
Automationもがんばってる ◦ GitHub Label系Automation ◦ 社内最強Bot ◦ 参考: Automation/karakuri for increasing engineering productivity - TechBlog • 最高に楽しい ◦ iOS Engineerとして、メルカリ iOSのコードベースや開発環境はとても刺激的 ◦ 技術で世界を殴っていきたい方、お待ちしております。 Wrap up