Repository navigation
vue-qs 0.2: nuqs for Vue π #32
iamsomraj
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone π
vue-qs 0.2 is out! It's a rewrite that makes vue-qs a port of nuqs, the popular type-safe search params library for React, built for Vue's way of doing things.
Why the rewrite?
Filters, search terms, tabs and pagination belong in the URL: users can share them, bookmark them and restore them with the Back button. vue-qs 0.1 worked, but it had its own API and missed some important behaviour (for example, state didn't follow
router.push). nuqs has already solved these problems well in React, so 0.2 follows its parsers, options and behaviour, and keeps the Vue feel.Highlights
useQueryStatereturns a ref you can assign or bind withv-model, with.set()for options and promisesuseQueryStatesbinds several keys at once, with$setand shorturlKeysparseAsJsonvalidated with Zod / Valibot / ArkType (Standard Schema), pluscreateParserfor your owncreateLoaderandcreateSerializerreuse your parsers in Nuxt server routes and for type-safe linksSince 0.2.0:
Upgrading from 0.1
queryRef/queryReactiveand the codecs are replaced byuseQueryState/useQueryStatesand parsers. The migration guide has a name-by-name mapping.I'd love your feedback π
vue-qs is my way of giving back to the Vue community, and your input decides what comes next:
Which feature would you like next? Reply below!
Big thanks to FranΓ§ois Best and the nuqs contributors, whose work this port builds on.
π Docs Β· π¦ npm Β· π Release notes
All reactions