ServiceWorkerãåããããã®æä½éã®ãã¼ã¹ãã§ããã®ã§ãServiceWorkerã«ä»äºãããã¦ã¿ã¾ãããã ã¾ãã¯ãã¡ã¸ã£ã¼ãªå®è£ ã¨ãªããã£ãã·ã¥å¶å¾¡ãã¤ã¾ãã¨ããé«éåããªãã©ã¤ã³å¯¾å¿ã®å®è£ ãè¡ãã¾ãã ãªã¯ã¨ã¹ãããã£ãããã£ãã·ã¥ãè¿ãããã«ãã¦ã¿ã ä»åã®èã¨ãªãä»çµã¿ã§ãã ã¡ãªã¿ã«ä»¥åçå®ããã¦ããHTML5ã®Application Cache APIã¯ãã»ãã¥ãªãã£çãªçç±ã«ããå»æ¢ããã¾ããã åºæ¬çãªä»çµã¿ Cache API ãç¨ãã¦ãæå®ããããã¡ã¤ã«ã®ãã£ãã·ã¥ãæ§ç¯ãããServiceWorkerã®installæï¼installã¤ãã³ãã®ã³ã¼ã«ããã¯ï¼ã«ã¦è¡ãã®ããä½æ³ãªããã ãã©ã¦ã¶ããã®ãªã¯ã¨ã¹ããããã¨ãã«ããã®ãªã¯ã¨ã¹ãã横åããã¦ãæ§ç¯ãã¦ãã£ããã£ãã·ã¥ãããªã¯ã¨ã¹ãã¨åãURLã®ãªã½ã¼ã¹ãè¿ãããªã¯ã¨ã¹ãã®æ¨ªåãã¯fetchã¤ãã³ã
(æ§ããã°ãã移è¡ãã¾ããã) Service Worker 㯠PWA(Progressive Web App)ã®ãªãã©ã¤ã³æä½ã Push éç¥ãå®è£ ããããã®æ©è½ã§ããJavaScript ã§å®è£ ãè¡ãã¾ããããã©ã¦ã¶ã¨ã¯å¥ããã»ã¹ã§ããã¯ã°ã©ã¦ã³ãã§åä½ããã®ãç¹å¾´ã§ãã ãªãã©ã¤ã³æä½ã®å®ç¾ã¯å·§ã¿ãªãã£ãã·ã¥ãã³ããªã³ã°ã«ãã£ã¦ãªããã¦ãã¾ãã Service Worker ã®åºæ¬çãªæ¸ãæ¹ãå¦ç¿ããã®ã§ãåå¿é²çãªå½¢ã§ãã®ããã°ã«æ®ãã¾ãã PWA ã®è©±ãæ°ãåãããæ®ãããã¨ï¼ Sample ããã¸ã§ã¯ãã Github ã« Push ãã¾ããã ãæ´»ç¨ããã ãããã¨æãã¾ããHosting ã«ã¯ Firebase Hosting ãå©ç¨ãã¾ããã Github: https://github.com/Ryoma0219/simple-pwa Firebase Hosting
ã¯ããã« Nextcloudã«ã¯CLIç°å¢ã¨ãã¦occã¨ãããã®ãããããã¾ãã¾ãªè¨å®ã管çãè¡ããã¨ãã§ãã¾ãã ããã§ã¯occã§ä½¿ããæ§ã ãªã³ãã³ã群ã®ãã¡ããã¡ã¤ã«ç®¡çã«é¢ããã³ãã³ã群ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ã¾ãã â»occ ã®ä½¿ãæ¹ã«ã¤ãã¦ã¯ã ãtechblogãNextcloudã®ç®¡çç¨CLIãoccãã³ãã³ãã«ã¤ãã¦ã®è¨äºãåç §ãã ããã â»occ ã®å ±éãªãã·ã§ã³ã«ã¤ãã¦ã¯ããtechblogãNextcloudã®ç®¡çç¨CLIãoccãè©³ç´°ï¼ Nextcloudèªä½ã«å¯¾ããã³ãã³ã群ãå ±éãªãã·ã§ã³è¨å®ã®è¨äºãåç §ãã ããã ç°å¢ã«ã¤ã㦠ããã§è¨è¼ããoccãå®è¡ããNextcloudã®ãã¼ã¸ã§ã³ã¯ã2019å¹´3æ16æ¥ç¾å¨ã§ææ°ã®15.0.5ãå©ç¨ãã¾ãã Webãµã¼ãã¯Nginxãå©ç¨ããç°å¢ã§å®æ½ãã¦ããã¾ããApacheãWebãµã¼ãã¨ãã¦å©ç¨ãã¦ããå ´åã¯ãsudo
Macã®å®¹éãç¡ããªãã¨ã¾ããã§ãã¯ããã®ãã¹ãã¬ã¼ã¸ï¼ãã¼ããã£ã¹ã¯ï¼ã®ç¶æ ã ãããªæãã§ããã®ä»ããSSDãHDDãå æ ãã¦ãã¦æ¸æã£ã¦ããã®ã§ã¯ãªãã§ããããï¼ Appãã ã¼ãã¼ãåçã¨ãã£ãåèªãªãä½ã¨ãªãä½ãå ¥ã£ã¦ããã®ãæ³åãã§ããã®ã§ãããããã®ä»ãã£ã¦ããããã¶ãã¯ãªãããã§ããããç¬ ä½ãå ¥ã£ã¦ããã®ãåãããªãã®ã§ãããããæ¶ãæ¹ãåãããªãã§ãããä»®ã«ãã¡ã¤ã«ããåãã£ãã¨ãã¦ãåé¤ãããmacãåããªããªã£ã¦ãã¾ã£ãããã¨æãã¨ãªããªãåé¤ãããã¨ãã§ãã¾ããã ç§éã®MacBookï¼Air,Proï¼ã®å®¹éãå§è¿«ãã¦ããããã®ä»ãã®æ£ä½ãæããã¾ãã ãããããããã®ä»ãã®ä¸èº«ã£ã¦ä½ï¼ Macãå£ãåã«ï¼ããã®ä»ããåé¤ããéã®æ³¨æç¹ ããã®ä»ããå®å ¨ã«åé¤ããæ¹æ³ ãããããããã®ä»ãã®ä¸èº«ã£ã¦ä½ï¼ ããã®ä»ãã¨æ¸ããã¦ããã ãã§ã¯ãä¸ã«ã©ããªãã¡ã¤ã«ãå«ã¾ãã¦
ã¯ããã«ios ã® PWA ã®ãã£ãã·ã¥ã£ã¦å ¨ç¶æ¶ããªããªãã§ããï¼ï¼ï¼ ã¾ãããã PWA ã®è¯ãã¨ããã ã¨ã¯æããã§ããã©ãã£ããã³ã³ãã³ããæ°ãããã¦ããããã¦ã¼ã¶ãæ¤ç¥ã§ããªãã®ã¯è¯ããªãã§ãããã æ¬æ¥ã§ããã°service-worker.jsã«ä»¥ä¸ã®ããã«æ¸ãã°ãã£ãã·ã¥ã§ã¯ãªãææ°ã®ã³ã³ãã³ããå©ç¨ãã¦ãããã¯ããªã®ã§ããã ã©ããã調ã¹ãæãã ã¨ã¾ã Safari ã® PWA 対å¿ãé ãã¦ãã£ã½ãã§ããã self.addEventListener('activate', (event) => { event.waitUntil( caches.keys().then((keys) => { console.log('keys: ' + keys) return Promise.all( keys.map((key) => { console.log('ä¸è¦ãªãã£ãã·ã¥ãå
ã¯ããã« ååã®è¨äº (https://qiita.com/OMOIKANESAN/items/5b23fa8ea9ea0d181df5) ã§ãæå°æ§æã§PWAã®Webãµã¤ããä½æããæ¹æ³ã«ã¤ãã¦ãç´¹ä»ãã¾ããã ä»åã¯ãå¥ã®ãã¼ã¸ãä½æãã¦ãããªãã©ã¤ã³ã®ã¨ãã®æåãå¶å¾¡ãããã«åãçµã¿ã¾ããã ååãããªãã©ã¤ã³ç¶æ ã§åä½ãããã¼ã¸ãä½æãã¾ããããè¤æ°ã®ãã¼ã¸ã«ã¾ããããããªãã¤ã¾ãã¯é常ã®Webãµã¤ãã§ã®ä½¿ãæ¹ã«ã¯è§¦ããªãã£ãã®ã§ãä»åã¯ãã¼ã¸ãè·¨ã£ãã¨ãã®ãªãã©ã¤ã³è¡¨ç¤ºãã³ã³ããã¼ã«ãããã¨ããã®ã主é¡ã§ãã ã³ã¼ãã®æ¦è¦ ä»åãåååæ§ã«ããªãã¹ãæå°æ§æã§ã®ãªãã©ã¤ã³ãã³ããªã³ã°ãç®æãã¾ããã ãã¹ã¦ãã®è¨äºå ã«æ¸ãã¨åé·ã«ãªã£ã¦ãã¾ããããGitHubã¸ã¢ãããã¼ããã¾ããã®ã§ãé©å®åç §ãã¦ãã ããã ããããã¼ã¸ãç®æ¬¡ã«ãªã£ã¦ãã¦ãããããã®è±ã®ååãé¸æããã¨ãé¸æã
Nuxt.jsã使ãã¨ãæ¯è¼çç°¡åã«PWA対å¿ã®ãµã¤ããä½ããã¨ãã§ãã¾ãã ãã ãPWA対å¿ã¨ä¸è¨ã§è¨ã£ã¦ããPWAãæãæ©è½ã¯æ§ã ãªãã®ãããã¾ãã ãªãã©ã¤ã³ãã£ãã·ã¥ ãã¼ã ã¹ã¯ãªã¼ã³è¿½å ããã·ã¥éç¥ ã«ã¡ã© 決æ¸æ©è½ etc iOSã§ã¯Androidã¨æ¯ã¹ã¦PWAã®å¯¾å¿ãé ãããã£ãã·ã¥ä»¥å¤ã¯ãã¾ã使ããã¨ããªãã£ãã®ã§ããã æè¿iPhoneããPixel4ã«æ©ç¨®å¤æ´ãããã¨ããããæå ã®ç°å¢ã§è²ã ã¨PWAã試ããã¨ãã§ããããã«ãªã£ãã®ã§ã è²ã å®è£ ãã¦éãã§ã¿ã¾ããã ä»åã¯ãæ¯è¼çç°¡åã«å®è£ ãã§ããã ãªãã©ã¤ã³ãã£ãã·ã¥ ãã¼ã ã¹ã¯ãªã¼ã³è¿½å ããã·ã¥éç¥ ãNuxt.jsã¨Push7ã¨ãããµã¼ãã¹ã使ã£ã¦ãå®è£ ãã¦ã¿ããã¨æãã¾ãã ãªããä»åä½æãããµã³ãã«ã¯ä»¥ä¸ã®URLã«ã¢ãããã¦ãã¾ãã https://nuxtpwa.netlify.com/ https:/
æ¦è¦ rm -rf node_modules ãã¦ãã npm install ãã¦ãã¨ã©ã¼ãã§ããã¨ããããããããã¨ãã¯ãã£ãã·ã¥ãæªãããã¦ãå ´åãå¤ãã 対å¦æ³ $ npm cache clean $ npm cache ls $ rm -rf ~/.npm npm cache clean ãã¦ãæ®ã£ã¦ãå ´åãããã®ã§ãnpm cache ls ãã¦ã¨ã©ã¼å¯¾è±¡ã®ããã±ã¼ã¸ãå«ã¾ãã¦ããã¿ãã å«ã¾ãã¦ããã.npm ã丸ãã¨åé¤ãã¦ãã¾ãã
åã®ãã·ã³ macbook pro 13inch ã¿ãããã¼ãªãã¢ãã« ã¡ã¢ãª 16GB 容é 256GB SSDã®å®¹éãã«ã¹ã¿ã ã§å¢ãã256GBã«ããã®ã«ãã·ã¹ãã ã§180GBãããã¦ããã£ã¦ã©ããããã¨ãï¼ã¨æã£ã¦ã»ã«ã»ã«éãã®ãã¡ã¤ã«ãæ¶ãã¦ãããã§ãã空ã容éã20GBã«ã¾ã§ããã¤ããã対å¦ããå¿ è¦ãã§ã¦ãã¾ããã ãããããããªã«macæ¬ä½ã«ãã¼ã¿å ¥ãã¦ãªããã¼ã誤表示ã ãã¼ã¨æã£ã¦ããã®ã§ã ãã®ãµã¤ã ã®æé ã©ããã ã»ã¼ãã¢ã¼ãããNVRAMã¢ã¼ãã試ãã¾ããããããã¨ãããã¨ãè¨ãã¾ããã§ããã OSã®åã¤ã³ã¹ãã¼ã«ã¯ãããã«é¢åãªã®ã§Apple store ã³ã¼ã«ã»ã³ã¿ã¼ã«é»è©±ããããç¡äºè§£æ±ºã åã®å ´ååç»ç·¨éæã«çºçããadobeã¢ããªã®ãã£ãã·ã¥ãåå ã§ãããããããã®ãã£ãã·ã¥ã¯ç¹å¥ãªæé ã§ãªãã¨ç¢ºèªã§ããªãã¨ã®ãã¨ã§ããã ãã£ãã·ã¥ãé¤å»ããã ãã§ã解決ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}