From 4a6886d2c9ed35e0658c2314f7e35f982507e920 Mon Sep 17 00:00:00 2001 From: doxa-maps-88655c70 <88627970+doxa-maps-88655c70@users.noreply.github.com> Date: Fri, 25 Sep 2026 08:56:05 +0000 Subject: [PATCH] Embed snippets preload the Mapbox engine, so a partner page fetches it alongside the bundle The card asked for Vue to be bundled inline to make maps faster. It already is: vite.config.js externalises only jspdf, and every IIFE carries its Vue runtime. The measurement (internal/measure-map-load.mjs, cold, 10 Mbps / 60 ms, served built tree) found one serial runtime fetch before first paint, on partner pages only. A page that pastes the embed snippet has no leaf page to fetch mapbox-gl.js (~480 KB gz), so the bundle requested it after it had downloaded, run and mounted. Leaf pages already load it in parallel. Map profiles' script snippets now start with a preload for the engine, at the URL read from useMapInstance.js ENGINES.mapbox.js so the two can never differ. It has no crossorigin attribute because ensureEngineScript injects a plain