$30 off During Our Annual Pro Sale. View Details »

出前館アプリにおけるFlutterアプリ設計とそれを支えるCICD環境の進化

 出前館アプリにおけるFlutterアプリ設計とそれを支えるCICD環境の進化

FlutterKaigi2024登壇資料です

株式会社出前館

November 26, 2024
Tweet

More Decks by 株式会社出前館

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ ኍ෦وಙ / Takanori Hirobe • ॴଐ • LINEϠϑʔגࣜձࣾʢژ౎ΦϑΟεʣ •

    גࣜձࣾग़લؗʹग़޲ • ͜Ε·Ͱͷܦݧ • ϞόΠϧΞϓϦ։ൃΛ͔Ε͜Ἑ೥΍͍ͬͯ·͢ • ग़લؗ͸2021೥͔Β • ࣎լݝ௕඿ࢢࡏॅʢ͔ͳΓઇ͕߱Γ·͢ʣ 4
  2. 8

  3. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ ϑΥϧμߏ੒Ͱߟྀ͢΂͖ཁૉ • ίʔυϕʔεͷେ͖͞ • ձһొ࿥͔Β஫จ·ͰίϚʔεΞϓϦʹඞཁͳ͢΂ͯͷػೳΛ࣮૷͍ͯ͠Δ • /lib/

    ҎԼͷ.dartϑΝΠϧͷ਺͸1300Ҏ্ʢࣗಈੜ੒ϑΝΠϧΛؚΉʣ • ։ൃମ੍΁ͷཁٻ • ػೳຖɺνʔϜຖʹ։ൃΛฒߦͰ͖Δ͜ͱ • ि1ճͷϦϦʔε 14
  4. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ‣ lib

    ‣ src ‣ presentation ‣ order ‣ login ‣ application ‣ order ‣ login ‣ domain ‣ order ‣ login ‣ data ‣ order ‣ login • ϑΝΠϧΛυϝΠϯผʹ෼ྨ͢Δ • ϝϦοτ • ॳظ/খن໛ϓϩδΣΫτͰ͸ϑΝΠ ϧ͕୳͠΍͍͢ • σϝϦοτ • ن໛͕େ͖͘ͳΔ΄ͲϑΝΠϧ਺͕ଟ ͘ͳΓɺ؅ཧ͕൥ࡶʹͳΔ 16
  5. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ‣ lib

    ‣ src ‣ features ‣ order ‣ presentation ‣ application ‣ domain ‣ data ‣ login ‣ presentation ‣ application ‣ domain ‣ data • ֤ػೳ(feature)ผʹϑΥϧμΛߏ੒͠ɺͦ ΕͧΕͷ഑Լʹwidget/controller/model͕ ؚ·ΕΔ • ϝϦοτ • େن໛ϓϩδΣΫτͰϑΝΠϧ͕୳͠΍ ͘͢ͳΔ • ผػೳͷ։ൃ࣌ͷίϯϑϦΫτ͕๷͛Δ • σϝϦοτ • ॳظߏ੒͕ෳࡶʹͳΔ • ڞ௨ίʔυͷ؅ཧ͕೉͘͠ͳΔ 17
  6. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ‣ lib

    ‣ src ‣ presentation ‣ application ‣ domain ‣ data ‣ packages ‣ order ‣ lib ‣ src ‣ login ‣ lib ‣ src • ֤ػೳ(feature)ΛͦΕͧΕύοέʔδͰ؅ ཧͯ͠ϞδϡʔϧԽ • ϝϦοτ • ֤ػೳΛಠཱͯ͠։ൃɺςετ͕Ͱ͖Δ • ໾ׂͷ෼୲͕༰қʹͳΔ • σϝϦοτ • ґଘؔ܎͕ෳࡶʹͳΔ • ϓϩδΣΫτߏ੒ɺϦιʔε؅ཧ͕ෳࡶ ʹͳΔ 18
  7. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ·ͱΊ ϝϦοτ

    σϝϦοτ Type/Domain • ॳظ/খن໛ϓϩδΣΫτͰ͸ϑΝΠϧ͕୳ ͠΍͍͢ • ن໛͕େ͖͘ͳΔ΄ͲϑΝΠϧ਺͕ଟ͘ͳ Γɺ؅ཧ͕൥ࡶʹͳΔ Feature • େن໛ϓϩδΣΫτͰϑΝΠϧ͕୳͠΍͢ ͘ͳΔ • ผػೳͷ։ൃ࣌ͷίϯϑϦΫτ͕๷͛Δ • ॳظߏ੒͕ෳࡶʹͳΔ • ڞ௨ίʔυͷ؅ཧ͕೉͘͠ͳΔ Package • ֤ػೳΛಠཱͯ͠։ൃɺςετ͕Ͱ͖Δ • ໾ׂͷ෼୲͕༰қʹͳΔ • ґଘؔ܎͕ෳࡶʹͳΔ • ϓϩδΣΫτߏ੒ɺϦιʔε؅ཧ͕ෳࡶʹ ͳΔ 19
  8. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ·ͱΊ ϝϦοτ

    σϝϦοτ Type/Domain • ॳظ/খن໛ϓϩδΣΫτͰ͸ϑΝΠϧ͕୳ ͠΍͍͢ • ن໛͕େ͖͘ͳΔ΄ͲϑΝΠϧ਺͕ଟ͘ͳ Γɺ؅ཧ͕൥ࡶʹͳΔ Feature • େن໛ϓϩδΣΫτͰϑΝΠϧ͕୳͠΍͢ ͘ͳΔ • ผػೳͷ։ൃ࣌ͷίϯϑϦΫτ͕๷͛Δ • ॳظߏ੒͕ෳࡶʹͳΔ • ڞ௨ίʔυͷ؅ཧ͕೉͘͠ͳΔ Package • ֤ػೳΛಠཱͯ͠։ൃɺςετ͕Ͱ͖Δ • ໾ׂͷ෼୲͕༰қʹͳΔ • ґଘؔ܎͕ෳࡶʹͳΔ • ϓϩδΣΫτߏ੒ɺϦιʔε؅ཧ͕ෳࡶʹ ͳΔ 20
  9. ग़લؗΞϓϦͷઃܭ - ϑΥϧμߏ੒ Type/Domain vs Feature vs Package ·ͱΊ ϝϦοτ

    σϝϦοτ Type/Domain • ॳظ/খن໛ϓϩδΣΫτͰ͸ϑΝΠϧ͕୳ ͠΍͍͢ • ن໛͕େ͖͘ͳΔ΄ͲϑΝΠϧ਺͕ଟ͘ͳ Γɺ؅ཧ͕൥ࡶʹͳΔ Feature • େن໛ϓϩδΣΫτͰϑΝΠϧ͕୳͠΍͢ ͘ͳΔ • ผػೳͷ։ൃ࣌ͷίϯϑϦΫτ͕๷͛Δ • ॳظߏ੒͕ෳࡶʹͳΔ • ڞ௨ίʔυͷ؅ཧ͕೉͘͠ͳΔ Package • ֤ػೳΛಠཱͯ͠։ൃɺςετ͕Ͱ͖Δ • ໾ׂͷ෼୲͕༰қʹͳΔ • ґଘؔ܎͕ෳࡶʹͳΔ • ϓϩδΣΫτߏ੒ɺϦιʔε؅ཧ͕ෳࡶʹ ͳΔ 21
  10. ग़લؗΞϓϦͷઃܭ - Ξηοτ؅ཧ طଘΞϓϦͷ؅ཧํ๏ 25 Ξηοτͷ؅ཧํ๏͸ɺطଘΞϓϦʢυϥΠόʔɺՃໍళ޲͚ΞϓϦʣΛࢀߟʹ ൺֱ͢Δ͜ͱͰݕ౼ͨ͠ ύεͷ௚઀ೖྗ fl utter_gen

    ಠࣗεΫϦϓτͰClass࡞੒ ίʔυྫ ϝϦοτ γϯϓϧܰྔ IDEͷࢧԉɺίϯύΠϥͷ੩త νΣοΫ IDEͷࢧԉɺίϯύΠϥͷ੩త νΣοΫ σϝϦοτ λΠϙ Ξηοτ௥Ճͷ౓ʹbuild_runner ͷ࣮ߦ͕ඞཁ εΫϦϓτͷϝϯςφϯείετ
  11. ग़લؗΞϓϦͷઃܭ - Ξηοτ؅ཧ طଘΞϓϦͷ؅ཧํ๏ 26 Ξηοτͷ؅ཧํ๏͸ɺطଘΞϓϦʢυϥΠόʔɺՃໍళ޲͚ΞϓϦʣΛࢀߟʹ ൺֱ͢Δ͜ͱͰݕ౼ͨ͠ ύεͷ௚઀ೖྗ fl utter_gen

    ಠࣗεΫϦϓτͰClass࡞੒ ίʔυྫ ϝϦοτ γϯϓϧܰྔ IDEͷࢧԉɺίϯύΠϥͷ੩త νΣοΫ IDEͷࢧԉɺίϯύΠϥͷ੩త νΣοΫ σϝϦοτ λΠϙ Ξηοτ௥Ճͷ౓ʹbuild_runner ͷ࣮ߦ͕ඞཁ εΫϦϓτͷϝϯςφϯείετ
  12. 43

  13. 44

  14. 45

  15. 46

  16. 47

  17. 49

  18. 50

  19. ग़લؗΞϓϦͷCI/CD؀ڥ - ಋೖલ ࣌͸2020೥ 2016.5 ग़લؗͱLINE͕
 ۀ຿ఏܞ 2020.3 ग़લؗͱLINE͕
 ࢿຊۀ຿ఏܞ

    2020.5 LINE͔ΒΞϓϦΤϯδχΞ͕ ։ൃʹࢀՃ ͦΕ·Ͱ͸֎෦ύʔτφʔ ͕։ൃ͍ͯͨ͠ • CICD؀ڥ͸ະಋೖͰɺϩʔΧϧ؀ڥͰखಈϏϧυ͍ͯͨ͠ • ग़લؗΞϓϦ͸React Native, Ճໍళ޲͚ΞϓϦ͸XamarinͰ։ൃ͞Ε͍ͯͨ 58
  20. ग़લؗΞϓϦͷCI/CD؀ڥ - ಋೖલ Bitriseಋೖͷཧ༝ • React Native ͱ XamarinʹରԠ͍ͯ͠ΔɺBitriseʹനӋͷ໼ཱ͕ͬͨɻ •

    ͨΊ͠ʹςετಋೖͯ͠Έͨͱ͜Ζɺ্ख͍͖ͦ͘͏ͩͬͨͨΊɺBitriseʹܾ ఆͨ͠ɻ • ҰਓͷΤϯδχΞ͕ઐ೚Ͱಋೖ࡞ۀΛ୲౰ͨ͠ɻ 59
  21. ग़લؗΞϓϦͷCI/CD؀ڥ - TeamCityҠߦ Bitrise͔ΒͷҠߦ • ग़લؗࣄۀͷFlutterҠߦ͕͖͔͚ͬ • BtoBΞϓϦʢυϥΠόʔ޲͚ɺՃໍళ޲͚ʣ͔ΒઌʹؖࠃνʔϜओಋͰ FlutterԽͨ͠ •

    BtoB޲͚ΞϓϦ͸ɺ΋ͱ΋ͱؖࠃνʔϜͰӡ༻͍ͯͨ͠TeamCityͰCI/ CD؀ڥΛߏஙͨ͠ • ग़લؗΞϓϦͰ΋ɺ͢Ͱʹ͋ͬͨϏϧυ؀ڥ΍ΠϯϑϥΛ࢖͏͜ͱʹͳͬ ͨ 63
  22. ग़લؗΞϓϦͷCI/CD؀ڥ - TeamCityҠߦ Ҡߦޙͷ՝୊ • ෳ਺ͷνʔϜʢυϥΠόʔ޲͚ΞϓϦνʔϜɺՃໍళ޲͚ΞϓϦνʔϜͳͲʣ ͕ಉ͡MacStudioΛ࢖༻͍ͯ͠Δ • νʔϜຖͷ؀ڥͷҧ͍ʢFlutter, Xcode,

    Android SDK౳ͷόʔδϣϯʣ • σϓϩΠͷͨΊͷࣗಈεΫϦϓτͷอक LYϓϥΠϕʔτΫϥ΢υ TeamCity Mac Studio
 (ΦϯϓϨ) Ϗϧυ໋ྩ σϓϩΠ
 (ࣗಈεΫϦϓτ) App Store
 Google Play 📲 66
  23. ग़લؗΞϓϦͷCI/CD؀ڥ - ΦϯϓϨӡ༻ ΦϯϓϨͳΒͰ͸ʢʁʣͷਏ͍࿩ • XcodeͱmacOSͷόʔδϣϯ؅ཧ • Xcode 15.3͸macOS 14.0Ҏ্͕ඞཁ


    macOS 14.x͸Xcode 14.x͕ΠϯετʔϧͰ͖ͳ͍ • ಉ͡ϚγϯͰXcode 15.3ͱXcode 14.3Λಉ࣌ΠϯετʔϧͰ͖ͳ͍
 ʢ྆ํͷXcodeʹରԠͨ͠macOSͷόʔδϣϯ͕ଘࡏ͠ͳ͍ͨΊʣ Xcode 15.3Πϯετʔϧ͍ͨ͠͠ɺ macͷόʔδϣϯ͍͍͋͛ͯʁ ͪΐͬͱ଴ͬͯɺདྷिɺXcode 14ͰϏϧυͯ͠ ετΞఏग़͍ͨ͠Μ͚ͩͲ ΞϓϦA୲౰ ΞϓϦB୲౰ 68
  24. ग़લؗΞϓϦͷCI/CD؀ڥ - Xcode 15ରԠ 2024೥4݄ͷXcode 15ରԠͷ࿩ • Xcode 15ରԠ •

    Privacy ManifestରԠ • ϥΠϒϥϦຖʹPrivacy ManifestʹରԠ͕ඞཁͳͨΊɺ
 FlutterΛؚΉϥΠϒϥϦͷόʔδϣϯΞοϓ΋ඞཁ 70
  25. ग़લؗΞϓϦͷCI/CD؀ڥ - Xcode 15ରԠ 2024೥4݄ͷXcode 15ରԠͷ࿩ • ཁ݅ • 4݄29೔·ͰʹXcode

    15ରԠ͠ɺPrivacy Manifest൛ͷϥΠϒϥϦʹΞοϓ σʔτ͢Δ • Xcode 15/Privacy Manifest ରԠͷͨΊʹɺϦϦʔεΛεέδϡʔϧ • ໰୊͕͋ͬͨ࣌ʹϩʔϧόοΫͰ͖ΔΑ͏ʹXcode 14؀ڥ΋࢒ͨ͠ • ଞͷΞϓϦͷ୲౰ऀͱɺچ؀ڥͷҡ࣋ظؒΛ૬ஊ 71
  26. ग़લؗΞϓϦͷCI/CD؀ڥ - Xcode 15ରԠ 2024೥4݄ͷXcode 15ରԠͷ࿩ • ཁ݅ • 4݄29೔·ͰʹXcode

    15ରԠ͠ɺPrivacy Manifest൛ͷϥΠϒϥϦʹΞοϓ σʔτ͢Δ • Xcode 15/Privacy Manifest ରԠͷͨΊʹɺϦϦʔεΛεέδϡʔϧ • ໰୊͕͋ͬͨ࣌ʹϩʔϧόοΫͰ͖ΔΑ͏ʹXcode 14؀ڥ΋࢒ͨ͠ • ଞͷΞϓϦͷ୲౰ऀͱɺچ؀ڥͷҡ࣋ظؒΛ૬ஊ ϩʔϧόοΫ΋ͳ͘ɺແࣄʹϦϦʔε🎉 72