Skip to content

Add instant navigations eval with browser-based testing via Next.js testing API#62

Open
gaojude wants to merge 4 commits intomainfrom
jude/instant-navigations-eval
Open

Add instant navigations eval with browser-based testing via Next.js testing API#62
gaojude wants to merge 4 commits intomainfrom
jude/instant-navigations-eval

Conversation

@gaojude
Copy link
Contributor

@gaojude gaojude commented Feb 19, 2026

Adds agent-040-instant-navigations, an eval that tasks the agent with making client-side navigation to a products page instant using unstable_instant, "use cache", and <Suspense>.

The eval validates three things: a structural check for the unstable_instant export on the products route, a structural check that getProducts is imported from @/lib/data, and a browser-based E2E test using Next.js's instant navigation testing API (window.__EXPERIMENTAL_NEXT_TESTING__.navigation.lock()/unlock()). The lock blocks dynamic data from streaming into the UI so the test can deterministically assert that the static shell (heading) renders immediately, then after unlock verifies product data streams in.

Browser automation in the Vercel sandbox (Amazon Linux 2023) requires @sparticuz/chromium for a serverless-compatible Chromium binary plus puppeteer-core to drive it. The experiment setup installs system dependencies via dnf (nspr, nss, atk, mesa-libgbm, etc.) and sets VERCEL=1 before dynamically importing @sparticuz/chromium so it extracts its bundled AL2023 libraries to /tmp. The instant(page, fn) helper wraps the lock/unlock lifecycle following the pattern from navigation-testing-lock.js.

The experiment config injects the instant navigations documentation into node_modules/next/dist/docs/ alongside AGENTS.md, CLAUDE.md, and GEMINI.md. Tested at 50% pass rate (1/2 completed runs passed; failures are model failures where the agent omits the unstable_instant export).

@socket-security
Copy link

socket-security bot commented Feb 19, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednext@​16.2.0-canary.506899909770
Addedpuppeteer-core@​24.37.5751009297100
Added@​sparticuz/​chromium@​143.0.48310010093100

View full report

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