Skip to content

Commit

Permalink
🔥 Remove @nuxtjs/pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Apr 12, 2024
1 parent ecf299e commit 9982d20
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 46 deletions.
27 changes: 26 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,30 @@
import { Vue, Component } from 'vue-property-decorator'
@Component
export default class DefaultLayout extends Vue {}
export default class DefaultLayout extends Vue {
// eslint-disable-next-line class-methods-use-this
async mounted() {
// Remove these if we use PWA again
// Deregister service workers, delete all cache
try {
if (window.navigator && window.navigator.serviceWorker) {
const registrations = await window.navigator.serviceWorker.getRegistrations();
if (registrations?.length) {
registrations.forEach(registration => {
registration.unregister();
});
}
}
if (window.caches) {
const keyList = await window.caches.keys();
if (keyList?.length) {
await Promise.all(keyList.map(key => caches.delete(key)));
}
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
}
}
</script>
9 changes: 0 additions & 9 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ export default {
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',

// https://i18n.nuxtjs.org
'@nuxtjs/i18n',
Expand All @@ -149,13 +147,6 @@ export default {
retry: { retries: 1 },
},

// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
},
},

i18n: {
locales: [{
code: 'en',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@likecoin/wallet-connector": "^0.26.1",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/i18n": "^7.0.1",
"@nuxtjs/pwa": "^3.3.5",
"@nuxtjs/sentry": "^5.1.6",
"@nuxtjs/sitemap": "^2.4.0",
"@tailwindcss/aspect-ratio": "^0.2.1",
Expand Down
37 changes: 2 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4602,21 +4602,6 @@
dependencies:
http-proxy-middleware "^1.0.6"

"@nuxtjs/pwa@^3.3.5":
version "3.3.5"
resolved "https://registry.yarnpkg.com/@nuxtjs/pwa/-/pwa-3.3.5.tgz#db7c905536ebe8a464a347b6ae3215810642c044"
integrity sha512-8tTmW8DBspWxlJwTimOHTkwfkwPpL9wIcGmy75Gcmin+c9YtX2Ehxmhgt/TLFOC9XsLAqojqynw3/Agr/9OE1w==
dependencies:
clone-deep "^4.0.1"
defu "^3.2.2"
execa "^5.0.0"
fs-extra "^9.1.0"
hasha "^5.2.2"
jimp-compact "^0.16.1"
lodash.template "^4.5.0"
serve-static "^1.14.1"
workbox-cdn "^5.1.4"

"@nuxtjs/sentry@^5.1.6":
version "5.1.6"
resolved "https://registry.yarnpkg.com/@nuxtjs/sentry/-/sentry-5.1.6.tgz#d6296684553112f6873d0c33f2a488650cd5b919"
Expand Down Expand Up @@ -12390,7 +12375,7 @@ fs-extra@^8.1.0:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^9.0.0, fs-extra@^9.0.1, fs-extra@^9.1.0:
fs-extra@^9.0.0, fs-extra@^9.0.1:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
Expand Down Expand Up @@ -13050,14 +13035,6 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7, hash.js@~1.1.7:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"

hasha@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/hasha/-/hasha-5.2.2.tgz#a48477989b3b327aea3c04f53096d816d97522a1"
integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==
dependencies:
is-stream "^2.0.0"
type-fest "^0.8.0"

hasown@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c"
Expand Down Expand Up @@ -14807,11 +14784,6 @@ jest@^27.0.5:
import-local "^3.0.2"
jest-cli "^27.0.5"

jimp-compact@^0.16.1:
version "0.16.1"
resolved "https://registry.yarnpkg.com/jimp-compact/-/jimp-compact-0.16.1.tgz#9582aea06548a2c1e04dd148d7c3ab92075aefa3"
integrity sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==

jiti@^1.10.1:
version "1.11.0"
resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.11.0.tgz#64120a30d97b9bf37b8b032cf4564dfadc28984c"
Expand Down Expand Up @@ -21813,7 +21785,7 @@ type-fest@^0.6.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b"
integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==

type-fest@^0.8.0, type-fest@^0.8.1:
type-fest@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
Expand Down Expand Up @@ -22966,11 +22938,6 @@ word-wrap@^1.2.3, word-wrap@~1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==

workbox-cdn@^5.1.4:
version "5.1.4"
resolved "https://registry.yarnpkg.com/workbox-cdn/-/workbox-cdn-5.1.4.tgz#dbd8acee70b1978be70106207590bbb76af935cf"
integrity sha512-04gM3mi8QGutokkSaA9xunVfjURnLbo9TTWyi8+pSDCEW5cD8u5GbJiliLK1vB9CShk/9OY1UDfW+XcmD+d6KQ==

worker-farm@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
Expand Down

0 comments on commit 9982d20

Please sign in to comment.