-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for TanStack Router #953
base: next
Are you sure you want to change the base?
Conversation
@ahmedrowaihi is attempting to deploy a commit to the 47ng Team on Vercel. A member of the Team first needs to authorize it. |
the nuqs DX is unbeatable, let's make it work everywhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this! 🙌
I see the adapter is based on the next/app one, have you tried it in a TSR app? My main concern would be shallow routing support.
Also, you'll need to add the new entry points to the files list in package.json (otherwise they won't land on NPM).
Co-authored-by: François Best <[email protected]>
Yes, I am using it on my TSR app, it's doing the thing pretty good
updated |
oh wait, I just found a bug when shallow is true xD |
@franky47 I fixed it, I reused the TSR router to navigate and this is working now |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
No need for an impl file here, it made sense in Next.js for the agnostic adapter to import both app & pages router implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I took the liberty of flattening the TSR adapter code, the impl file was mostly needed for Next.js to have the agnostic adapter pull out implementations from both app & pages adapters.
Looks good for a start, since TSR is mostly for SPAs, I'll add an e2e test environment on this PR tomorrow to see how it behaves. Then there's the question of how to handle the shallow: false
option in TanStack Start for SSR, but we can deal with that later.
commit: |
The initial porting of the shared e2e test suite looks pretty good! This is likely to be only the tip of the iceberg though, the real value in a TSR adapter would be to connect nuqs search params definition objects (the ones you feed to |
- Use a scoped location subscribing only to search params updates - Use the useNavigate hook for navigation (don't need the whole router) - Handle native search params arrays (for later) - Add comments to keep track of why we made these choices
No description provided.