Skip to content

Conversation

@mktktmr
Copy link

@mktktmr mktktmr commented Oct 29, 2025

resolve #50

Thank you for developing such a tremendously useful library.

As for the subject at hand, I reviewed both the official blog post announcing the Next.js v16 release (https://nextjs.org/blog/next-16#breaking-changes-and-other-updates) and the presentation that explains how this library works (https://speakerdeck.com/ypresto/cancel-next-js-page-navigation-full-throttle). Based on that investigation, I confirmed that this library remains compatible with Next.js v16 (#51 (comment)).

Due to permission restrictions I wasn’t able to run the GitHub Actions workflow, but the local E2E suite passes successfully.

$ pnpm e2e

> [email protected] e2e /Users/mktktmr/src/next-navigation-guard
> playwright test


Running 78 tests using 4 workers
  78 passed (31.4s)

To open last HTML report run:

  pnpm exec playwright show-report

Any help with review, additional commits, or cutting a release would be greatly appreciated.

@mktktmr mktktmr force-pushed the 50_support_next_v16 branch from c37c0e9 to ff9c330 Compare October 29, 2025 11:05
@mktktmr
Copy link
Author

mktktmr commented Oct 29, 2025

Compatibility investigation with Next.js v16

Quick take

  • next-navigation-guard working on Next 16.
    Details reviewed
  • App Router interception (src/components/InterceptAppRouterProvider.tsx, src/hooks/useInterceptedAppRouter.ts) still works: AppRouterContext and the AppRouterInstance API in [email protected] remain unchanged.
  • Pages Router interception (src/components/InterceptPagesRouterProvider.tsx, src/hooks/useInterceptedPagesRouter.ts) stays compatible; RouterContext and NextRouter expose the same methods.
  • Link interception (src/hooks/useInterceptLinkClicks.ts) continues to be required. The Next 16 next/link implementation still drives navigation through the shared router context, so both the wrapped router and the DOM fallback behave as before.
  • History augmentation (src/hooks/useInterceptPopState.ts, src/utils/historyAugmentation.tsx) survives the release: HistoryState is still an object we can spread. Adding a null-guard would future-proof us in case Next ever emits null.

Release-note items to keep in mind

  • Runtime baseline jumps to Node 20.9 and TypeScript ≥5.1; update CI/example environments accordingly.
  • Sync variants of params, searchParams, cookies(), etc., are gone. We don’t call them in the library, but documentation/examples should use the async forms.
  • Turbopack becomes the default bundler. No direct impact here, but build tooling/log output will differ.
  • next lint command was removed. We already rely on external tooling, so no action needed.

@mktktmr mktktmr marked this pull request as ready for review October 29, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SUpport for next 16

1 participant