Lazy-load globe map stack#4012
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR lazy-loads the
Confidence Score: 3/5Globe mode becomes permanently unavailable after any chunk load failure until the page is refreshed, with no user-visible error or fallback. The cancellation guards, activation-ID pattern, and data-rehydration flow are sound. The one weak spot is that initGlobeMap has no error handling and globeMapCtorPromise is never cleared on failure, so a single chunk-load failure leaves globe mode permanently broken for the session. src/components/MapContainer.ts — specifically the initGlobeMap and loadGlobeMapCtor pair. Important Files Changed
Reviews (1): Last reviewed commit: "fix: lazy-load globe map stack" | Re-trigger Greptile |
Summary
Fixes #3534.
Lazy-loads the
GlobeMapimplementation so non-globe users no longer pull theglobe.gl/threestack when the map container loads. Adds a dedicatedglobe-stackmanual chunk and keeps it out of entry HTML modulepreload dependencies alongside the other lazy map chunks.What changed
GlobeMapimport inMapContainerwith a cached dynamic import used only when globe mode is active.globe-stackrouting forglobe.glandthreein VitemanualChunks, with matching lazy preload filtering.Validation
npm run typechecknpx vite buildgit diff --checkBundle evidence
Production build emitted separate lazy chunks:
dist/assets/MapContainer-Seew60-4.js- 400.09 kBdist/assets/GlobeMap-ClY9cqUr.js- 90.84 kBdist/assets/globe-stack-RvfsjqqG.js- 1,689.87 kBdist/*.htmldid not containGlobeMap-*,globe-stack-*,MapContainer-*,maplibre-*, ordeck-stack-*asset references, confirming the lazy map chunks are not hoisted into entry HTML preload links.Residual risk
Browser runtime smoke was not run. The main remaining manual check is toggling 2D to 3D and startup with persisted
mapMode=globeto verify the async chunk load renders as expected.