Skip to content

Releases: 47ng/nuqs

v1.8.4

15 Oct 09:46
Compare
Choose a tag to compare

1.8.4 (2023-10-15)

Bug Fixes

New Contributors

Full Changelog: v1.8.3...v1.8.4

v1.8.3

13 Oct 09:03
Compare
Choose a tag to compare

1.8.3 (2023-10-13)

Bug Fixes

  • Check array index access (73c120c)

v1.8.3-beta.1

13 Oct 08:44
Compare
Choose a tag to compare
v1.8.3-beta.1 Pre-release
Pre-release

1.8.3-beta.1 (2023-10-13)

Bug Fixes

  • Check array index access (73c120c)

v1.8.2

04 Oct 07:51
Compare
Choose a tag to compare

1.8.2 (2023-10-04)

Bug Fixes

  • Consider queued updates for initial state (e10c85c), closes #359. Thanks @jebie!
  • List types first in export map (af0729d)

v1.8.2-beta.1

04 Oct 07:31
Compare
Choose a tag to compare
v1.8.2-beta.1 Pre-release
Pre-release

1.8.2-beta.1 (2023-10-04)

Bug Fixes

  • Consider queued updates for initial state (e10c85c), closes #359
  • List types first in export map (af0729d)

v1.8.1

20 Sep 07:50
Compare
Choose a tag to compare

1.8.1 (2023-09-20)

Performance Improvements

  • Replace update queue with a Map (a1f84cf)

v1.8.1-beta.1

20 Sep 07:39
Compare
Choose a tag to compare
v1.8.1-beta.1 Pre-release
Pre-release

1.8.1-beta.1 (2023-09-20)

Performance Improvements

  • Replace update queue with a Map (a1f84cf)

v1.8.0

15 Sep 13:03
Compare
Choose a tag to compare

1.8.0 (2023-09-15)

Announcement blog post: https://francoisbest.com/posts/2023/storing-react-state-in-the-url-with-nextjs

This release brings support for the app router, and requires Next.js 13.4+.

It is a complete internal rewrite, that gives us:

  • Optimal performance (now identical to React.useState)
  • Shallow mode by default
  • Batched updates
  • SSR in Server Components with correct query values (no more hydration tricks or errors)
  • Better DX for creating and configuring parsers
  • Finer control over options

Refer to the documentation for more details.

Behavioural changes

Query updates are using the following defaults, that changed from the previous version:

  • scroll: false
  • shallow: true

Read the options documentation to configure those behaviours.

Features

  • Add hex parser (7d9e7b9)
  • Add parser argument for JSON types (a2e7c3d)
  • Add server-side parser utility (e225975), closes #348
  • Allow server-side parser access (29d4d86), closes #348
  • App router now uses history API (ba5e3e0)
  • Cache returned promise until next flush (aa0619b)
  • Name patched functions for better stack traces (5b7c494)
  • Single app/pages implementation (f4817f5)
  • Spy on all query changes (b9a24cc)
  • Update to useRouter from next/navigation (a604351), closes #327

Bug Fixes

Deprecations

The queryTypes parser bag is marked as deprecated, as it wasn't tree-shakeable. It is replaced by individual parsers.

- import { useQueryState, queryTypes } from 'next-usequerystate'
+ import { useQueryState, parseAsInteger } from 'next-usequerystate'

- useQueryState('counter', queryTypes.integer.withDefault(0))
+ useQueryState('counter', parseAsInteger.withDefault(0))

Some internal type definitions have been renamed for consistency across the codebase.
Since they were exported, the change is retro-compatible with deprecation notices on the old type names.

Those deprecated exports will be removed in the next major version (2.0.0).

Credits

A big thanks to all who have helped testing the beta versions, and especially:

  • @andreisocaciu for laying the ground work (#328).
  • @caillou for early performance testing.
  • @tacomanator for fishing out two race-conditions on initial navigation (#343).
  • @ryan-walsh-forte for uncovering a race condition in state updater functions (#345).
  • @r1chm8 for the idea of making the parsers server-side accessible to let server components hydrate and validate query values (#348).
  • @jdddog for uncovering issues with module resolution (#352).

Full Changelog: v1.7.3...v1.8.0

v1.8.0-beta.15

15 Sep 09:25
Compare
Choose a tag to compare
v1.8.0-beta.15 Pre-release
Pre-release

1.8.0-beta.15 (2023-09-15)

Bug Fixes

  • State updater function should be based on state (f788381)
  • useInsertionEffect for useQueryStates (8b8b2e9)

v1.8.0-beta.14

14 Sep 21:28
Compare
Choose a tag to compare
v1.8.0-beta.14 Pre-release
Pre-release

1.8.0-beta.14 (2023-09-14)

Bug Fixes

  • Reduce package size by hotlinking GIF (000aa62)