1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-23 22:56:09 +09:00

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

View File

@ -40,6 +40,8 @@ export default defineNuxtConfig({
'querystring': 'rollup-plugin-node-polyfills/polyfills/qs', 'querystring': 'rollup-plugin-node-polyfills/polyfills/qs',
'masto/fetch': 'masto/fetch', 'masto/fetch': 'masto/fetch',
'masto': 'masto/fetch', 'masto': 'masto/fetch',
'change-case': 'scule',
'semver': 'unenv/runtime/mock/empty',
}, },
vite: { vite: {
define: { define: {
@ -84,10 +86,6 @@ export default defineNuxtConfig({
env: isCI ? isPreview ? 'staging' : 'production' : 'local', env: isCI ? isPreview ? 'staging' : 'production' : 'local',
pwaEnabled: !isDevelopment || process.env.VITE_DEV_PWA === 'true', pwaEnabled: !isDevelopment || process.env.VITE_DEV_PWA === 'true',
translateApi: '', 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: { storage: {
driver: isCI ? 'cloudflare' : 'fs', driver: isCI ? 'cloudflare' : 'fs',