🎯 Changes#
DehydratedMatch['b'] is typed by RouteMatch['__beforeLoadContext'], and RouteMatch['__beforeLoadContext'] is tagged @internal. This worked fine until stripInternal was enabled in fd341ad(PR #4907), which strips @internal members from the published .d.ts. This has made this reference dangling since router-core@1.171.16. f330532 (PR #6118) later moved the interface to its current file unchanged. When 45c4ad8 (PR #7805) rewrote to load-client.ts and started importing from ./ssr/types, the dangling reference was surfaced for consumers with skipLibCheck: false in this error:
error TS2339: Property '__beforeLoadContext' does not exist on type 'MakeRouteMatch'.
We solve this by giving b the declared type of __beforeLoadContext, instead of indexing into the stripped member.
Verified against a built package: the emitted dist/esm/ssr/types.d.ts no longer references the internal member, and a minimal consumer repro type-checks cleanly with this dist swapped in.
Fixes #8203
✅ Checklist#
🚀 Release Impact#
Summary by CodeRabbit#
- Bug Fixes
- Fixed a published TypeScript declaration issue affecting dehydrated route data.
- Resolved compilation errors for consumers using stricter type-checking settings.
- Improved compatibility by using a stable, publicly available context type.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Team
Run ID:
166ba867-bbe6-400f-ba29-821296874e17📥 Commits
Reviewing files that changed from the base of the PR and between 37877da166fe4ce055c7b85e138b6681ebd7e8b4 and aa6c29ee4d1e17752327818900990dbf47bf36de.
📒 Files selected for processing (2)
.changeset/dehydrated-match-before-load-context-type.mdpackages/router-core/src/ssr/types.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
The PR changes
DehydratedMatch.btoRecord<string, unknown>and adds a patch changeset for@tanstack/router-core. This removes its reference to the internal route match context member.Changes#
Dehydrated match context typing
packages/router-core/src/ssr/types.ts,.changeset/dehydrated-match-before-load-context-type.mdDehydratedMatch.bnow usesRecord<string, unknown>instead of indexing intoMakeRouteMatch['__beforeLoadContext']. The changeset declares a patch release for@tanstack/router-core.Estimated code review effort: 2 (Simple) | ~5 minutes
Merge Risk: ⚪ Minimal · up to
aa6c2This patch fixes the published SSR type declaration without changing runtime behavior or serialized data. No actionable merge-blocking risk remains after normal checks and review.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share