Slide 1

Slide 1 text

NativeΞϓϦͷ୅ΘΓʹ PWAΞϓϦͰઓ͏બ୒ࢶ 2018.05.24 PWA Beginners #4 - @mottox2 ͲΜͳ࣌ʹPWAத৺ͷ։ൃΛબ୒Ͱ͖Δͷ͔

Slide 2

Slide 2 text

@mottox2 • React, Ruby on RailsΛத৺ʹWebαʔϏε։ൃ͍ͯ͠·͢ • Pull RequestͷϨϏϡʔͱٕज़બఆͷ͓ख఻͍΋͍ͯ͠·͢ • WebͷՄೳੑΛ৴͍͖͍ͯͨ͡λΠϓͷਓؒͰ͢ɻ • ϒϩά΍ͬͯ·͢(esa.io + note.mu + Gatsby) => mottox2.com Freelance web engineer & designer Yuki Takemoto

Slide 3

Slide 3 text

ࢲͱPWA ease.netlify.com Desktop޲͚ʹ࡞ͬͨToDoΞϓϦ • React + TypeScript • Service Worker • IndexedDB (Dexie.js) • Web App Manifest • Add to Home Screen • Offline

Slide 4

Slide 4 text

ࢲͱPWA mottox2.com ݸਓͷΤϯδχΞϒϩά • React (Gatsby) • Service Worker • Web App Manifest

Slide 5

Slide 5 text

PWA͸ωΠςΟϒΞϓϦΛஔ͖׵͑Δ΋ͷͰ͸ͳ͍ લఏ

Slide 6

Slide 6 text

PWA͸WebͰΑ͍ମݧΛੜΈग़͢ΞϓϦέʔγϣϯ લఏ

Slide 7

Slide 7 text

ͩͱͯ͠΋ɺωΠςΟϒΞϓϦͷ୅ΘΓͱͯ͠ͷ PWAͷՄೳੑΛ୳ͬͯΈ͍ͨ

Slide 8

Slide 8 text

1. Α͋͘ΔωΠςΟϒΞϓϦ։ൃͷࣦഊΛආ͚͍ͨa 2. ετΞͷ৹ࠪΛͬ͢ඈ͹͍ͨ͠a 3. WebͷάϩʔεʹྗΛೖΕ͍ͨa 4. ਓ͕͍ͳ͍͠ɺ࠾༻ͷݟࠐΈ΋ͳ͍a 5. ର৅Ϣʔβʔ͕iOSΑΓAndroidͷํ͕ଟͦ͏a ͨͱ͑͹͜Μͳ࣌

Slide 9

Slide 9 text

1. Α͋͘ΔωΠςΟϒΞϓϦ։ൃͷࣦഊΛආ͚͍ͨa ͨͱ͑͹͜Μͳ࣌ • NativeAppΛ͚ͭͬͨ͘ͲGooglePlayΛݟΔͱDL਺1000ҎԼͷύλʔϯΛݟΔ • ಋઢͷऑ͞ɺϝϦοτૌٻɺ௿ධՁʹΑΔεϧʔʹΑΔѱ॥؀a • ͦ΋ͦ΋NativeΞϓϦ͕ඞཁͳཁ݅ͳͷ͔ʁͱ͍͏࿩΋͋Δɻ • NativeAppͷ৽نμ΢ϯϩʔυ਺͸೥ʑݮগ͍ͯ͠Δɻ[ཁग़య] • ϋʔυϧ͕ߴ͍ʹ΋͔͔ΘΒͣɺยखؒͰϦϦʔεͯ͠΋উෛʹͳΒͳ͍a • ϑΟʔυόοΫճ͢αΠΫϧ͕஗͘ͳΓ͕ͪa • ԾઆݕূΛ͢Δʹ͸ωοΫʹͳΔa • ࠷ۙ͸Code PushͰετΞΛ௨ͣ͞ߋ৽Ͱ͖Δ • ͍͔ͭ͘ͷ఺͸ɺܦݧऀ͕͍Ε͹ճආͰ͖Δ

Slide 10

Slide 10 text

2. ετΞͷ৹ࠪΛͬ͢ඈ͹͍ͨ͠a ͨͱ͑͹͜Μͳ࣌ • ΞμϧτͳͲ৹ࠪΛ௨աग़དྷͳ͍ΞϓϦa • Ξοϓσʔτʹ௥ैग़དྷͳ͍ΞϓϦa • ৽͍͠ը໘αΠζରԠ΍64bitରԠɺSwiftͷΞοϓσʔτͳͲ޻਺͔͚ͨ͘ͳ͍ ์ஔܥΞϓϦͰਏ͍a • ΞϓϦετΞ্Ͱग़དྷͳ͍ϓϩϞʔγϣϯํ๏Λ࠾༻͍ͨ͠ΞϓϦa • ঺հಛయͱ͔Ξ΢τʹͳͬͨ͸ͣa

Slide 11

Slide 11 text

3. WebͷάϩʔεʹྗΛೖΕ͍ͨa ͨͱ͑͹͜Μͳ࣌ • Webͩͱ৽نࢪࡦ͕༏ઌ͞Εͯɺඇػೳཁ͕͓݅͟ͳΓʹͳΓ΍͍͢ • PWAରԠͱ͍ͬͯ଎౓্͛Δ͚ͩͰɺKPIվળ͢ΔՄೳੑ΋ • WebΤϯδχΞʹߴ͍Ϩϕϧ͕ٻΊΒΕͯɺ࢓ࣄͷϨϕϧ΋্͕Δ • ৽نࢪࡦ΋࢝Ί΍͍͢a • WebͰ࿅͔ͬͯΒΞϓϦΛ࡞ΕΔa • (APIͷϨεϙϯεܗࣜͷมߋͱ͔ͷ෼ذ͕ݮΔɺෛ࠴ʹͳΓʹ͍͘)

Slide 12

Slide 12 text

4. ਓ͕͍ͳ͍͠ɺ࠾༻ͷݟࠐΈ΋ͳ͍a ͨͱ͑͹͜Μͳ࣌ • ͍··ͰWeb͔͠΍ͬͯ͜ͳ͔ͬͨͬͯঢ়گͰɺΞϓϦΤϯδχΞΛ࠾༻͢Δͷ͸ ೉͍͠ɻ • AndroidΞϓϦ͕ग़ͤͯͳ͍ձ͕ࣾͨ·ʹ͍Δؾ͕͢Δ • ΞϓϦΤϯδχΞΛޏ͑ͨͱͯ͠΋ɺiOS, AndroidωΠςΟϒͷจ຺ʹԊͬͨUI͕ Ͱ͖Δ͔ʁ • PWAରԠͱ͍ͬͯ଎౓্͛Δ͚ͩͰɺKPIվળ͢ΔՄೳੑ΋ • ਓΛ৽ͨʹ࠾༻͢Δϋʔυϧͷߴ͞

Slide 13

Slide 13 text

5. ର৅Ϣʔβʔ͕iOSΑΓAndroidͷํ͕ଟͦ͏a ͨͱ͑͹͜Μͳ࣌ • iOS͸ݱ࣌఺ͰWeb Push, Install Prompt͕ະରԠɻ • ੈքతʹ͸AndroidγΣΞ͕େ͖͍ͷͰɺPWAରԠ͕ਐΜͰ͍ΔChromeͷԸܙΛ ड͚΍͍͢͸ͣͩͬͨɻ͕ɺ೔ຊ͸iOS͕ଟ͍ɻ • ಛʹएऀ޲͚αʔϏεͰ͸iOS͕ଟ͘ͳΔ܏޲͕͋Δɻʢܦݧଇʣ • ͨͩɺී௨ͷWebαΠτͱͯ͠͸࢖͑Δɻ

Slide 14

Slide 14 text

• PWAඇର৅Ϣʔβʔ΁ͷΤϯήʔδϝϯτ͕ऑ͘ͳΔ͜ͱΛڐ༰͢Δ • NativeAppͰͳͯ͘PWAͱ͍͏൑அΛͨ͠৔߹ • ύέοτͷؔ܎ͰiOSͷΞοϓσʔτͯ͠ͳ͍ͳͲͷϢʔβʔʹڧ͘Ξϓ ϩʔνग़དྷͳ͍ɻ • ݱঢ়Safari 11.1ͰPush NotificationɺInstall Prompt͕ແޮ • ʮ·ͣ͸ΞʔϦʔΞμϓλʔʹ޲͚ͯଧͭʯΈ͍ͨͳܦӦ൑அ͕ग़དྷΔ͔ʁa • ੒ޭ͢Δࠒʹ͸ɺPWA͕ීٴͯ͠Δ͔͕ۚ͋ΔͷͰΞϓϦΤϯδχΞΛޏ͑͹Α ͍ɻ τϨʔυΦϑΛҙࣝ͢Δ

Slide 15

Slide 15 text

• PWAٕज़܈͸WebͰউෛ͢Δͱ͍͏બ୒ࢶΛ༩͑ͯ͘Εͨɻ • ʮωΠςΟϒΞϓϦΞϓϦΛϦϦʔε͚ͨ͠ͲάϩʔεʹྗΛׂ͚ͳ͔ͬͨʯΈ ͍ͨͳࣦഊΛ๷͛Δɻ • ʮNative or Webʯͱͳͬͨ࣌ʹ໎͍ͳ͘Web͕બ୒ग़དྷΔͱخ͍͠ PWAͰઓ͏બ୒ࢶ ͳͥPWAͰઓ͏બ୒ࢶ͕ཉ͍͠ͷ͔ʁ

