Repository navigation
perf(frontend): load the map tiles without waiting for the overlay and dialogs - #613
Merged
JuliusHenke merged 1 commit intoOct 12, 2026
Merged
Conversation
…d dialogs The map, the overlay and the attribution shared one Suspense boundary, so no tile was requested before the date picker and icon chunks were loaded and rendered (about 500 ms of the LCP). The map is now part of the entry, the overlay has its own boundary, and the relay and family dialogs are only loaded when they are opened for the first time. Lighthouse (local build, mock API, median of 5): LCP desktop 1390 -> 995 ms, mobile 6230 -> 4476 ms. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit 11cfb6f): https://tormap-36f44--pr613-perf-frontend-indepe-f3t0zrlp.web.app (expires Wed, 11 Nov 2026 20:51:36 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A Lighthouse run showed that the LCP element (a map tile) was requested about 500 ms after the map chunk had arrived. In
App.tsxthe map, the overlay and the attribution links shared one<Suspense>boundary, and React only commits a boundary once every lazy child is ready. The tiles therefore waited for the date picker (233 kB), the icons chunk (102 kB) and a 125 ms render task. The day data request, which starts in the map's effect, waited as well.ExternalLinkis imported directly. It was lazy-imported inApp.tsxbut statically imported by five other modules, so the lazy import only delayed the boundary (Vite warnedINEFFECTIVE_DYNAMIC_IMPORT).ResponsiveRelayDetailsDialogderived its state from changes of the relays and started with the current value, so a dialog that mounts when it is opened missed the first location. Its tracking state now starts empty. The existing marker click test caught this.Measurement
Same build settings and a deterministic local mock API (6,900 relays per day, 25 ms latency), Lighthouse 13.4.1, simulated throttling (mobile and desktop presets), median of 5 runs:
* The mobile preset's raw "load delay" was already small there, the gain shows in the LCP itself.
Other numbers (median): requests 62 -> 52 (desktop), transfer 779 -> 551 KiB, mobile TBT 54 -> 6 ms, CLS 0. FCP is unchanged on desktop (567 -> 570 ms) and slightly higher on mobile (2.57 -> 2.73 s), since the map is now part of the entry graph. Real tiles from the CARTO CDN were used, so a few percent of run-to-run noise is expected.
Verification
tsc,eslint,vite build(the warning is gone) andyarn test:run(275 tests) pass. The Lighthouse tool was installed in a scratch directory only (lighthouse@13.4.1: Apache-2.0, 2.5 months old, no advisories on deps.dev, no OpenSourceMalware report; transitive dependencies are not covered by those checks), nothing was added to the project.Dependencies / deployment
None.
🤖 Generated with Claude Code