[PR #170] [CLOSED] feat: add nuqs e2e test suite integration with dual-router fix #366

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

📋 Pull Request Information

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

Base: mainHead: feat/nuqs-e2e-clean


📝 Commits (3)

  • 71bc3f4 feat: add nuqs e2e test suite integration
  • 164f544 fix: support dual app + pages router in dev server, include pages router in nuqs e2e
  • c07a31e test: add dual-router regression test for app + pages coexistence

📊 Changes

11 files changed (+396 additions, -3 deletions)

View changed files

.github/workflows/nuqs-e2e.yml (+125 -0)
📝 package.json (+2 -1)
📝 packages/vinext/src/index.ts (+9 -2)
📝 pnpm-lock.yaml (+21 -0)
scripts/nuqs-e2e.sh (+151 -0)
tests/dual-router.test.ts (+51 -0)
tests/fixtures/dual-router/app/app-only/page.tsx (+3 -0)
tests/fixtures/dual-router/app/layout.tsx (+15 -0)
tests/fixtures/dual-router/app/page.tsx (+3 -0)
tests/fixtures/dual-router/package.json (+13 -0)
tests/fixtures/dual-router/pages/pages-only.tsx (+3 -0)

📄 Description

Summary

Inspired by @nuqs47ng's tweet showing 73% of their e2e tests passing on vinext.

  • 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). Typecheck and lint clean. 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/170 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 2/27/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/nuqs-e2e-clean` --- ### 📝 Commits (3) - [`71bc3f4`](https://github.com/cloudflare/vinext/commit/71bc3f425aa8d2487c5b9954e2d49889aa51687b) feat: add nuqs e2e test suite integration - [`164f544`](https://github.com/cloudflare/vinext/commit/164f5445e1cbf51aa3d03148704cdf322ed4b4fc) fix: support dual app + pages router in dev server, include pages router in nuqs e2e - [`c07a31e`](https://github.com/cloudflare/vinext/commit/c07a31ed50f3a5c2bdd6c3d0401c137d08fceef9) test: add dual-router regression test for app + pages coexistence ### 📊 Changes **11 files changed** (+396 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/nuqs-e2e.yml` (+125 -0) 📝 `package.json` (+2 -1) 📝 `packages/vinext/src/index.ts` (+9 -2) 📝 `pnpm-lock.yaml` (+21 -0) ➕ `scripts/nuqs-e2e.sh` (+151 -0) ➕ `tests/dual-router.test.ts` (+51 -0) ➕ `tests/fixtures/dual-router/app/app-only/page.tsx` (+3 -0) ➕ `tests/fixtures/dual-router/app/layout.tsx` (+15 -0) ➕ `tests/fixtures/dual-router/app/page.tsx` (+3 -0) ➕ `tests/fixtures/dual-router/package.json` (+13 -0) ➕ `tests/fixtures/dual-router/pages/pages-only.tsx` (+3 -0) </details> ### 📄 Description ## Summary Inspired by [@nuqs47ng's tweet](https://x.com/nuqs47ng/status/2027342582401941761) showing 73% of their e2e tests passing on vinext. - 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). Typecheck and lint clean. 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:27 +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#366
No description provided.