Skip to content

feat!: upgrade to Next.js 16 and replace webpack with Turbopack - #958

Draft
pdavies88 wants to merge 1 commit into
chore/dep-upgrade-2026-09from
chore/nextjs-16-upgrade
Draft

feat!: upgrade to Next.js 16 and replace webpack with Turbopack#958
pdavies88 wants to merge 1 commit into
chore/dep-upgrade-2026-09from
chore/nextjs-16-upgrade

Conversation

@pdavies88

Copy link
Copy Markdown
Contributor

Next.js 16 builds with Turbopack by default and hard-fails when a webpack config is present, so the config-injection mechanism has been rewritten.

  • remove the webpack ModifySourcePlugin and inject the headstartwp config through a Turbopack loader rule emitted by withHeadstartWPConfig
  • add injectHeadstartWPConfigLoader, a dependency-free loader that inserts the bootstrap after the directive prologue so 'use client'/'use server' is preserved, and imports the config by a path relative to the module (Turbopack resolves a leading / against the project root)
  • split client/server config via Turbopack's built-in browser condition
  • drop the linaria/wyw-in-js integration and the schema-utils, loader-utils and copy-webpack-plugin dependencies
  • always emit images.remotePatterns; drop the Next < 14 domains fallback
  • rename middleware.* to proxy.* across the example projects
  • remove the eslint next config option (removed in Next.js 16)
  • replace @next/bundle-analyzer with next experimental-analyze

React stays on 18.3.1 so the Pages Router remains supported.

Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF

Description of the Change

Closes #

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability
Developer - Non-functional update

Credits

Props @username, ...

Checklist:

Next.js 16 builds with Turbopack by default and hard-fails when a webpack
config is present, so the config-injection mechanism has been rewritten.

- remove the webpack ModifySourcePlugin and inject the headstartwp config
  through a Turbopack loader rule emitted by withHeadstartWPConfig
- add injectHeadstartWPConfigLoader, a dependency-free loader that inserts
  the bootstrap after the directive prologue so 'use client'/'use server'
  is preserved, and imports the config by a path relative to the module
  (Turbopack resolves a leading / against the project root)
- split client/server config via Turbopack's built-in `browser` condition
- drop the linaria/wyw-in-js integration and the schema-utils,
  loader-utils and copy-webpack-plugin dependencies
- always emit images.remotePatterns; drop the Next < 14 domains fallback
- rename middleware.* to proxy.* across the example projects
- remove the `eslint` next config option (removed in Next.js 16)
- replace @next/bundle-analyzer with `next experimental-analyze`

React stays on 18.3.1 so the Pages Router remains supported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF
@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 033ea24

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@headstartwp/next Major
@10up/next-redis-cache-provider Major
@headstartwp/block-primitives Major

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

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
headstartwp-app-router Error Error Sep 5, 2026 4:25am UTC
headstarwp Error Error Sep 5, 2026 4:25am UTC

Request Review

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