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

This commit is contained in:
Daniel Roe 2022-12-22 14:22:56 +00:00 committed by GitHub
parent 3442adbeb6
commit 8d8b2b0a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -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,
})

View file

@ -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',