fix(start): import Register from @tanstack/router-core in default server entry - #8194
fix(start): import Register from @tanstack/router-core in default server entry#8194rajat12826 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughReact Start, Solid Start, and Vue Start now use ChangesStart server-entry integration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change updates the server-entry type import and declares the owning package directly across the React, Solid, and Vue integrations; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description clearly explains the motivation, affected packages, dependency changes, Vite externalization, and expected result. It does not reproduce the template's Checklist and Release Impact headings, but it is otherwise mostly complete and directly relevant. Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation 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 6 files. (3 skipped: 3 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. Comment |
Fixes #8186
Summary
TypeScript 7's "owning-package" rule requires module augmentations to target
the package that owns the interface declaration. The
Registerinterfaceis declared in
@tanstack/router-core, but the default server entry files inreact-start,solid-start, andvue-startwere importing it from theframework-specific re-exports (
@tanstack/react-router, etc.).This forced users to write duplicate
declare moduleaugmentations for both@tanstack/router-coreand the framework router just to getserver.requestContexttypes working.Changes
For each of
react-start,solid-start, andvue-start:src/default-entry/server.ts: ImportRegisterfrom@tanstack/router-coreinstead of the framework router re-export.package.json: Add@tanstack/router-coreas a direct dependency(required for module resolution in the server-entry build).
vite.config.server-entry.ts: Add@tanstack/router-coretoexternalDepsso it is not bundled into the server-entry output.Result
Users can now augment
Registeronly in@tanstack/router-coreand have itwork everywhere, including the generated server entry , no duplicate
augmentation needed. Fully backward compatible with existing dual augmentations.
In summary:
Import Register from @tanstack/router-core in default server entry to fix TypeScript 7 owning-package augmentation resolution
Summary by CodeRabbit