Upgrade Next.js and add page smoke tests

Merged
WI
3mo ago
+558-322

Summary

  • upgrade Next.js to stable 16.2.10, React/React DOM to 19.2.7, and the OpenNext Cloudflare adapter to 1.20.1
  • remove the deprecated PostHog middleware convention that produced the Next.js warning and could not migrate to Node-only Proxy on OpenNext Cloudflare
  • add a self-discovering Playwright production smoke suite covering every registered static page, agent, blog post, current/legacy docs page, product docs page, redirect alias, and invite-page shape

Why

Next.js 16 deprecates middleware.ts in favor of Node.js proxy.ts, while the current OpenNext Cloudflare adapter rejects Node.js Proxy. The existing PostHog client already sends analytics through its configured ingest host, so removing the unused middleware path resolves the warning without breaking the deploy target.

The page suite provides upgrade protection by asserting successful HTTP responses, visible meaningful content, document titles, absence of application-error output, and clean browser hydration across the generated route inventory.

Validation

  • npm test — 82 tests passed
  • npm run build — passed on Next.js 16.2.10
  • npm --workspace web run cf:build — OpenNext Cloudflare bundle completed
  • npm --workspace web run test:e2e — 271 Chromium page checks passed

Summary by cubic

Upgraded next to 16.2.10 and react/react-dom to 19.2.7, added a Playwright page smoke suite, and removed the deprecated PostHog middleware.ts to resolve Next 16 warnings and Cloudflare incompatibility.

  • New Features

    • Added self-discovering Playwright smoke tests for static pages, agents, blog posts, current/legacy/product docs (including versioned paths), redirect aliases, and invite pages.
    • Each page is checked for a successful response, visible meaningful content, a non-empty title, no “Application error”, and now explicitly waits for load and initial hydration before assertions to catch uncaught errors.
    • Config builds and starts the app on port 3100, runs Chromium tests, and in CI enables retries and the GitHub reporter. Run with: npm --workspace web run test:e2e.
    • Updated next-env.d.ts to the new Next 16 route types path to remove the dev-only reference.
  • Dependencies

    • Upgraded next to 16.2.10.
    • Upgraded react and react-dom to 19.2.7.
    • Upgraded @opennextjs/cloudflare to 1.20.1 and added @playwright/test (dev).