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
Kota Nonaka
August 29, 2018
Programming
460
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
97
初心者による初心者のためのKubernetesハンズオン
uutarou10
4
3.3k
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.8k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
JRuby: Past, Present, and Future
headius
0
220
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.3k
SREの越境 / SRE Collaboration
y0hgi
2
290
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
290
Webの地図
yosuke_furukawa
PRO
6
5k
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
sira's awesome portfolio website redesign presentation
elsirapls
0
430
Design in an AI World
tapps
1
340
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
290
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
310
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The Invisible Side of Design
smashingmag
301
52k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
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✨