Maintaining an open-source library for Next.js, feedback and tips
summary
Maintains the nuqs library to sync React state into the URL across Next.js pages router and app router, implementing a useQueryState hook that serializes via customizable parsers, enforces TypeScript literal types, and throttles browser updates with a queue to respect the history API rate limit (about 50 milliseconds). Uses the history API pushState/replaceState, CI that triggers tests on Next.js canaries (1–5 canaries/day), and verifies behavior with Cypress end-to-end tests and Turborepo caching; it works in production.
AI-written summary · about
chapters (21)
- 0:00Introduction to the talk
- 1:51From native code to web technologies
- 3:15Power of URLs in web apps
- 5:47Next.js routers explained
- 7:11Query string customization demo
- 8:15Deep linking with state in URL
- 10:02Introducing next-usequerystate
- 12:10Live demo of state sync
- 13:15Evolution of next-usequerystate
- 14:00Server components challenge
- 15:24Shallow routing limitations
- 16:49Browser API rate limits
- 17:32Throttling implementation
- 19:17Parsing URL state safely
- 21:24Reacting to URL changes
- 22:30Patching browser history
- 24:56Synchronizing state and URL
- 25:19Testing with Next.js Canary
- 26:43Importance of behavior coverage
- 28:11End-to-end testing with Cypress
- 28:52Future of next-usequerystate
