From b48935f8ec9cf19f49a6083c4a7d385ee0fdf797 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Wed, 25 Sep 2024 21:19:54 +0200 Subject: [PATCH] Improve support for older browsers/devices (#8) Apply @vitejs/plugin-legacy to use polyfills with older and modern browsers --- .browserslistrc | 8 +-- package-lock.json | 174 +++++++++++----------------------------------- package.json | 6 +- vite.config.ts | 6 ++ 4 files changed, 53 insertions(+), 141 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index 4cf6588..36faad2 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,9 +1,9 @@ >= 0.5% last 2 major versions not dead -Chrome >= 60 -Firefox >= 60 +Chrome >= 90 +Firefox >= 91 Firefox ESR -iOS >= 12 -Safari >= 12 +iOS >= 15 +Safari >= 15 not Explorer <= 11 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5ec5a78..64806fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "@brdgm/welcome-to-the-moon-solo-helper", "version": "1.0.7", "dependencies": { - "@brdgm/brdgm-commons": "^1.6.8", + "@brdgm/brdgm-commons": "^1.6.9", "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.3", "core-js": "^3.38.1", @@ -39,10 +39,10 @@ "eslint-plugin-vue": "^9.28.0", "jsdom": "^25.0.1", "nodemon": "^3.1.7", - "sass": "^1.78.0", + "sass": "~1.78.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", - "typescript": "^5.5.4", + "typescript": "~5.5.4", "vite": "^5.4.7", "vite-plugin-pwa": "^0.20.5", "vitest": "^2.1.1" @@ -1761,78 +1761,18 @@ } }, "node_modules/@brdgm/brdgm-commons": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@brdgm/brdgm-commons/-/brdgm-commons-1.6.8.tgz", - "integrity": "sha512-mRBNdDh0tHg+5LX+60Pl+e3J4bz4+Hsyk/wsvHs060l+XsyDyLqvlqBDoUszxuB/opzO4Owgch073HomInMyXA==", + "version": "1.6.9", + "resolved": "https://registry.npmjs.org/@brdgm/brdgm-commons/-/brdgm-commons-1.6.9.tgz", + "integrity": "sha512-c6VhZNaRH85hTKEGpzSTqFE6YgdVHHb5do1j8l9YLCL7WasJOXQ0qXUCw+5ZIsztzmz0i28nWVYCt9BvPtmH0w==", "dependencies": { "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.3", - "core-js": "^3.37.1", + "core-js": "^3.38.1", "lodash": "^4.17.21", "set-interval-async": "^3.0.3", - "vue": "^3.4.34", - "vue-i18n": "^9.13.1", - "vue-router": "^4.4.0" - } - }, - "node_modules/@brdgm/brdgm-commons/node_modules/@intlify/core-base": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.14.0.tgz", - "integrity": "sha512-zJn0imh9HIsZZUtt9v8T16PeVstPv6bP2YzlrYJwoF8F30gs4brZBwW2KK6EI5WYKFi3NeqX6+UU4gniz5TkGg==", - "dependencies": { - "@intlify/message-compiler": "9.14.0", - "@intlify/shared": "9.14.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, - "node_modules/@brdgm/brdgm-commons/node_modules/@intlify/message-compiler": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.14.0.tgz", - "integrity": "sha512-sXNsoMI0YsipSXW8SR75drmVK56tnJHoYbPXUv2Cf9lz6FzvwsosFm6JtC1oQZI/kU+n7qx0qRrEWkeYFTgETA==", - "dependencies": { - "@intlify/shared": "9.14.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, - "node_modules/@brdgm/brdgm-commons/node_modules/@intlify/shared": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.14.0.tgz", - "integrity": "sha512-r+N8KRQL7LgN1TMTs1A2svfuAU0J94Wu9wWdJVJqYsoMMLIeJxrPjazihfHpmJqfgZq0ah3Y9Q4pgWV2O90Fyg==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, - "node_modules/@brdgm/brdgm-commons/node_modules/vue-i18n": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.14.0.tgz", - "integrity": "sha512-LxmpRuCt2rI8gqU+kxeflRZMQn4D5+4M3oP3PWZdowW/ePJraHqhF7p4CuaME52mUxdw3Mmy2yAUKgfZYgCRjA==", - "dependencies": { - "@intlify/core-base": "9.14.0", - "@intlify/shared": "9.14.0", - "@vue/devtools-api": "^6.5.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - }, - "peerDependencies": { - "vue": "^3.0.0" + "vue": "^3.5.8", + "vue-i18n": "^10.0.3", + "vue-router": "^4.4.5" } }, "node_modules/@canvas/image-data": { @@ -2436,17 +2376,6 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/core-base/node_modules/@intlify/shared": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-10.0.3.tgz", - "integrity": "sha512-PWxrCb6fDlnoGLnXLlWu6d7o/HdWACB9TjRnpLro+9uyfqgWA9hvqg5vekcPRyraTieV5srCbTk/ldYw9V3LHw==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, "node_modules/@intlify/message-compiler": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-10.0.3.tgz", @@ -2462,7 +2391,7 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/message-compiler/node_modules/@intlify/shared": { + "node_modules/@intlify/shared": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-10.0.3.tgz", "integrity": "sha512-PWxrCb6fDlnoGLnXLlWu6d7o/HdWACB9TjRnpLro+9uyfqgWA9hvqg5vekcPRyraTieV5srCbTk/ldYw9V3LHw==", @@ -2473,18 +2402,6 @@ "url": "https://github.com/sponsors/kazupon" } }, - "node_modules/@intlify/shared": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-10.0.0.tgz", - "integrity": "sha512-6ngLfI7DOTew2dcF9WMJx+NnMWghMBhIiHbGg+wRvngpzD5KZJZiJVuzMsUQE1a5YebEmtpTEfUrDp/NqVGdiw==", - "dev": true, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, "node_modules/@intlify/unplugin-vue-i18n": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@intlify/unplugin-vue-i18n/-/unplugin-vue-i18n-5.2.0.tgz", @@ -2895,9 +2812,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.1.tgz", - "integrity": "sha512-bVRmQqBIyGD+VMihdEV2IBurfIrdW9tD9yzJUL3CBRDbyPBVzQnBSMSgyUZHl1E335rpMRj7r4o683fXLYw8iw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", + "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -3189,9 +3106,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.19", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.19.tgz", - "integrity": "sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==", + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", "dev": true }, "node_modules/@types/estree": { @@ -3211,9 +3128,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.17.7", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", - "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", + "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", "dev": true }, "node_modules/@types/mocha": { @@ -3223,9 +3140,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.5.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", - "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", + "version": "22.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.1.tgz", + "integrity": "sha512-adOMRLVmleuWs/5V/w5/l7o0chDK/az+5ncCsIapTKogsu/3MVWvSgP58qVTXi5IwpfGt8pMobNq9rOWtJyu5Q==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -3959,9 +3876,9 @@ } }, "node_modules/b4a": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", - "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", "dev": true }, "node_modules/babel-plugin-istanbul": { @@ -4071,9 +3988,9 @@ "dev": true }, "node_modules/bare-events": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.4.2.tgz", - "integrity": "sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", "dev": true, "optional": true }, @@ -4204,9 +4121,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", + "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", "funding": [ { "type": "opencollective", @@ -4222,8 +4139,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, @@ -4952,9 +4869,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.27", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.27.tgz", - "integrity": "sha512-o37j1vZqCoEgBuWWXLHQgTN/KDKe7zwpiY5CPeq2RvUqOyJw9xnrULzZAEVQ5p4h+zjMk7hgtOoPdnLxr7m/jw==" + "version": "1.5.28", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.28.tgz", + "integrity": "sha512-VufdJl+rzaKZoYVUijN13QcXVF5dWPZANeFTLNy+OSpHdDL5ynXTF35+60RSBbaQYB1ae723lQXHCrf4pyLsMw==" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -9837,9 +9754,9 @@ "dev": true }, "node_modules/vite": { - "version": "5.4.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.7.tgz", - "integrity": "sha512-5l2zxqMEPVENgvzTuBpHer2awaetimj2BGkhBPdnwKbPNOlHsODU+oiazEZzLK7KhAnOrO+XGYJYn4ZlUhDtDQ==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "dependencies": { "esbuild": "^0.21.3", @@ -10073,17 +9990,6 @@ "vue": "^3.0.0" } }, - "node_modules/vue-i18n/node_modules/@intlify/shared": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-10.0.3.tgz", - "integrity": "sha512-PWxrCb6fDlnoGLnXLlWu6d7o/HdWACB9TjRnpLro+9uyfqgWA9hvqg5vekcPRyraTieV5srCbTk/ldYw9V3LHw==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/kazupon" - } - }, "node_modules/vue-router": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.4.5.tgz", diff --git a/package.json b/package.json index 1acd8fb..4de9240 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "generate-pwa-assets": "pwa-assets-generator" }, "dependencies": { - "@brdgm/brdgm-commons": "^1.6.8", + "@brdgm/brdgm-commons": "^1.6.9", "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.3", "core-js": "^3.38.1", @@ -47,10 +47,10 @@ "eslint-plugin-vue": "^9.28.0", "jsdom": "^25.0.1", "nodemon": "^3.1.7", - "sass": "^1.78.0", + "sass": "~1.78.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", - "typescript": "^5.5.4", + "typescript": "~5.5.4", "vite": "^5.4.7", "vite-plugin-pwa": "^0.20.5", "vitest": "^2.1.1" diff --git a/vite.config.ts b/vite.config.ts index cef8be9..856c090 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import path from 'path' import { description, appDeployName } from './package.json' +import legacy from '@vitejs/plugin-legacy' // https://vitejs.dev/config/ export default defineConfig({ @@ -59,6 +60,11 @@ export default defineConfig({ VueI18nPlugin({ include: [path.resolve(__dirname, './src/locales/**')], strictMessage: false + }), + // support older browsers + legacy({ + modernTargets: 'iOS >= 15, Safari >= 15', + modernPolyfills: true }) ], resolve: {