Optimize site loading performance - #11
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Closing as superseded. The same goals (drop Turf length from the page graph, Mapbox connection warming, caching) landed via #10 and follow-ups on main. This branch is conflicting and stale. |
Motivation
Description
lengthusage inlib/geo.tswith a small in-repo haversine implementation (segmentDistanceMetersandgeometryDistanceMeters) used bylineDistanceMeters,coordinateBounds, androuteFeatureCollectionso route/bounds math no longer imports Turf length into the page graph.preconnectanddns-prefetchlink hints for Mapbox origins inapp/layout.tsxto warm the network connection before the dynamic map initializes.lucide-reactand an HTTP header rule innext.config.mjsto setCache-Control: public, max-age=31536000, immutablefor static image asset paths to enable long-lived caching.Testing
npm run test(Vitest) and all unit tests passed:23 files, 192 tests(passed).npm run typecheck && npm run lint && npm run buildand the build/typegen completed successfully while ESLint reported one pre-existing warning inlib/hooks/useMembership.ts.npm run test -- --runInBandfailed because Vitest does not accept the Jest--runInBandflag, which is a tooling invocation mismatch rather than a code regression.Codex Task