refactor: migrate query params from use-query-params to nuqs v2#2187
refactor: migrate query params from use-query-params to nuqs v2#2187brandon-pereira wants to merge 6 commits intomainfrom
Conversation
Replaces `use-query-params` (and `next-query-params`,
`serialize-query-params`) with nuqs v2 across the app, dropping
`useQueryParam.tsx` in favour of nuqs's hooks. Also:
- Removes the redundant manual `reset()` sync effect on DBSearchPage —
RHF's built-in `values`-prop reconciliation already deep-compares and
honors `resetOptions: { keepDirtyValues: true }`, so the user's
in-flight source pick is no longer clobbered by the stale URL value
(the cause of the source dropdown flicker).
- Drops the `tempLiveTailTimeRange` workaround in `useTimeQuery`. The
hack existed because nuqs v1 / use-query-params updated state
asynchronously; nuqs v2 updates local state synchronously, so the
bridge state is dead weight.
- Un-skips `timeQuery.test.tsx` and migrates it to nuqs's official
`NuqsTestingAdapter`. Drops the `tq`-based and browser-nav cases
(only applied to the legacy `useTimeQuery`) and adds direct
`onSearch` / `onTimeRangeSelect` setter coverage.
- Removes the now-unused `@jedmao/location` devDep and `fixtures.ts`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 8e7fbbc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| @@ -932,24 +950,6 @@ export function DBSearchPage() { | |||
| updateInput: !isLive, | |||
| }); | |||
|
|
|||
There was a problem hiding this comment.
the below code is removed because it was causing extra re-renders and wasn't needed. browser back/forward navigation still works
E2E Test Results❌ 17 tests failed • 144 passed • 3 skipped • 1363s
Tests ran across 4 shards in parallel. |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
PR ReviewClean migration from Issues:
Minor:
✅ Zod schema validation added to |
Summary
Replaces the legacy
use-query-params(+next-query-params,serialize-query-params) stack with nuqs v2 across the app, drops the localuseQueryParam.tsxshim, and cleans up two workarounds that the migration made obsolete.What changed
Dependency migration
nuqsbumped1.17.0→^2.8.9.use-query-params,next-query-params,serialize-query-params, and the now-unused@jedmao/locationdevDep.timeQuery.ts,SessionsPage,*DetailsSidePanel,BenchmarkPage,DBChartPage,DBDashboardImportPage,_app.tsx, and the Storybookpreview.tsxto nuqs hooks/parsers.packages/app/src/useQueryParam.tsx(the wrapper around the old library) andpackages/app/src/fixtures.ts(test-onlyTestRouterbuilt onLocationMock).Test plan
make ci-lint✅make ci-unit✅ — 86 suites / 1525 tests pass (was 85 / 1518 + 9 skipped onmain)./searchno longer flickers when switching sources.