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

機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話 After Talk

aoi
October 01, 2021

機能ごとに動作するミニアプリでプレビューサイクルを爆速にした話 After Talk

aoi

October 01, 2021
Tweet

More Decks by aoi

Other Decks in Technology

Transcript

  1. After Party iOSDC JAPAN 2021
    ػೳ͝ͱʹಈ࡞͢ΔϛχΞϓϦͰಈ࡞֬ೝΛര଎ʹͨ͠࿩ɹొஃޙ೔ஊ


    2021/10/01 Cookpad.Inc @aoi

    View Slide

  2. ࣗݾ঺հ
    • aoi @aomathwift


    • Cookpad Inc. iOS App Developer


    • CookpadMart

    View Slide

  3. ηογϣϯΛݟ͍͍ͯͨͩͨօ͞Μ


    ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ

    View Slide

  4. Agenda
    • ηογϣϯͷ֓ཁ


    • Discord, TwitterͰͷ Q&A ৼΓฦΓ

    View Slide

  5. ηογϣϯͷ֓ཁ

    View Slide

  6. ΫοΫύουΞϓϦ
    • ։ൃن໛͕େ͖͍


    • Ϗϧυ࣌ؒͷ௕͕͞՝୊


    → ϑϧϏϧυΛ΍Ί͍ͨ

    View Slide

  7. CookpadCore
    Cookpad
    ɾɾɾ
    Cookpad Tsukuru
    Feature A Feature B Feature C
    🔥
    ػೳ୯ମͰϏϧυՄೳͳϚϧνϞδϡʔϧߏ੒Λಋೖ

    View Slide

  8. Feature Module
    • υϝΠϯ૚Λڞ༗Ͱ͖Δ୯ҐͰ෼ྨ͢Δ


    • Ϟδϡʔϧ୯ମͰ 1 ͭͷػೳʹඞཁͳ࣮૷͕׬݁͢Δ


    → Ϟδϡʔϧ୯ମͰϏϧυ͕Մೳ

    View Slide

  9. https://fortee.jp/iosdc-japan-2021/proposal/1b05a1c0-91ef-401a-b3f3-36f0e57a6a25

    View Slide

  10. CookpadCore
    Feature A
    Feature A
    Sandbox
    FeatureModule Aͱ


    CoreͷΈΛϏϧυ
    FeatureModule A ͷ
    ػೳͷΈΛ΋ͭΞϓϦ
    έʔγϣϯλʔήοτ

    View Slide

  11. View Slide

  12. Sandbox ΞϓϦͷ࣮૷ͷಛ௃
    • ଞͷ Feature Module ʹґଘ͠ͳ͍


    • ωοτϫʔΫϦΫΤετͳͲͷ෭࡞༻͸Environment ͱ͍͏
    DI ίϯςφΛ༻͍ͯμϛʔͷ࣮૷Λ஫ೖ

    View Slide

  13. Transition
    Environment
    Network
    CookpadEnvironment StubbableEnvironment
    Logger
    Cookpad Sandbox Test

    View Slide

  14. Sandbox ΞϓϦͷϝϦοτ
    • Ϗϧυ͕଎͍


    • ֬ೝ͍ͨ͠ը໘ʹ͙ͨ͢ͲΓண͚Δ


    • ༷ʑͳঢ়ଶΛ࠶ݱͰ͖Δ

    View Slide

  15. Discord / Twitter Ͱͷ Q&A ৼΓฦΓ

    View Slide

  16. ϛχΞϓϦ͸ QA ͳͲʹ΋࢖͏ʁ
    • جຊΤϯδχΞ͕ಈ࡞֬ೝʹ࢖͏໨తͷΈ


    • QA͸઀ଓςετΛ݉ͶΔͷͰΞϓϦΛ௚઀͏͔ͯ͝͠΋Β͏


    • σβΠφʔ͕ศརʙͬͯݴͬͯ࢖ͬͯͨ͜ͱ΋͠͹͠͹

    View Slide

  17. ϛχΞϓϦ͸ QA ͳͲʹ΋࢖͏ʁ
    • μϛʔϦΫΤετΛ࢖Θͳ͚Ε͹QA΍࣮ػςετͰͷར༻΋
    ͋Γ͔΋ʁ


    • ࢀߟʹ͍ͨ͠ ϥϯλΠϜσόοάͷεεϝ

    View Slide

  18. ϛχΞϓϦ੔උ͸୭͕΍ͬͯΔʁ
    • ࢓૊Έ࡞Γ͸ج൫νʔϜͷϝϯόʔ͕΍ͬͯΔ


    ‣ ࣗಈੜ੒εΫϦϓτͷ༻ҙ


    ‣ μϛʔ࣮૷ͷ੔උɹetc…


    • SandboxScene ͷ࣮૷΍ར༻͸֤ػೳͷ։ൃνʔϜ͕΍Δ

    View Slide

  19. ࣮ࡍͲΕ͘Β͍ޮ཰Խ͞Ε͔ͨ෼͔Δʁ
    • ϑϧϏϧυʹ͔͔Δ࣌ؒ͸ܭଌ͠ଓ͚͖͕ͯͨɺSandbox λʔήοτͰ
    ͷσʔλ͸ܭଌͯ͠ͳ͔ͬͨ😢


    • ࠓޙ͸ҎԼͷ஋Λܭଌ͍͠1ճ͋ͨΓͷϏϧυ͕࣌ؒݮগ͍ͯ͠Δ͜ͱ
    Λఆྔతʹݟ͍ͨ


    ‣ શͯͷϏϧυʹ͓͚ΔϏϧυ࣌ؒ


    ‣ શϏϧυ࣮ߦճ਺ͷ͏ͪ Sandbox Ͱ࣮ߦͨ͠ճ਺ͷׂ߹

    View Slide

  20. SwiftUI ͱͷڞଘͲ͏ͯ͠Δʁ
    • Sandbox ͷ࢓૊Έࣗମ͸ UIKit Ͱͷ࣮૷Λલఏʹ࡞ΒΕ͍ͯΔ


    • View ͕ SwiftUI Ͱ࣮૷͞Ε͍ͯΔ Scene ΋
    UIHostingController Ͱϥοϓͯ͠ಉ͡࢖͍ํΛ͍ͯ͠Δ

    View Slide

  21. XcodePreviews ͸ར༻ͯ͠Δʁ
    • Cookpad ΞϓϦશମͰ͸ ࠷ۙ·Ͱ Xcode Previews ͕࢖͑ͳ͔ͬͨ ☠


    • Sandbox Target Ͱ Preview Λ࣮ߦ͢Δͱ࢖͑Δ


    • UIKit Ͱ࣮૷͞ΕͨίϯϙʔωϯτΛϓϨϏϡʔ͢ΔͨΊͷ࢓૊ΈΛ༻
    ҙ


    • SwiftUI ͷը໘͕૿͑Ε͹Ҡߦ΋ݕ౼

    View Slide

  22. https://engineering.mercari.com/blog/entry/2019-12-13-155700/

    View Slide

  23. XcodePreviews ͸ར༻ͯ͠Δʁ
    • ϙοϓΞοϓը໘ͳͲΛ֬ೝ͢ΔͨΊͷϛχΞϓϦΛ SwiftUI
    Ͱ༻ҙʢUICatalogʣ

    View Slide

  24. View Slide

  25. Sandbox ͸࢖͍ࣺͯલఏʁ
    • ίϛοτͯ͠ϝϯςΛ͍ͯ͘͠લఏ


    • ࠷௿ݶͷίʔυͷ҆ఆੑΛ୲อ͢ΔͨΊʹPRͷ౓ʹϏϧυ͕௨
    Δ͜ͱΛνΣοΫ͍ͯ͠Δ

    View Slide

  26. View Slide

  27. ϛχΞϓϦΛࣾ಺ʹͲ͏΍ͬͯਪਐ͍ͯ͠
    ͘ʁ
    • ػೳ։ൃऀʢར༻ऀʣ޲͚ʹϛχΞϓϦͷϝϦοτΛଧͪग़͢


    • ·ͣ͸͙͢࢖ͬͯ͘Εͦ͏ͳਓʹചΓࠐΜͰΈΔ


    • https://fortee.jp/iosdc-japan-2021/proposal/1b05a1c0-91ef-
    401a-b3f3-36f0e57a6a25 Ͱ΋ղઆ͞Εͯ·͢

    View Slide

  28. View Slide

  29. ΞΧ΢ϯτػೳ͸Ͳ͏ఏڙͯ͠Δʁ
    • ը໘͝ͱʹݻఆ஋Λฦ͢


    • ͦͷଞͷঢ়ଶ΋جຊతʹ࠷ॳ͔Βݻఆ஋Λࢦఆ͠ɺ֬ೝ͍ͨ͠
    ঢ়ଶ͝ͱʹը໘Λ༻ҙ͢Δ

    View Slide

  30. ΞΧ΢ϯτػೳ͸Ͳ͏ఏڙͯ͠Δʁ
    • ঢ়ଶ͕ଟ͍৔߹͸ઃఆը໘Ͱ஋ΛϥϯλΠϜͰมߋͰ͖ΔΑ͏
    ʹ͢Δͷ͕Φεεϝ

    View Slide

  31. View Slide

  32. Sandbox࠲ஊձؾʹͳΔ
    • ࢓૊ΈΛ੔උ͢Δج൫νʔϜ͕ Sandbox ʹؔ͢Δ։ൃνʔϜ
    ଆͷҙݟΛऔΓೖΕվળ͢ΔͨΊʹ࣮ࢪ


    • ࣄલʹࡶʹεϓϨουγʔτʹҙݟΛॻ͍ͯ΋ΒͬͯɺͦΕΛ
    ΈΜͳͰݟͳ͕ΒΘ͍Θ͍ஊٛ͢Δ

    View Slide

  33. ࢀߟࢿྉ
    • https://speakerdeck.com/aomathwift/ji-neng-gotonidong-zuo-
    suruminiapuridepurebiyusaikuruwobao-su-nisitahua


    • େن໛ͳΞϓϦͷϚϧνϞδϡʔϧߏ੒ͷ࣮ફ https://
    speakerdeck.com/giginet/da-gui-mo-
    naapurifalsemarutimoziyurugou-cheng-falseshi-jian


    • ϥϯλΠϜσόοάͷεεϝ https://speakerdeck.com/noppefoxwolf/
    iosdc21

    View Slide

  34. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View Slide