Skip to content

fix(solid/tanstackrouter): Ensure web vitals are sent on pageload - #18542

Merged
logaretm merged 1 commit into
developfrom
awad/js-1323-solid-core-web-vitals-arent-reported-with-tanstack-router
Dec 17, 2025
Merged

logaretm merged 1 commit into
developfrom
awad/js-1323-solid-core-web-vitals-arent-reported-with-tanstack-router

Conversation

@logaretm

Copy link
Copy Markdown
Member

Adjusted the condition for reporting web vitals previously it would short circuit and prevent them from being reported, I included a test.

similar to what we did in #18463

closes #18540

@linear

linear Bot commented Dec 17, 2025

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where web vitals were not being sent on pageload in the Solid TanStack Router integration. The problem was caused by a conditional check that would short-circuit during initial pageload, preventing the pageload transaction from completing and sending web vitals measurements.

  • Updated the navigation span filtering logic to explicitly check for absence of fromLocation before comparing location states
  • Added comprehensive test coverage to verify web vitals are sent on pageload

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/solid/src/tanstackrouter.ts Fixed the condition in onBeforeNavigate callback to properly detect initial pageload by checking for absence of fromLocation before comparing location states
dev-packages/e2e-tests/test-applications/solid-tanstack-router/tests/routing-instrumentation.test.ts Added test case to verify pageload transactions include web vitals measurements (ttfb, lcp, fp, fcp)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this 🙏

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@logaretm
logaretm merged commit ad28c4d into develop Dec 17, 2025
47 checks passed
@logaretm
logaretm deleted the awad/js-1323-solid-core-web-vitals-arent-reported-with-tanstack-router branch December 17, 2025 13:35
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.

[Solid] Core Web Vitals aren't reported with Tanstack Router integration

4 participants