Skip to content

feat: support Next.js 13.4+ and React 18.2+ - #45

Merged
uiwwsw merged 1 commit into
mainfrom
feat/wider-peer-range
Nov 27, 2026
Merged

uiwwsw merged 1 commit into
mainfrom
feat/wider-peer-range

Conversation

@uiwwsw

@uiwwsw uiwwsw commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Widens the peer range from Next.js 16.4.6+/React 19.3.1+ to Next.js 13.4+ (App Router) and React 18.2+.

  • StackLink handles the click itself instead of Link's onNavigate, which only exists from Next.js 15.3. Modified, middle, new-tab and download clicks still go to the browser, and onNavigate cancellation still works.
  • StackLink and StackMotion use forwardRef so refs work on React 18.
  • inert is rendered as a boolean on React 19 and as an empty string on React 18.
  • withStackflow adds cacheComponents only on Next.js 16+ and partialPrefetching only on 16.3+.
  • Top-level types/typesVersions let Next 13.4's forced moduleResolution: node find the declarations.

Checked: 67 unit tests pass. A test app that uses every export was packed and built against Next 13.4.0, 13.5.11, 14.2.35, 15.1.0, 15.5.29, 16.0.0 and 16.4.6 with matching React 18.2–19.3. In the browser, on 13.4, 13.5, 14.2, 15.1 and 16.4, the link slide and back slide ran, there was no full reload, onNavigate cancel stayed put, refs and inert worked, useStackState survived Back, and the console had no errors.

No release in this PR; it goes out with the Monday batch.

🤖 Generated with Claude Code

StackLink handles the click itself instead of Link's onNavigate (Next.js
15.3+), StackLink and StackMotion forward refs on React 18, inert renders
in the form each React version accepts, and withStackflow only adds the
Cache Components and Partial Prefetching keys on Next.js versions that
know them. Top-level types and typesVersions let older TypeScript module
resolution find the declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uiwwsw
uiwwsw merged commit 5e26513 into main Nov 27, 2026
1 check passed
@uiwwsw
uiwwsw deleted the feat/wider-peer-range branch November 27, 2026 01:46
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.

1 participant