Skip to content

Next.js: Raise the supported floor to 15 - #36201

Merged
valentinpalkovic merged 10 commits into
nextfrom
reland/pr-36167-next-15-floor
Sep 7, 2026
Merged

valentinpalkovic merged 10 commits into
nextfrom
reland/pr-36167-next-15-floor

Conversation

@obvious-autobuild

Copy link
Copy Markdown
Contributor

Why

Storybook 11 is raising the supported framework floors. For Next.js the supported floor moves from 14.1 to 15: the Next 14 cohort can stay on Storybook 10 or follow the migration guide, and the compatibility code that existed only for Next 14 is real dead weight in @storybook/nextjs — a package that is itself deprecated in favor of @storybook/nextjs-vite (removal announced for Storybook 12).

What

One floor, four layers, one commit per layer:

  • Peers — next peer range raised to ^15.0.0 || ^16.0.0 in @storybook/nextjs, @storybook/nextjs-vite, and @storybook/vite-plugin-storybook-nextjs.
  • Upgrade-time block — the next entry in the autoblock map moves 14.1.0 → 15.0.0. The blocker message links the new MIGRATION.md anchor (#nextjs-require-v15-and-up) instead of the stale Next.js 13 upgrade guide. --force still bypasses, per the existing autoblock contract. A new unit test covers the contract: next 14 → blocked with message + anchor; next 15/16 → pass.
  • Dead code — with the floor at 15:
    • src/compatibility/ (compatibility-map + draft-mode.compat) is deleted. Its only entry was the '<15.0.0' alias table, and the ./compatibility/draft-mode.compat export goes with it (package.json exports + build config). The compat-alias spread in export-mocks and the compat-path warning filter in aliases/webpack.ts — both added by "Nextjs: Add support for Next 15" for the Next 14 shim — are removed too.
    • The always-true isNext14orNewer term in preset.ts is dropped: the supported floor is 15. Compiler selection is otherwise unchanged from next for every supported version — useSWC = forceSwcTransforms || !hasBabelConfig — so the Babel compiler path, the babel preset property, and the whole src/babel/ tree stay intact (a project shipping .babelrc/babel.config.js without forcing SWC transforms still compiles through Babel).
    • The always-true >=13.0.0 legacy-image check collapses into an unconditional alias assignment.
  • Docs — "Next.js: Require v15 and up" subsection added to the existing "From version 10.x to 11.0.0" section in MIGRATION.md (alongside the Vitest 4 and Vite floor entries), with a matching table-of-contents entry — landing in the same PR as the code that links the anchor.

How to Review

  • The behavioral core is preset.ts: webpackFinal keeps next's compiler selection for all supported versions — only the always-true isNext14orNewer term was dropped. The Babel compiler path and babel preset property are restored unchanged after review feedback. The only remaining version check in the framework is the pre-existing isNext16orNewer check in previewAnnotations — a Next 16 concern, out of scope.
  • font/babel/ (the TransformFontImports babel plugin) and the babel-loader dependency are consumed again by the restored Babel path — unchanged from next. The vendored <15.0.0 copy under vite-plugin-storybook-nextjs's next-mocks stays untouched (self-contained, separate surface).
  • react / react-dom / @types/react peer ranges are intentionally untouched — that sweep belongs to the React floor PR.
  • No sandbox template changes: the nextjs 15/prerelease templates stay per the spec (D8).

Test Evidence

  • yarn test autoblock — 4 files, 31 tests pass, including the new block-dependencies-versions.test.ts (next 14 → blocked with message + anchor; 15/16 → pass).
  • yarn test code/frameworks/nextjs — 2 files, 14 tests pass after the deletions.
  • scripts/build-package nextjs — build succeeds; fresh dist/ bundles the Babel compiler path again and has zero references to draft-mode.compat or the deleted compatibility/ tree.
  • Per-package typecheck (scripts/check/check-package.ts) — clean for code/frameworks/nextjs and code/lib/cli-storybook.
  • oxlint clean on all changed files.

Manual testing

Automated coverage carries this change; no manual steps are strictly required:

  • yarn test autoblock — new unit test covers the Next.js 15 blocker (next 14 → blocked with the migration link; next 15/16 → pass; --force bypasses).
  • yarn test code/frameworks/nextjs — framework unit tests pass after the compatibility deletions.
  • scripts/build-package nextjs — package build succeeds with the restored Babel path bundled and zero references to the deleted draft-mode.compat tree.
  • Optional smoke test: generate a sandbox against a Next.js 15 app and verify stories boot through the config-driven compiler selection — SWC by default, and Babel for a project that ships a .babelrc.

QA

Visual evidence not applicable — no rendered UI, visual state, or interactive workflow changes.

🔗 Obvious Project · 🧵 Obvious Thread

ObviousApp and others added 10 commits September 5, 2026 08:16
Next.js 14 is no longer supported; the supported floor is now Next.js 15.
Applies to @storybook/nextjs, @storybook/nextjs-vite, and
@storybook/vite-plugin-storybook-nextjs.
Raises the upgrade-time autoblock floor for next from 14.1.0 to 15.0.0.
The blocker message links the new MIGRATION.md anchor instead of the
outdated Next.js 13 upgrade guide. --force still bypasses, per the
existing autoblock contract.
- Delete src/compatibility/ (compatibility-map and draft-mode.compat):
  the '<15.0.0' alias mapping and its draft-mode shim only applied to
  Next.js 14, which is no longer supported. The './compatibility/
  draft-mode.compat' export is removed from the package exports and
  build config.
- Make the SWC compiler path unconditional in preset.ts: the
  isNext14orNewer version gate kept the babel/ tree (loader, preset,
  plugins) alive for Next.js 14 projects with a babel config; with the
  floor at 15 the babel compiler branch and the babel/ directory go.
- Simplify the legacy-image alias setup: the '>=13.0.0' version check
  was always true at a Next.js 15 floor, so the next/legacy/image
  aliases are now applied unconditionally.
- Drop the compat-path warning filter from the webpack alias setup;
  it only suppressed warnings produced by the deleted '<15' aliases.
Adds a 'Next.js: Require v15 and up' entry under a new 'From version
10.6.x to 11.0.0' section. The anchor is linked from the upgrade-time
blocker message.
Fixes the ci/circleci format-check failure: 8 files in the Next.js
floor diff were not prettier-clean.
The peer-range bump changes the workspaces' embedded peerDescriptors, so
yarn install --immutable (CI) failed with YN0028 before any check ran.
@obvious-autobuild
obvious-autobuild Bot marked this pull request as ready for review September 5, 2026 08:17
@obvious-autobuild obvious-autobuild Bot added maintenance User-facing maintenance tasks ci:normal Run our default set of CI jobs (choose this for most PRs). qa:skip Pull Requests that do not need any QA. (e.g. documentation) labels Sep 5, 2026
@valentinpalkovic
valentinpalkovic merged commit db52810 into next Sep 7, 2026
161 of 167 checks passed
@valentinpalkovic
valentinpalkovic deleted the reland/pr-36167-next-15-floor branch September 7, 2026 07:41
@github-actions github-actions Bot mentioned this pull request Sep 7, 2026
2 tasks done
obvious-autobuild Bot pushed a commit that referenced this pull request Sep 7, 2026
Resolves the conflict with PR #36201 (Next.js 15 floor reland): the
dependenciesVersions blocker now carries both the unconditional next 15.0.0
floor (with its 'Next.js 15 support removed' log case) and the conditional
addon-vitest Vitest 4 floor. The test file unions the reland's Next.js cases
with the ported Vitest cases, adopting the reland's real-semver helpers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). maintenance User-facing maintenance tasks qa:skip Pull Requests that do not need any QA. (e.g. documentation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants