Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GatsbyでPWAやってみた / Tried PWA using Gatsby
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kota Nonaka
August 29, 2018
Programming
470
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GatsbyでPWAやってみた / Tried PWA using Gatsby
2018/08/29 ゆるはち.it Vol.1 でのLT資料です。
https://yuruhachi-it.connpass.com/event/96878/
Kota Nonaka
August 29, 2018
More Decks by Kota Nonaka
See All by Kota Nonaka
このあとからできる アクセシビリティ向上 / Accessibility improvements that can be made after this
uutarou10
0
440
React Nativeと半年間戦ってわかったコト / What I learned after fighting React Native for half a year
uutarou10
1
280
TypeScript+Firebaseで作るサーバーレスアプリケーション/Create serverless app with TypeScript + Firebase
uutarou10
1
1.2k
CSS ド入門ハンズオン/CSS beginner's hands-on
uutarou10
2
98
初心者による初心者のためのKubernetesハンズオン
uutarou10
4
3.3k
Other Decks in Programming
See All in Programming
Event is what happens
moro
2
2.9k
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
260
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
6.1k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
180
Modernizing iOS Apps
seyfoyun
0
150
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
250
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7.1k
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.8k
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.1k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.7k
8年前のNode.jsを動かして分かった、npm installの裏側
keisukeikeda
0
120
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
130
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
600
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
490
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
470
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
390
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
970
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
How to make the Groovebox
asonas
2
2.5k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
650
Documentation Writing (for coders)
carmenintech
77
5.6k
Transcript
Gatsbyで PWA やってみた 2018/08/29 ゆるはち.it Kota Nonaka (@uutarou10)
速報
けっこう酔ってきた
Gatsbyとは? • https://www.gatsbyjs.org/ • 一言で言うと静的サイトジェネレーター • Jekyll/Hugo/Hexoなどと同じジャンル w όοΫΤϯυʹ3FBDU(SBQI2-Λ࣋ͭ
None
Data sourceとして Markdown/外部API等を利用 GraphQLを用いてページ生成に 必要な情報の抽出 Reactで作成したViewで利用 Gatsby公式サイト(https://getgatsbyjs.org)より引用
ここがすごいぞGatsby • Data sourceが豊富 • eg. Markdown / YAML /
WordPress / Contentful / esa.io / etc... • React / GraphQL • 既存の知識やライブラリがそのまま使える • 吐き出されるのは静的なSPA (Single Page Application) • ページ遷移などが爆速 • デプロイも成果物をNetlify / GitHub Pagesなどへ配置するだけ
(語ると長くなりそうなので) 本題
作った https://mogam.in https://github.com/uutarou10/mogam.in
PWA化してみる • gatsby-plugin-manifest • サイトをPWAとして認識してもらうために必要なmanifestの自動生成 • アイコン画像の最適化 • gatsby-plugin-offline •
コンテンツのキャッシュを行うServiceWorkerを自動生成
/* ---------- PWA ---------- */ { resolve: `gatsby-plugin-manifest`, options: {
name: `Mogami#Log`, short_name: `Mogami#Log`, start_url: `/`, background_color: `#f7f0eb`, theme_color: `#00D1B2`, display: `minimal-ui`, icon: `src/images/icon.png`, } }, `gatsby-plugin-offline`, manifestの内容を定義 iconは解像度の大きいものを 作成することで最適な解像度の 画像をビルドプロセスで 用意してくれる 上記はgatsby-config.jsの一部抜粋です。 詳しくは先ほどのリポジトリをご覧ください…!
結果
結果 ホーム画面への追加 ポップアップが表示 manifestに指定した theme colorが反映 Android 5.1.1 / Google
Chrome 68で検証
結果 "OESPJE(PPHMF$ISPNFͰݕূ 機内モードでもページ遷移可能
とっても簡単
しかも!
None
Progressive Web App 満点!!
ところで…
PWA化のメリットは…? (ブログという観点で見ると…) • Lighthouseのスコアが上がって嬉しい(マジで) • (ユーザーがたくさんいるサイトではないので 離脱率/直帰率等への影響は不明) • 今後リファレンス的に使える情報が増えたときに 手元に置いておく用途には最適
• WebPushなどを組み合わせると離脱防止に効果があるかもしれない • ブログをPWA化するメリットはさほど大きくない…?
まとめ・感想 • Gatsbyを使ったサイトをPWA化するのは本当にかんたん • config書く時間 < アイコン作る時間 • 静的サイトをPWA化することでメリットが得られるサイトは限定的? •
ライブラリのドキュメントとか? • PWAとして使うか否かはユーザーが選べばいい/導入は一瞬 やっておいて損はない(と思う)
GatsbyでLet's PWA✌
Thanks✨