[PR #162] [CLOSED] feat: add nuqs e2e test suite integration #363

Closed
opened 2026-05-06 12:39:26 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/162
Author: @southpolesteve
Created: 2/27/2026
Status: Closed

Base: mainHead: feat/nuqs-e2e-tests


📝 Commits (10+)

  • a51ec8c Merge pull request #23 from southpolesteve/app-router-prod-server
  • cf18ba8 test: add E2E tests for router.events, next/dynamic ssr:false, Link advanced props, beforePopState
  • 162ef9d fix: add scroll={false} assertion — intercept scrollTo to verify no scroll-to-top
  • ae1e122 Merge pull request #29 from southpolesteve/e2e-router-dynamic-link
  • 8bb09bf test: add E2E tests for Pages Router production build
  • c97a9f0 Merge pull request #28 from southpolesteve/e2e-prod-tests
  • 81f84ba test: add Cloudflare Workers E2E tests
  • c2edf4c Merge pull request #30 from southpolesteve/cloudflare-e2e
  • e22a065 feat: add middleware support to Pages Router production server
  • 9ddb1f8 Merge pull request #25 from southpolesteve/prod-server-middleware

📊 Changes

3 files changed (+17 additions, -74 deletions)

View changed files

📝 .github/workflows/nuqs-e2e.yml (+1 -27)
📝 packages/vinext/src/index.ts (+9 -2)
📝 scripts/nuqs-e2e.sh (+7 -45)

📄 Description

Summary

  • Integrates the nuqs end-to-end test suite into vinext's CI, running both app router and pages router tests
  • Fixes a dual-router dev server bug where the Pages Router middleware intercepted all requests, preventing the App Router (RSC plugin) from handling its routes when both routers are present

What it does

nuqs e2e test integration:

  • scripts/nuqs-e2e.sh: Clones the nuqs repo, patches its Next.js e2e test app to use vinext (creates vite.config.ts, replaces playwright.config.ts), installs vinext dependencies, and runs their Playwright tests
  • .github/workflows/nuqs-e2e.yml: CI workflow that runs the nuqs e2e suite on push to main, PRs, and daily. Uses continue-on-error: true since not all tests pass yet
  • package.json: Adds test:nuqs-e2e script

Dual-router fix (packages/vinext/src/index.ts):
When both app/ and pages/ directories exist, the Pages Router dev middleware now falls through to next() (letting the RSC plugin handle the request) when:

  1. No Pages Router page route matches and no fallback rewrite matches
  2. No Pages Router API route matches

Previously, these cases returned 404 directly, blocking the App Router from serving its routes.

Test results

All existing vinext tests pass (414 shim, 213 feature, 159 app-router, 86 pages-router tests). The dual-router fix was verified by running the nuqs e2e app with both src/app/ and src/pages/ directories present, confirming both routers serve their respective pages correctly.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/162 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 2/27/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/nuqs-e2e-tests` --- ### 📝 Commits (10+) - [`a51ec8c`](https://github.com/cloudflare/vinext/commit/a51ec8cfcc74c5eee8f0eec2d445940e08a6859f) Merge pull request #23 from southpolesteve/app-router-prod-server - [`cf18ba8`](https://github.com/cloudflare/vinext/commit/cf18ba89c13a0b41ea4a0a93a15f1e1c53ace94a) test: add E2E tests for router.events, next/dynamic ssr:false, Link advanced props, beforePopState - [`162ef9d`](https://github.com/cloudflare/vinext/commit/162ef9ddb3ecfbc3d305ddb4ff774ca06bde07ac) fix: add scroll={false} assertion — intercept scrollTo to verify no scroll-to-top - [`ae1e122`](https://github.com/cloudflare/vinext/commit/ae1e1221ebf1dbc7cf1011a5b3ec24bf6777ca34) Merge pull request #29 from southpolesteve/e2e-router-dynamic-link - [`8bb09bf`](https://github.com/cloudflare/vinext/commit/8bb09bfb13503e4172d9a7c22eed49e981889ec6) test: add E2E tests for Pages Router production build - [`c97a9f0`](https://github.com/cloudflare/vinext/commit/c97a9f0e143df0fc3fe4f088f53419a71d80b0c6) Merge pull request #28 from southpolesteve/e2e-prod-tests - [`81f84ba`](https://github.com/cloudflare/vinext/commit/81f84ba7ae955f0a374316cbc717d5241a562475) test: add Cloudflare Workers E2E tests - [`c2edf4c`](https://github.com/cloudflare/vinext/commit/c2edf4ccfe2c7d6ecef96c33e60e1d156349603b) Merge pull request #30 from southpolesteve/cloudflare-e2e - [`e22a065`](https://github.com/cloudflare/vinext/commit/e22a065129c18c13e67b8076ce82976fe6c859fc) feat: add middleware support to Pages Router production server - [`9ddb1f8`](https://github.com/cloudflare/vinext/commit/9ddb1f85addbe01fbc4a75f2f5948b8c3d9dfbd1) Merge pull request #25 from southpolesteve/prod-server-middleware ### 📊 Changes **3 files changed** (+17 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/nuqs-e2e.yml` (+1 -27) 📝 `packages/vinext/src/index.ts` (+9 -2) 📝 `scripts/nuqs-e2e.sh` (+7 -45) </details> ### 📄 Description ## Summary - Integrates the [nuqs](https://github.com/47ng/nuqs) end-to-end test suite into vinext's CI, running both app router and pages router tests - Fixes a dual-router dev server bug where the Pages Router middleware intercepted all requests, preventing the App Router (RSC plugin) from handling its routes when both routers are present ## What it does **nuqs e2e test integration:** - `scripts/nuqs-e2e.sh`: Clones the nuqs repo, patches its Next.js e2e test app to use vinext (creates `vite.config.ts`, replaces `playwright.config.ts`), installs vinext dependencies, and runs their Playwright tests - `.github/workflows/nuqs-e2e.yml`: CI workflow that runs the nuqs e2e suite on push to main, PRs, and daily. Uses `continue-on-error: true` since not all tests pass yet - `package.json`: Adds `test:nuqs-e2e` script **Dual-router fix (`packages/vinext/src/index.ts`):** When both `app/` and `pages/` directories exist, the Pages Router dev middleware now falls through to `next()` (letting the RSC plugin handle the request) when: 1. No Pages Router page route matches and no fallback rewrite matches 2. No Pages Router API route matches Previously, these cases returned 404 directly, blocking the App Router from serving its routes. ## Test results All existing vinext tests pass (414 shim, 213 feature, 159 app-router, 86 pages-router tests). The dual-router fix was verified by running the nuqs e2e app with both `src/app/` and `src/pages/` directories present, confirming both routers serve their respective pages correctly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:26 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#363
No description provided.