Upgrade to Pro — share decks privately, control downloads, hide ads and more …

US 版 Mercari をまるごと1から作り直した話

Naoki ISHIKAWA
September 17, 2017

US 版 Mercari をまるごと1から作り直した話

iOSDC 2017 in Tokyo, September 16-17, 2017
https://iosdc.jp/2017/node/1438

Naoki ISHIKAWA

September 17, 2017
Tweet

More Decks by Naoki ISHIKAWA

Other Decks in Technology

Transcript

  1. աڈͷεϥΠυ • Drink Meetup with Mercari iOS(2016೥6݄) • https://speakerdeck.com/jarinosuke/drink-meetup-with- mercari-number-36

    • Mercari Day 2017(2017೥1݄) • https://speakerdeck.com/jarinosuke/mercari-day-2017
  2. Ϧʔδϣϯ෼ذɺABςετͷංେԽ • if (isUS) {} else {} • if (AB_improve_xxx)

    {} else {} • if (isUS) { if (AB) {} else {} } else { if (AB) {} else {} } * ͋͘·ͰྫͰ͢ ࣮૷ίετ↗ QAίετ↗
  3. Objective-Cͱܕ • class A { init(with string: String) } •

    NSDictionary *data; • [[A alloc] initWithString:data[@“id”]]; • ಈతܕ෇͚ͱ੩తܕ෇͚͕ࠞࡏ͠ɺ༧ظͤ͵Ϋϥογϡ
  4. νʔϜߏ੒ • kitasuke Introducing protobuf in Swift • chuganzy ϝϧΧϦͰ࣮ࢪͨ͠աڈ࠷େن໛ͷABςετʮυϩϫʔ

    vs Լλϒʯͷ෣୆ཪ • yoichi ϞόΠϧΞϓϦͰࠔΒͳ͍ΤϥʔϋϯυϦϯάͱϩΪϯάͷ ϕετϓϥΫςΟε • jarinosuke US ൛ Mercari Λ·Δ͝ͱ1͔Β࡞Γ௚ͨ͠࿩
  5. ࣮૷ػೳ • Tab, Home, Login/Signup, Network, Overall architecture • Checkout,

    Search, WebView • DI, Item Detail, ReactNative • Listing, Local DB, Migration from current app ΊͪΌͪ͘Ό͋Δ
  6. ࡞ۀ෼୲ • Tab, Home, Login/Signup, Network, Overall architecture • Checkout,

    Search, WebView • DI, Item Detail, ReactNative • Listing, Local DB, Migration from current app
  7. ࡞ۀλΠϜϥΠϯ 4݄ 5݄ 6݄ Checkout WebView Search Tab, Home, Login/Signup,

    Network, Overall architecture DI, Item Detail ReactNative LocalDB Listing Migration
  8. Swift/protobufͰܕ҆શ • protocol buffer • API Request/Response Ͱѻ͏ Model ͱͦͷϓϩύςΟͷܕ͕

    อূ͞Εͨ • ৄ͘͠͸ kitasuke ͞Μͷ͜ͷهࣄ • kitasuke Introducing protobuf in Swift
  9. Swinject ʹΑΔ DI Ͱ Testable ͳߏ੒ʹ • ΞϓϦશମͷΞʔΩςΫνϟ΋ DI Λҙࣝͨ͜͠ͱʹΑΓ౷Ұ͞

    Εͨ • Author ͷ yoichi ͞ΜࣗΒಋೖͯ͘͠Εͨ • ViewModel ʹରͯ͠ Service Λ Injectable ͳߏ੒ʹͨ͠
  10. Swinject ʹΑΔ DI Ͱ Testable ͳߏ੒ʹ ViewModel struct ViewModel {

    let service: Service typealias Dependency = Service init(dependency: Dependency) { service = dependency } } ֎෦ʹґଘ͍ͯ͠Δ Service ͸ protocol ʹ੾Γग़͠ɺMock Ͱ͖ΔΑ͏ʹઃܭ
  11. Swinject ʹΑΔ DI Ͱ Testable ͳߏ੒ʹ Mercari Tech Conf 2017


    US൛Mercari iOSΞϓϦͷΞʔΩςΫνϟͱDependency Injection