Uh oh!
There was an error while loading. Please reload this page.
fix(router-core): fix dangling references in published declarations - #8207
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
View your CI Pipeline Execution ↗ for commit 86dd9b4
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview6 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change marks the SSR dehydrated match context field as internal, preserves the ChangesRouter core declarations
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to This update removes the internal dehydrated context field from published declarations while retaining runtime serialization behavior and the exported URL helper. It adds ESM and CommonJS declaration-consumer coverage, with no remaining merge-readiness risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:88621b3cd8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
This reverts commit 2bc6b55.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will regress 7 benchmarks
|
| Mode | Benchmark | BASE | HEAD | Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server serialization-payload (react) | 4.1 MB | 6 MB | -31.65% |
| ❌ | Memory | mem client mount-unmount (solid) | 484.5 KB | 590.6 KB | -17.97% |
| ❌ | Memory | mem client navigation-churn (solid) | 614.9 KB | 698.3 KB | -11.95% |
| ❌ | Memory | mem server request-churn (react) | 697.6 KB | 739.5 KB | -5.66% |
| ❌ | Memory | mem server aborted-requests (react) | 889.8 KB | 941.6 KB | -5.5% |
| ❌ | Memory | mem server server-fn-churn (solid) | 336.5 KB | 355.4 KB | -5.3% |
| ❌ | Memory | mem client preload-churn (vue) | 764.7 KB | 793.8 KB | -3.66% |
| ⚡ | Memory | mem client unique-location-churn (solid) | 791.3 KB | 407.1 KB | +94.38% |
| ⚡ | Memory | mem server error-paths not-found (solid) | 975 KB | 593 KB | +64.43% |
| ⚡ | Memory | mem server error-paths not-found (vue) | 544.4 KB | 483.6 KB | +12.57% |
| ⚡ | Memory | mem server peak-large-page (vue) | 1.1 MB | 1 MB | +5.41% |
| ⚡ | Memory | mem server error-paths redirect (react) | 312.3 KB | 296.7 KB | +5.29% |
| ⚡ | Memory | mem client interrupted-navigations (vue) | 376.5 KB | 358.8 KB | +4.93% |
| ⚡ | Memory | mem server error-paths redirect (vue) | 406 KB | 390 KB | +4.09% |
| ⚡ | Memory | mem server serialization-payload (vue) | 4.6 MB | 4.5 MB | +3.52% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing chore/internal-ssr-window-globals (86dd9b4) with main (cf166d1)
Footnotes
54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We exclude tests/declarations/** from vitest's typecheck to fix the 6 TypeCheckError: Cannot find module '@TanStack/router-core' unhandled errors that caused test:unit to exit with code 1. The consumer.cts and consumer.mts fixtures are designed to be compiled by tsc6 -p tests/declarations/tsconfig.json (part of test:build) and rely on published package exports resolving to a built dist/ directory, a context that does not exist during test:unit.
Tip
✅ We verified this fix by re-running @tanstack/router-core:test:unit.
diff --git a/packages/router-core/vite.config.ts b/packages/router-core/vite.config.ts
index 97859dda..d1842574 100644
--- a/packages/router-core/vite.config.ts+++ b/packages/router-core/vite.config.ts@@ -19,7 +19,7 @@ const config = defineConfig({
dir: './tests',
watch: false,
environment: 'jsdom',
- typecheck: { enabled: true },+ typecheck: { enabled: true, exclude: ['**/declarations/**'] },
// Perf tests are gated by env var and excluded from default runs.
// To run: RUN_BACKPRESSURE_PERF=1 pnpm vitest run transformStreamBackpressure
exclude:
Or Apply changes locally with:
npx nx-cloud apply-locally vOWk-TKG9
Apply fix locally with your editor ↗View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Uh oh!
There was an error while loading. Please reload this page.
🎯 Changes
Fixes#8203.
Consumers using
skipLibCheck: falsefail to typecheck because the publishedDehydratedMatch.bdeclaration referencesMakeRouteMatch['__beforeLoadContext'], which is stripped bystripInternal. Markbas internal too, so declaration generation omits the dangling reference. The field remains available to the router's serialization and hydration code.Keep the declaration of
isAbsoluteUrl, which is exported from router-core and imported by the framework bindings. Stripping it leaves another dangling reference in the package entry point. Update the React hydration fixture to explicitly include the internal context field in its serialized match type. These changes do not alter runtime behavior.Include a router-core patch changeset.
Validation:
pnpm test:eslint,pnpm test:types, andpnpm test:unit.test:build, including publint and Are the Types Wrong.skipLibCheck: falseon TypeScript 6 and 7.cf166d1): 90 of 92 files are byte-identical, and the remaining two differ only by the removed@internalcomment.✅ Checklist
🚀 Release Impact