mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
chore(client): take the GL engines out of the entry chunk (#1801)
* refactor(settings): load the GL map preview on demand MapViewGL and JourneyMapGL are both behind lazy() so a Leaflet-only install never downloads the GL engines. MapboxPreview imported mapbox-gl and maplibre-gl statically, which put them back in the entry chunk and cancelled that out. Wrap it in lazy()/Suspense on both the desktop tab and the mobile screen. The entry chunk drops from 7987 kB to 5157 kB (2057 kB to 1292 kB gzipped); the engines now ship as their own chunk, loaded when a GL provider is picked. The preview no longer resolves synchronously, so the tests that read it right after switching provider await it now. * chore(client): drop unused deps, self-host MuseoModerno, add a bundle baseline @react-pdf/renderer, react-window and @types/react-window have no importers anywhere: TripPDF builds HTML for the browser print window and JourneyBookPDF goes through marked. RegisterPage is dead too, /register renders LoginPage. MuseoModerno was the last font still coming from the Google CDN through a render-blocking <link>, while main.tsx already self-hosts Poppins and Geist for exactly the reason stated in the comment there. Same weights, now bundled. Add rollup-plugin-visualizer behind `npm run build:analyze` so the splitting work has numbers to argue with, pin build.target instead of inheriting Vite's default, and bring the workbox size ceiling down from 10 MB to 6 MB — anything above it is dropped from the precache manifest silently, which only shows up as a broken offline app.
This commit is contained in:
Generated
+255
-482
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user