Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
75d6619 to
e588a0c
Compare
ab3e415 to
a1fd76a
Compare
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the TanStack Router adapter to avoid leaking destination search params into still-mounted source pages (repro #1293) and adds E2E coverage for TanStack Router, including a delayed-loader variant to ensure behavior is robust under slower navigations.
Changes:
- Update
useNuqsTanstackRouterAdapterto distinguish between stable and in-flight navigations usinguseRouterState, caching the last stable search per adapter instance and using it during cross-page transitions. - Add TanStack Router E2E routes for the 1293 repro (
/repro-1293/a|band delayed/repro-1293-late/a|b) using the sharedRepro1293pages. - Add Playwright specs wiring TanStack Router into the shared repro-1293 test harness, including a delayed-loader variant with router tagging and description.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/nuqs/src/adapters/tanstack-router.ts |
Extends the adapter to read resolvedLocation via useRouterState, cache the last stable search per adapter instance, and derive URLSearchParams from a new activeSearch that switches between live and cached search depending on whether the current path is in a stable (resolved) state. |
packages/e2e/tanstack-router/src/routes/repro-1293.a.tsx |
Declares TanStack Router route /repro-1293/a rendering Repro1293PageA with a link to /repro-1293/b, matching the shared repro-1293 behavior. |
packages/e2e/tanstack-router/src/routes/repro-1293.b.tsx |
Declares TanStack Router route /repro-1293/b rendering Repro1293PageB, which handles the back navigation portion of the repro. |
packages/e2e/tanstack-router/src/routes/repro-1293-late.a.tsx |
Adds a second route /repro-1293-late/a that reuses Repro1293PageA but targets the delayed-loader variant at /repro-1293-late/b. |
packages/e2e/tanstack-router/src/routes/repro-1293-late.b.tsx |
Adds /repro-1293-late/b with a simple async loader that waits before rendering Repro1293PageB, exercising the adapter under delayed navigation. |
packages/e2e/tanstack-router/specs/shared/repro-1293.spec.ts |
Wires TanStack Router into the shared testRepro1293 harness with path: '/repro-1293', mirroring the RR and Remix shared specs. |
packages/e2e/tanstack-router/specs/repro-1293-late.spec.ts |
Adds a dedicated Playwright spec for the delayed-loader variant, invoking testRepro1293 with path: '/repro-1293-late' plus router: 'tanstack-router' and a descriptive label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9bc5bcb to
c820ddf
Compare
c820ddf to
cfe7924
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the React Router fix in #1316 (and the added test for Next.js in #1317), it's TanStack Router's turn at #1293.
It did have an issue where the source page would re-render with destination URL state when navigating via a Link or the Back button.
Opus didn't manage to get to the end of its thoughts, but GPT-5.2-codex high found a way to switch between optimistic & resolved search based on whether or not we're in a navigation to another path (to avoid breaking the #1099 repro).