perf: eager preconnections and map loading to cut initial boot by 3s
This commit is contained in:
@ -12,6 +12,10 @@
|
|||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link rel="preconnect" href="https://maps.googleapis.com">
|
||||||
|
<link rel="dns-prefetch" href="https://maps.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://wtxzmbqchntjymxszngc.supabase.co" crossorigin>
|
||||||
|
<link rel="dns-prefetch" href="https://wtxzmbqchntjymxszngc.supabase.co">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap" rel="stylesheet">
|
||||||
<title>SIBU - Sistema de Transporte</title>
|
<title>SIBU - Sistema de Transporte</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import { useTaxiStore } from './stores/taxi'
|
|||||||
import { useShuttleStore } from './stores/shuttle'
|
import { useShuttleStore } from './stores/shuttle'
|
||||||
import { useCouponStore } from './stores/coupon'
|
import { useCouponStore } from './stores/coupon'
|
||||||
import { supabase } from '@/supabase'
|
import { supabase } from '@/supabase'
|
||||||
|
import { useGoogleMaps } from '@/composables/useGoogleMaps'
|
||||||
// useFavoritesStore ya importado arriba (línea 8)
|
// useFavoritesStore ya importado arriba (línea 8)
|
||||||
|
|
||||||
// Initialize theme store
|
// Initialize theme store
|
||||||
@ -22,6 +23,10 @@ const { locale } = useI18n()
|
|||||||
const themeStore = useThemeStore()
|
const themeStore = useThemeStore()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const favoritesStore = useFavoritesStore()
|
const favoritesStore = useFavoritesStore()
|
||||||
|
const { loadMaps } = useGoogleMaps()
|
||||||
|
|
||||||
|
// Iniciar descarga asíncrona masiva de Google Maps al bootear VUE (Ahorra ~3 seg de espera en MapView)
|
||||||
|
loadMaps()
|
||||||
|
|
||||||
const isSplashScreen = computed(() => route.name === 'splash')
|
const isSplashScreen = computed(() => route.name === 'splash')
|
||||||
const isAuthScreen = computed(() => {
|
const isAuthScreen = computed(() => {
|
||||||
|
|||||||
@ -221,7 +221,6 @@ function handleVisibilityChange() {
|
|||||||
|
|
||||||
async function initializeMap() {
|
async function initializeMap() {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
await new Promise(resolve => setTimeout(resolve, 100));
|
|
||||||
|
|
||||||
initMap("map", mapStore.center, mapStore.zoom);
|
initMap("map", mapStore.center, mapStore.zoom);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user