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
初めてのVue.js で PWA の ビンゴゲームを作った話
Search
AZKZ
September 04, 2020
Programming
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
初めてのVue.js で PWA の ビンゴゲームを作った話
AZKZ
September 04, 2020
Other Decks in Programming
See All in Programming
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
golang-bob.pdf
iwatsukayura
0
130
APNsからLive Activityを開始する話
yumnumm
0
170
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
290
AmebaブログはKMPから卒業します
kmars0605
0
190
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Mind Mapping
helmedeiros
1
400
KATA
mclloyd
PRO
35
16k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
RailsConf 2023
tenderlove
30
1.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
A Modern Web Designer's Workflow
chriscoyier
699
190k
Transcript
5 週間で Web サービスをリリース⼈集まれ@新宿もくもく会 初めてのVue.js で PWA の ビンゴゲームを作った話 1
⾃⼰紹介 名前︓あぜがみ 年齢︓25歳 仕事︓中⼩SES企業(保守運⽤、開発はほぼ経験無し) ⾔語︓JavaとKotlinをほんの少し 2
参加の動機 フロントエンドの技術を使って、何か作りたかった。 前回のこの企画のLTを聞いてみて、皆さん楽しそうだった。 作るなら公開した⽅が絶対いいよな... コロナ禍で時間もあるし参加しちゃえ︕ 3
技術スタック フロントエンド Vue.js Vuetify(CSSフレームワーク) Vue Router(URLルーティング) idb(indexdDBの便利ライブラリ、おすすめ) など バックエンド
無し インフラ Github Pages 無料 かつ HTTPSなので静的Webページの公開には⾮常におすすめ。 でも、若⼲ハマったので後述します。 4
機能説明 デモ https://azkz.github.io/bingo/ 5
解決できる課題 ビンゴカードの購⼊ ビンゴカードの配布、⽚付け 数字を抽選する仕組みの準備 抽選された数字の記録 これらの作業で発⽣するコスト・⼿間を排除できる︕ 6
さらに、 アプリ・会員登録不要 通信状況の影響を受けない(PWA) オンラインでも楽しめる ⼈数制限無し 完全無料 7
PWAって︖ Progressive Web Apps のこと Webアプリがスマホアプリのように使える オフラインでも動く プッシュ通知を受け取れる しかも、 アプリストアを通さなくてもよい︕
Webの技術だけでOK︕ 8
今回作ったビンゴゲームでも インストールできる 9
若⼲⾒た⽬がネイティブアプリっぽくなる オフラインでも使える 10
良かった点 想像以上にSPAを簡単に楽しく作ることができた。 他のReactやAngularは触ったことないが、Vueは噂通り⼿軽だと感じた。 サービスとしてリリースできた達成感を感じられた。 ⾃分で思い描いていたものを形にできた。 (需要があるかはさておき)サービスによって解決できる課題がある。 ⼀応、PWAにすることもできた。 Vue CLIでプロジェクト作成時に選択しただけ、驚くほど簡単。 (実際、PWAである必要性は感じていない。)
11
反省する点 ほとんどコンポーネント化していない。 1 画⾯ 1 ファイルの状態。 拡張性が低い。 変更が難しい。 テストコードが無い。 ⼿を加えたいとは思えない。
Vueの基礎を抑えられていない。 動けば良しのところがたくさん。 状態管理とかわかってない。 12
まとめ 初めての技術でもググれば、動くモノ⾃体は作れると改めて実感。 しかし、品質の⾼いコードを書くには、設計⼿法を学び、 それを⽣かして、もっとコードを書く必要がある。 13
ハマったポイント 事象︓URLから参加できるようにしたが、404になってしまう 本来はサーバーの設定で解決するらしい (公式ドキュメント) →でも、Github Pagesだからサーバーとかない... 14
解決策 1. ⾃前で404.htmlを⽤意 2. sessionStorageにアクセスしたパスとパラメータを格納 3. ルートパスにリダイレクトさせる 404.html <!DOCTYPE html>
<html lang="en"> <head> <script> // URL直打ち時に404画⾯を出さないために // sessionStorageにパスとパラメーターを保存して // ルートパスにリダイレクトする sessionStorage.redirectPathname = location.pathname sessionStorage.redirectParamater = location.search </script> <meta http-equiv="refresh" content="0;URL=./"></meta> </head> </html> 15
4. App.vueのcreatedフックでsessionStorageの中⾝を取り出す 5. Vue Routerを使って、遷移させる App.vue <script> export default {
name: 'App', created: function () { // 404.htmlで保管された値を取得する const redirectPathname = sessionStorage.redirectPathname const redirectParamater = sessionStorage.redirectParamater console.log('redirectPathname:' + redirectPathname) console.log('redirectParamater:' + redirectPathname) // 取得できたため、削除する delete sessionStorage.redirectPathname delete sessionStorage.redirectParamater // URL直打ちリダイレクトされているようなら、そのパスにvue-routerで遷移する if (redirectPathname && redirectPathname !== location.pathname) { const pushPath = redirectPathname.replace(process.env.BASE_URL, '/') + redirectParamater console.log('pushPath:' + pushPath) this.$router.push(pushPath) } } } </script> 16
終わり ありがとうございました︕ 17