various bundle optimizations (#1549)

* fix: missing "@element-plus/icons-vue" dependency

* fix: update vite (40% faster builds)

* fix: don't include sentry in non-nightly builds

* fix: swap to variable fonts & don't include font files in repo

* fix: lazy load languages to not keep them in memory

* nit: revert vite to stable

* nit: retain `.json` message files in bundle

* nit: remove bundle analyzer

* fix: availableLocales does not include unloaded locales
This commit is contained in:
Aries
2026-01-03 23:51:00 -07:00
committed by GitHub
parent 327e7d9b58
commit b02d287190
38 changed files with 574 additions and 619 deletions

View File

@@ -12,13 +12,14 @@ import { watchState } from '../../service/watchState';
import configRepository from '../../service/config';
import webApiService from '../../service/webapi';
import { languageCodes } from '../../localization';
export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
const gameStore = useGameStore();
const vrcxStore = useVrcxStore();
const VRCXUpdaterStore = useVRCXUpdaterStore();
const { availableLocales, t } = useI18n();
const { t } = useI18n();
const state = reactive({
folderSelectorDialogVisible: false
@@ -163,7 +164,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
if (
!bioLanguageConfig ||
!availableLocales.includes(bioLanguageConfig)
!languageCodes.includes(bioLanguageConfig)
) {
bioLanguage.value = 'en';
} else {
@@ -467,7 +468,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
}
async function checkSentryConsent() {
ElMessageBox.confirm(
const { action: consentAction } = await ElMessageBox.confirm(
'Help improve VRCX by allowing anonymous error reporting?</br></br>' +
'• Only collects crash and error information.</br>' +
'• No personal data or VRChat information is collected.</br>' +
@@ -482,42 +483,35 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
closeOnPressEscape: false,
distinguishCancelAndClose: true
}
)
.then(() => {
sentryErrorReporting.value = true;
configRepository.setString('VRCX_SentryEnabled', 'true');
).catch(() => ({ action: 'cancel' }));
ElMessageBox.confirm(
'Error reporting setting has been enabled. Would you like to restart VRCX now for the change to take effect?',
'Restart Required',
{
confirmButtonText: 'Restart Now',
cancelButtonText: 'Later',
type: 'warning',
center: true,
closeOnClickModal: false,
closeOnPressEscape: false
}
).then(() => {
VRCXUpdaterStore.restartVRCX(false);
});
})
.catch((action) => {
const act =
typeof action === 'string' ? action : action?.action;
if (act === 'cancel') {
sentryErrorReporting.value = false;
configRepository.setString('VRCX_SentryEnabled', 'false');
}
});
if (consentAction === 'cancel') return;
const { action: restartAction } = await ElMessageBox.confirm(
'Error reporting setting has been enabled. Would you like to restart VRCX now for the change to take effect?',
'Restart Required',
{
confirmButtonText: 'Restart Now',
cancelButtonText: 'Later',
type: 'warning',
center: true,
closeOnClickModal: false,
closeOnPressEscape: false
}
).catch(() => ({ action: 'cancel' }));
if (restartAction === 'cancel') return;
sentryErrorReporting.value = true;
configRepository.setBool('VRCX_SentryEnabled', true);
VRCXUpdaterStore.restartVRCX(false);
}
async function setSentryErrorReporting() {
if (VRCXUpdaterStore.branch !== 'Nightly') {
return;
}
if (VRCXUpdaterStore.branch !== 'Nightly') return;
ElMessageBox.confirm(
const { action: restartAction } = await ElMessageBox.confirm(
'Error reporting setting has been disabled. Would you like to restart VRCX now for the change to take effect?',
'Restart Required',
{
@@ -526,16 +520,16 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
type: 'info',
center: true
}
)
.then(async () => {
sentryErrorReporting.value = !sentryErrorReporting.value;
await configRepository.setString(
'VRCX_SentryEnabled',
sentryErrorReporting.value ? 'true' : 'false'
);
VRCXUpdaterStore.restartVRCX(false);
})
.catch(() => {});
).catch(() => ({ action: 'cancel' }));
if (restartAction === 'cancel') return;
sentryErrorReporting.value = !sentryErrorReporting.value;
await configRepository.setBool(
'VRCX_SentryEnabled',
sentryErrorReporting.value
);
VRCXUpdaterStore.restartVRCX(false);
}
async function getSqliteTableSizes() {