US 版 Mercari をまるごと1から作り直した話
by
Naoki ISHIKAWA
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
US ൛ Mercari Λ·Δ͝ͱ 1͔Β࡞Γͨ͠ iOSDC Japan 2017 Naoki Ishikawa @jarinosuke
Slide 2
Slide 2 text
ࣗݾհ • ੴथ (@jarinosuke) • Mercari, Inc (joined at 2016/05) •iOS Engineer
Slide 3
Slide 3 text
աڈͷεϥΠυ • Drink Meetup with Mercari iOS(20166݄) • https://speakerdeck.com/jarinosuke/drink-meetup-with- mercari-number-36 • Mercari Day 2017(20171݄) • https://speakerdeck.com/jarinosuke/mercari-day-2017
Slide 4
Slide 4 text
Agenda 1. ࡞Γͨ͠എܠɺ͘͠ੵΈॏͶΒΕͨྺ࢙ 2. Ͳ͏ͬͯ࡞Γͨ͠ͷ͔ʢώτɺ࣌ؒɺํ๏ʣ 3. ࡞Γͯ͠ղܾͨ͠ίτ
Slide 5
Slide 5 text
1.࡞Γͨ͠എܠɺ ͘͠ੵΈॏͶΒΕͨྺ࢙
Slide 6
Slide 6 text
mercari-ios ͷྺ࢙ ! " 2016/11 master
Slide 7
Slide 7 text
mercari-ios ͷྺ࢙ ! " 2016/11ࠒ master jp/master
Slide 8
Slide 8 text
ιʔείʔυׂ • ϚϧνιʔεϚϧνόΠφϦ • ୯Ұ repos Ͱ branch ͰϦʔδϣϯຖʹׂ
Slide 9
Slide 9 text
mercari-ios ͷྺ࢙ ! " 2016/11ࠒ master jp/master 2017/4த० 3,4ϲ݄
Slide 10
Slide 10 text
ιʔείʔυׂͨ͠ޙͷ3,4ϲ݄ • ϋϯόʔΨʔϝχϡʔ->λϒԽ • ϖʔδͷϦχϡʔΞϧ • ϓϥΠϕʔτνϟοτػೳ • ͳͲͳͲ… • ͍αΠΫϧͰͨ͘͞Μͷ৽ػೳΛϦϦʔεͰ͖ͨ
Slide 11
Slide 11 text
ґવͱͯ͠Δ՝ • ϦʔδϣϯذɺABςετͷංେԽ • Objective-Cͱܕ • ΞʔΩςΫνϟ(MVC, MVVM)͕ࠞࡏ मਖ਼ʹରͯ͠ͷίετ͕ͱͯߴ͘ͳ͖͍ͬͯͯͨ
Slide 12
Slide 12 text
ϦʔδϣϯذɺABςετͷංେԽ • if (isUS) {} else {} • if (AB_improve_xxx) {} else {} • if (isUS) { if (AB) {} else {} } else { if (AB) {} else {} } * ͋͘·ͰྫͰ͢ ࣮ίετ↗ QAίετ↗
Slide 13
Slide 13 text
Objective-Cͱܕ • class A { init(with string: String) } • NSDictionary *data; • [[A alloc] initWithString:data[@“id”]]; • ಈతܕ͚ͱ੩తܕ͚͕ࠞࡏ͠ɺ༧ظͤ͵Ϋϥογϡ
Slide 14
Slide 14 text
ΞʔΩςΫνϟ(MVC, MVVM)͕ࠞࡏ • ϝϧΧϦ iOS 2013ʹϦϦʔε(iOS7͕ϦϦʔε͞Εͨࠒ) • ग़ը໘VC Created by Shinichiro Oba on 2013/04/20 • ObjC/Swift, MVC/MVVM ͷڞଘʢࠞࡏʣ
Slide 15
Slide 15 text
mercari-ios ͷྺ࢙ ! " 2016/11ࠒ master jp/master 2017/4த०
Slide 16
Slide 16 text
mercari-ios ͷྺ࢙ ! " 2016/11ࠒ master jp/master 2017/4த०
Slide 17
Slide 17 text
⇧ + ⌘ + N
Slide 18
Slide 18 text
⇧ + ⌘ + N Create New Project
Slide 19
Slide 19 text
2.Ͳ͏ͬͯ࡞Γ͔ͨ͠ ʢώτɺ࣌ؒɺํ๏ʣ
Slide 20
Slide 20 text
νʔϜߏ • kitasuke • chuganzy • yoichi • jarinosuke
Slide 21
Slide 21 text
νʔϜߏ • kitasuke Introducing protobuf in Swift • chuganzy ϝϧΧϦͰ࣮ࢪͨ͠աڈ࠷େنͷABςετʮυϩϫʔ vs Լλϒʯͷཪ • yoichi ϞόΠϧΞϓϦͰࠔΒͳ͍ΤϥʔϋϯυϦϯάͱϩΪϯάͷ ϕετϓϥΫςΟε • jarinosuke US ൛ Mercari Λ·Δ͝ͱ1͔Β࡞Γͨ͠
Slide 22
Slide 22 text
࣮ػೳ • Tab, Home, Login/Signup, Network, Overall architecture • Checkout, Search, WebView • DI, Item Detail, ReactNative • Listing, Local DB, Migration from current app ΊͪΌͪ͘Ό͋Δ
Slide 23
Slide 23 text
࡞ۀ୲ • Tab, Home, Login/Signup, Network, Overall architecture • Checkout, Search, WebView • DI, Item Detail, ReactNative • Listing, Local DB, Migration from current app
Slide 24
Slide 24 text
։ൃεέδϡʔϧ • 4݄த०։ൃ։࢝ • 6݄ϦϦʔεඪ • ࣮࣭2ϲ݄
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
࡞ۀλΠϜϥΠϯ 4݄ 5݄ 6݄ Checkout WebView Search Tab, Home, Login/Signup, Network, Overall architecture DI, Item Detail ReactNative LocalDB Listing Migration
Slide 27
Slide 27 text
༏ઌͨ͠ίτ • ͓٬༷͕ϦχϡʔΞϧΛҙࣝͤͣ͏͜ͱ͕Ͱ͖Δ • ΞʔΩςΫνϟΛ౷Ұ͢ΔɺςελϒϧͳߏΛҡ࣋͢Δ • ϦϦʔε͓ͯ͠٬༷ʹ৽͍͠ΞϓϦΛಧ͚Δ
Slide 28
Slide 28 text
༏ઌ͠ͳ͔ͬͨίτ • ॆͳςετίʔυ • iPad ରԠ • طଘΞϓϦͷ༷ʢθϩ͔Βߟ͑Δʣ
Slide 29
Slide 29 text
before after
Slide 30
Slide 30 text
3.࡞Γͯ͠ղܾͨ͠ίτ
Slide 31
Slide 31 text
طଘʹ༷͋ͬͨʑͳϢʔεέʔεΛআ • Ϧʔδϣϯ("/!)ʹΑΔίʔυذ • 20ݸऑͷABςετʹΑΔίʔυذ • ΞϓϦέʔγϣϯϩδοΫͷΈʹूதͰ͖ΔΑ͏ʹͳͬͨ
Slide 32
Slide 32 text
Swift/protobufͰܕ҆શ before after Objective-C Free
Slide 33
Slide 33 text
Swift/protobufͰܕ҆શ • protocol buffer • API Request/Response Ͱѻ͏ Model ͱͦͷϓϩύςΟͷܕ͕ อূ͞Εͨ • ৄ͘͠ kitasuke ͞Μͷ͜ͷهࣄ • kitasuke Introducing protobuf in Swift
Slide 34
Slide 34 text
BitriseʹҠߦ͠ϝϯςφϯείετݮ • ࠓ·Ͱࣗલͷ Jenkins on Mac • සൟʹωοτϫʔΫʹΞΫηεͰ͖ͣʹམͪΔ • ֎෦IP͔ΒΞΫηεͰ͖ͳ͍ • Xcode ͷόʔδϣϯΞοϓ
Slide 35
Slide 35 text
Swinject ʹΑΔ DI Ͱ Testable ͳߏʹ • ΞϓϦશମͷΞʔΩςΫνϟ DI Λҙࣝͨ͜͠ͱʹΑΓ౷Ұ͞ Εͨ • Author ͷ yoichi ͞ΜࣗΒಋೖͯ͘͠Εͨ • ViewModel ʹରͯ͠ Service Λ Injectable ͳߏʹͨ͠
Slide 36
Slide 36 text
Swinject ʹΑΔ DI Ͱ Testable ͳߏʹ ViewModel struct ViewModel { let service: Service typealias Dependency = Service init(dependency: Dependency) { service = dependency } } ֎෦ʹґଘ͍ͯ͠Δ Service protocol ʹΓग़͠ɺMock Ͱ͖ΔΑ͏ʹઃܭ
Slide 37
Slide 37 text
Swinject ʹΑΔ DI Ͱ Testable ͳߏʹ Mercari Tech Conf 2017 US൛Mercari iOSΞϓϦͷΞʔΩςΫνϟͱDependency Injection
Slide 38
Slide 38 text
͓ΘΓʹ
Slide 39
Slide 39 text
ืू https://open.talentio.com/ 1/c/mercari/requisitions/ detail/4256