Skip to content

Release/2.0.0 - Upgrade to Next 16 - #958

Draft
pdavies88 wants to merge 20 commits into
developfrom
chore/nextjs-16-upgrade
Draft

pdavies88 wants to merge 20 commits into
developfrom
chore/nextjs-16-upgrade

Conversation

@pdavies88

@pdavies88 pdavies88 commented Sep 5, 2026 •

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.

Release order

  1. Release 1.x: chore/dep-upgrade-2026-09 → develop (prerelease @next) → trunk → merge the Version Packages PR.
    • core 1.7.0, next 1.6.0, block-primitives 1.0.0, plugin 1.4.0, plus patch bumps for packages that depend on core
  2. Cut release/1.x from trunk at that commit, and push it.
  3. Merge trunk into chore/nextjs-16-upgrade. This removes the changesets 1.x already used. If you skip it, the 2.0 changelog will say linaria is both "deprecated" and "removed", and core would try to release 1.7.0 a second time.
  4. Release 2.x by the same route.
    • next 2.0.0, block-primitives 2.0.0, next-redis-cache-provider 3.0.0

One rule for release/1.x: only release the three packages that got a new major version in 2.x from it (next, block-primitives and next-redis-cache-provider). core, epio-search and the plugin share one version line across both branches, so a core patch cut from release/1.x would clash with version numbers that trunk publishes.

Before either release

  • Both branches need green CI. The bundle-analysis and PHPUnit fixes haven't been confirmed by a real run yet.
  • Keep the earlier checklist: update the branch protection check names, and tell the team about wp-env destroy and the Node 24 floor for local dev.

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:

github-actions Bot and others added 6 commits April 8, 2026 18:08
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Visual/config alignment with the new main site:
- Title/url -> headstartwp.fueled.com; GA4 (production-only) replaces GTM
- Navbar 'About HeadstartWP' CTA; hero lavender wash + lattice treatment
- Footer: 3 nav columns + Fueled bottom band mirroring the main site
- IBM Plex Sans / Plex Sans Condensed typography, new primary ramp

Brand reference pass:
- Org-standard Fueled CTA banner (per 10up/classifai) in root+package READMEs
- Root README docs links -> headstartwp.fueled.com
- philosophy.md says HeadstartWP (pre-rename prose); Fueled credited once
- Pages-router quick-tutorial: 'At Fueled (formerly 10up), ...'
- Unchanged by design: github.com/10up URLs, js1.10up.com demo backend,
  @10up/next-redis-cache-provider package name, __10up__HEADLESS_CONFIG

Naming: guide section 'Documentation' -> 'Developer Guide' (navbar,
footer, home grid); /learn route unchanged.
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: e0b8ffd

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 Ready Ready Preview Sep 23, 2026 7:05pm UTC
headstarwp Ready Ready Preview Sep 23, 2026 7:05pm UTC

Request Review

pdavies88 and others added 3 commits September 18, 2026 15:04
The lockfile still carried @next/bundle-analyzer and its tree for the three
projects it was removed from, so npm install in CI would rewrite it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF
Two pre-existing CI problems, both unrelated to the Next.js 16 migration.

The repo requires npm >= 11.6.0 via engines.npm and devEngines with
onFail: error, but Node 22 ships npm 10.x and always will, so every Node 22
job aborted at install with EBADDEVENGINES. engines.node advertised support
for ^20.19.0 || ^22.18.0 which could never satisfy that npm floor. Node 24
is what .nvmrc pins and the only version the lint workflow ran, so drop the
lower versions from engines and from the build-test and unit-test matrices.

The bundle analysis workflows downloaded the base branch's bundle stats with
if_no_artifact_found: fail. Baselines are only produced by pushes to develop,
so any PR stacked on a feature branch had no baseline and the job failed even
though the build and the report both succeeded. Make that download
non-fatal and skip the compare and comment steps when no baseline exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF
PHPUnit failed at install for the same reason the Node 22 jobs did: it runs
npm install with no setup-node step, so it used the runner's system npm,
which is below the npm >= 11.6.0 floor that devEngines enforces with
onFail: error. PHPCS is the same workflow without an npm install step and it
passed. Pin Node 24 there so npm 11 is used.

The app-router bundle analysis workflow reported
{"/_app":{"raw":0,"gzip":0},"__global":{"raw":0,"gzip":0}} because
nextjs-bundle-analysis reads buildMeta.pages['/_app'], which only exists in a
pages-router build manifest. It has never measured anything on that project,
so remove it rather than let it report zeros.

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

The previous attempt guarded the compare and comment steps on the download
step's outcome, but if_no_artifact_found: warn makes that step exit 0, so its
outcome is always 'success'. The guard never fired and the compare step still
ran, failing on `ls` against a directory that was never created.

Check whether the baseline directory actually has contents instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF
pdavies88 and others added 5 commits September 18, 2026 16:35
…nsumers

The theme was a private, unpublished dev fixture that nothing depended on,
but it declared 19 @wordpress/* packages at exact versions while importing
only three (i18n, blocks, block-editor). Those 16 unused pins dictated
dependency resolution for the entire monorepo: @wordpress/editor@14.40.2
pulled core-data@7.40.2 -> block-editor@15.13.2 -> dataviews@12.0.1, whose
private-API opt-in is rejected by @wordpress/private-apis >= 1.54.0. That is
what broke @headstartwp/block-primitives' test suite.

WordPress packages now live only where they are imported. block-primitives
already declares exactly the four it uses (block-editor, components, data,
blob) and resolves them on the current generation, where dataviews no longer
depends on private-apis at all.

- remove wp/10up-theme and its dev:primitives turbo filter
- drop the now-unnecessary @wordpress/private-apis override
- repoint the staged phpcs hook at wp/headless-wp, which is where
  10up/phpcs-composer actually lives; the theme had no phpcs at all
- stop mounting the theme in wp/headless-wp/.wp-env.json
- declare @types/react, @types/react-dom and @types/jest at the root so the
  root tsconfig's typeRoots and Next's own type resolution do not depend on
  npm hoisting happening to place them there

Lockfile drops from 1975 to 1482 packages; @WordPress entries from 452 to 76.
React stays on 18.3.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMatBaQUrPS9AhSJmkF2vF
@pdavies88
pdavies88 changed the base branch from chore/dep-upgrade-2026-09 to develop September 23, 2026 19:11
@pdavies88 pdavies88 changed the title feat!: upgrade to Next.js 16 and replace webpack with Turbopack Release/2.0.0 Sep 23, 2026
@pdavies88 pdavies88 changed the title Release/2.0.0 Release/2.0.0 - Upgrade to Next 16 Sep 25, 2026

This branch was successfully deployed

2 active deployments
Preview – headstarwp — e0b8ffd2 Deployed Sep 23, 2026 by vercel[bot]
Preview – headstartwp-app-router — e0b8ffd2 Deployed Sep 23, 2026 by vercel[bot]
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.

3 participants