From b45f53417ab1047ca721627e517570339d04e05a Mon Sep 17 00:00:00 2001
From: Hanzo_dev <2002samudiojohan@gmail.com>
Date: Wed, 4 Mar 2026 11:05:08 -0500
Subject: [PATCH] perf: eager preconnections and map loading to cut initial
boot by 3s
---
frontend/index.html | 4 ++++
frontend/src/App.vue | 5 +++++
frontend/src/views/MapView.vue | 1 -
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/frontend/index.html b/frontend/index.html
index 6a0fa68..8bea024 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -12,6 +12,10 @@
+
+
+
+
SIBU - Sistema de Transporte
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 4aed456..83707ca 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -14,6 +14,7 @@ import { useTaxiStore } from './stores/taxi'
import { useShuttleStore } from './stores/shuttle'
import { useCouponStore } from './stores/coupon'
import { supabase } from '@/supabase'
+import { useGoogleMaps } from '@/composables/useGoogleMaps'
// useFavoritesStore ya importado arriba (línea 8)
// Initialize theme store
@@ -22,6 +23,10 @@ const { locale } = useI18n()
const themeStore = useThemeStore()
const authStore = useAuthStore()
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 isAuthScreen = computed(() => {
diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue
index 6c94de5..1600230 100644
--- a/frontend/src/views/MapView.vue
+++ b/frontend/src/views/MapView.vue
@@ -221,7 +221,6 @@ function handleVisibilityChange() {
async function initializeMap() {
await nextTick();
- await new Promise(resolve => setTimeout(resolve, 100));
initMap("map", mapStore.center, mapStore.zoom);