Skip to content
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: Added react-router v7 support #785

Merged
merged 14 commits into from
Dec 10, 2024
Merged

feat: Added react-router v7 support #785

merged 14 commits into from
Dec 10, 2024

Conversation

teukuamru
Copy link
Contributor

@teukuamru teukuamru commented Nov 28, 2024

Added support for react-router v7.

Closes #782.

Copy link

vercel bot commented Nov 28, 2024

@teukuamru is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@franky47 franky47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Maybe we could add a comment in the adapters/react-router adapter mentioning it's for v6.

Also an update of the docs would be welcome, to point folks to the right adapter (using Callouts in the Remix section).

packages/nuqs/adapters/react-router/v6.d.ts Outdated Show resolved Hide resolved
Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 9:22am

@franky47 franky47 added this to the 🪵 Backlog milestone Nov 28, 2024
@franky47 franky47 added the deploy:preview Deploy a preview version of this PR on pkg.pr.new label Nov 28, 2024
@rickyzhangca
Copy link

can't wait!

@fobos531
Copy link

fobos531 commented Dec 5, 2024

@franky47 Is there anything blocking this?

@teukuamru I see that the lint action failed - seems pretty easy to fix, the peerDependencies just need to be sorted

@franky47
Copy link
Member

franky47 commented Dec 5, 2024

I need to find some free time to try out RRv7, I had an unpushed branch with Remix improvements that could also be factored in this.

@teukuamru
Copy link
Contributor Author

I need to find some free time to try out RRv7, I had an unpushed branch with Remix improvements that could also be factored in this.

so, should I fix the lint or just wait for you to try out RRv7?

@franky47
Copy link
Member

franky47 commented Dec 8, 2024

I'll do it, I'm also going to add e2e tests for Remix, RRv6 & RRv7.

Copy link

pkg-pr-new bot commented Dec 8, 2024

Open in Stackblitz

npm i https://pkg.pr.new/nuqs@785

commit: d000ca8

@franky47 franky47 merged commit 650bd65 into 47ng:next Dec 10, 2024
28 checks passed
@franky47
Copy link
Member

franky47 commented Dec 10, 2024

Merged but I want to add some more tests in a separate PR before shipping it to GA.

In the mean time, y'all can use the preview deployment (feedback welcome!):

pnpm add https://pkg.pr.new/nuqs@785

And import the adapter as such:

// app/root.tsx
import { NuqsAdapter } from 'nuqs/adapters/react-router/v7'

// ...

export default function App() {
  return (
    <NuqsAdapter>
      <Outlet />
    </NuqsAdapter>
  )
}

@faradaytrs
Copy link

Merged but I want to add some more tests in a separate PR before shipping it to GA.

In the mean time, y'all can use the preview deployment (feedback welcome!):

pnpm add https://pkg.pr.new/nuqs@785

And import the adapter as such:

// app/root.tsx
import { NuqsAdapter } from 'nuqs/adapters/react-router/v7'

// ...

export default function App() {
  return (
    <NuqsAdapter>
      <Outlet />
    </NuqsAdapter>
  )
}

404 not found

@franky47
Copy link
Member

@faradaytrs Try that URL: https://pkg.pr.new/nuqs@d000ca8db65a027e11960c4b99736017c2a5ddaa

I'll check with the pkg.pr.new folks what went wrong with the PR-numbered release, thanks for the heads-up.

@faradaytrs
Copy link

@faradaytrs Try that URL: https://pkg.pr.new/nuqs@d000ca8db65a027e11960c4b99736017c2a5ddaa

I'll check with the pkg.pr.new folks what went wrong with the PR-numbered release, thanks for the heads-up.

i upgraded and it works fine, no problems detected

Copy link

🎉 This PR is included in version 2.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ZipBrandon
Copy link

I'm using 2.3.0-beta.2 on a new RR7 app. I incorporated the adapter with import { NuqsAdapter } from 'nuqs/adapters/react-router/v7', but when I use useQueryState() I get Error: useNavigate() may be used only in the context of a <Router> component.. I have the Adapter surrounding the outlet in the App.

export default function App() {
	return (
		<NuqsAdapter>
			<Outlet />
		</NuqsAdapter>
	);
}```

@franky47
Copy link
Member

@ZipBrandon thanks for the feedback and testing the beta!

Could you open a dedicated issue with a repro link so I can take a look please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy:preview Deploy a preview version of this PR on pkg.pr.new released on @beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for React Router 7
6 participants