Skip to content

perf(map): improve map bundle loading#14

Merged
ronload merged 3 commits into
mainfrom
perf/improve-map-bundle-loading
Apr 15, 2026
Merged

perf(map): improve map bundle loading#14
ronload merged 3 commits into
mainfrom
perf/improve-map-bundle-loading

Conversation

@ronload

@ronload ronload commented Apr 15, 2026

Copy link
Copy Markdown
Owner
  • perf(map): defer map chunk loading to unblock main thread
  • fix(map): resolve react-hooks/set-state-in-effect lint errors
  • style: format code style

ronload added 3 commits April 15, 2026 14:42
Mobile/tablet: skip rendering TaiwanMap entirely via JS media query
instead of CSS hidden, so the 1MB maplibre-gl chunk is never downloaded.

Desktop: show a placeholder first and defer mounting until the main
thread is idle (requestIdleCallback with setTimeout fallback for Safari),
letting the address form become interactive immediately.
Replace useMediaQuery implementation with useSyncExternalStore to
avoid synchronous setState in effect. Remove unnecessary setMapReady
reset since the isDesktop guard already prevents map rendering.
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zipkit Ready Ready Preview, Comment Apr 15, 2026 6:46am

@ronload ronload merged commit 5bcd801 into main Apr 15, 2026
3 checks passed
@ronload ronload deleted the perf/improve-map-bundle-loading branch April 15, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant