perf: remove semver dependency and skip version checks (#509)

pull/517/head
Daniel Roe 2022-12-22 14:22:56 +00:00 zatwierdzone przez GitHub
rodzic 3442adbeb6
commit 8d8b2b0a01
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 6 usunięć

Wyświetl plik

@ -44,14 +44,13 @@ export const useUsers = () => users
export const characterLimit = computed(() => currentInstance.value?.configuration.statuses.maxCharacters ?? DEFAULT_POST_CHARS_LIMIT)
async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: AccountCredentials }) {
const config = useRuntimeConfig()
const route = useRoute()
const router = useRouter()
const server = user?.server || route.params.server as string || publicServer.value
const masto = await loginMasto({
url: `https://${server}`,
accessToken: user?.token,
disableVersionCheck: !!config.public.disableVersionCheck,
disableVersionCheck: true,
// Suppress warning of `masto/fetch` usage
disableExperimentalWarning: true,
})

Wyświetl plik

@ -40,6 +40,8 @@ export default defineNuxtConfig({
'querystring': 'rollup-plugin-node-polyfills/polyfills/qs',
'masto/fetch': 'masto/fetch',
'masto': 'masto/fetch',
'change-case': 'scule',
'semver': 'unenv/runtime/mock/empty',
},
vite: {
define: {
@ -84,10 +86,6 @@ export default defineNuxtConfig({
env: isCI ? isPreview ? 'staging' : 'production' : 'local',
pwaEnabled: !isDevelopment || process.env.VITE_DEV_PWA === 'true',
translateApi: '',
// Masto uses Mastodon version checks to see what features are enabled.
// Mastodon alternatives like GoToSocial will always fail these checks, so
// provide a way to disable them.
disableVersionCheck: false,
},
storage: {
driver: isCI ? 'cloudflare' : 'fs',