Slide 16

Slide 16 text

• Windows Storeʹ͸ग़ͤΔ (ex. Twitter Lite) • υΩϡϝϯτ΋͋Δɻग़ͨ͠ͱ͜ΖͰͲ͏ͳͷʁͬͯײ͡͸͢Δa • Google Playʹ΋ग़ͤΔ • طଘͷϦϦʔεΞϓϦ͸WebView? • কདྷతʹPWA޲͚ͷTrusted Web Activity͕ఏڙ͞ΕΔɻ(Google I/O 2018Ͱݴͬͯͨ) • App Store͸Apple࣍ୈ ؾʹͳΔϙΠϯτ Google Map Go - https://play.google.com/store/apps/details?id=com.google.android.apps.mapslite&hl=ja Twitter Lite - https://play.google.com/store/apps/details?id=com.twitter.android.lite&hl=ja ※ ࠃ಺ͷ୺຤ʹ͸ରԠ͍ͯ͠ͳ͍ Google Playʹग़͍ͯΔPWAͷྫ Progressive Web Apps in the Microsoft Store - https://docs.microsoft.com/en-us/microsoft-edge/progressive-web-apps/microsoft-store ετΞʹग़ͤͳ͍Μ͡Όͳ͍͔ʁ

Slide 17

Slide 17 text

• Pixiv chatstory͸޻෉͍ͯ͠Δ ؾʹͳΔϙΠϯτ Πϯετʔϧͯ͘͠ΕΔਓ͍Δͷʁ

Slide 18

Slide 18 text

• ϖʔδߏ଄೉͍͠ɻ • WebͱAppͷ྆ํͷੑ࣭Λ࣋ͬͨσβΠφʔٽ͔ͤͳߏ଄ɻ • SEO্ͷϖʔδߏ଄΋ߟྀ͕ඞཁɻ • ϞόΠϧϑΝʔετͳϨεϙϯγϒɻa • ωΠςΟϒ෩UIΛ࠾༻͢ΔͳΒOnsen UI, Polymer, IonicͳͲͷબ୒ࢶɻ • ଟ͘ͷέʔεͰSPAඞਢɻ • ϨεϙϯεΛૣ͘͢Δඞཁɻa • HTTP/2, Resource Hints, Inline CSS, ը૾ͷ࠷దԽͳͲͳͲ • ʮWebϖʔδ଎౓վળΨΠυʯ͕͓͢͢Ί Ͳ͏΍ͬͯ࢝ΊΔ͔ʁ ࣗ෼͕ߟ͑Δͱ͜Μͳײ͡

Slide 19

Slide 19 text

• ෦෼తʹApplication Likeͳը໘ʹ͍ͯ͘͠ͷ͕ݱ࣮ղͳؾ͕͍ͯ͠Δ • ωΠςΟϒΞϓϦͷ୅ΘΓʹεϚϗWebΛPWAʹϦϓϨʔε͢Δͷ͋Γ • Twitter Lite͸εϚʔτϑΥϯ޲͚αΠτ͚ͩ੾Γग़͢ • starbucks.com ͸ϩάΠϯޙͷϖʔδͷΈ • Mobile First IndexͰͲ͏͍͏൑ఆ͕ͳ͞ΕΔ͔Α͘෼͔Βͳ͍ • طଘϖʔδΛPWAʹΑͤΔͱ͍͏ΑΓ͸ɺ৽نίʔυͰ࡞Γม͍͑ͯ͘ํ͕ݱ࣮ త͔΋ • CSS, JSपΓͷ࠷దԽ͕ղܾग़དྷΔͳΒ͍͍͚Ͳɺ͜Ε͕೉͍͠ɻ • ಛఆۀछͷWeb App͸ੵۃతʹPWAʹد͍ͤͯ͘ͱΑͦ͞͏ɻ • ਓੜͷઅ໨ʹඞཁ͚ͩͲɺ௕ظؒ࢖͏αʔϏεͰ͸ͳ͍ײ͡ͷɻਓࡐͱ͔ ωΠςΟϒΞϓϦͷͳ͍طଘࣄۀͰ͸ʁ ิ଍ ΋ͪΖΜΞϓϦͬΆ͘͢Δඞཁ͸ͳͯ͘ɺSWͳͲ෦෼ରԠ͢Δ͚ͩͰ΋Α͍ɻ

Slide 20

Slide 20 text

ັྗతͳWebΛ๻ΒͰ࡞͍͖ͬͯ·͠ΐ͏ ޙ೔ɺิ଍ΛϒϩάͰॻ͔͘΋͠Εͳ͍ͷͰݟͯͶʂ mottox2.com