npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@loong64/playwright

v16.3.2

Published

> - **Status:** Experimental. This API is not yet stable. > - **Requires:** [Cache Components](https://nextjs.org/docs) to be enabled.

Readme

@next/playwright

  • Status: Experimental. This API is not yet stable.
  • Requires: Cache Components to be enabled.

Playwright helpers for testing Next.js applications.

Instant Navigation Testing

An instant navigation commits immediately without waiting for data fetching. The cached shell — including any Suspense loading boundaries — renders right away, and dynamic data streams in afterward. The shell is the instant part, not the full page.

instant() lets you test whether a route achieves this. While the callback is active, navigations render only cached and prefetched content. Dynamic data is deferred until the callback returns. This lets you make deterministic assertions against the shell without race conditions.

The tool assumes a warm cache: all prefetches have completed and all cacheable data is available. This way you're testing whether the route is structured correctly for instant navigation, independent of network timing. If content you expected to be cached is missing inside the callback, it points to a problem — a missing use cache directive, a misplaced Suspense boundary, or a similar gap.

Examples

Loading shell appears instantly (dynamic content behind a Suspense boundary):

import { instant } from '@next/playwright'

test('shows loading shell during navigation', async ({ page }) => {
  await page.goto('/')

  await instant(page, async () => {
    await page.click('a[href="/dashboard"]')

    // The loading shell is visible — dynamic data is deferred
    await expect(page.locator('[data-testid="loading"]')).toBeVisible()
  })

  // After instant() returns, dynamic data streams in normally
  await expect(page.locator('[data-testid="content"]')).toBeVisible()
})

Fully instant navigation (all content is cached):

test('navigates to profile instantly', async ({ page }) => {
  await page.goto('/')

  await instant(page, async () => {
    await page.click('a[href="/profile"]')

    // All content renders immediately
    await expect(page.locator('[data-testid="profile-name"]')).toBeVisible()
    await expect(page.locator('[data-testid="profile-bio"]')).toBeVisible()
  })
})

Enabling in production builds

In development (next dev), the testing API is available by default. In production builds, it is disabled unless you explicitly opt in:

// next.config.js
module.exports = {
  experimental: {
    exposeTestingApiInProductionBuild: true,
  },
}

This is not meant to be deployed to live production sites. Only enable it in controlled testing environments like preview deployments or CI.

How it works

instant() sets a cookie that tells Next.js to serve only cached data during navigations. While the cookie is active:

  • Client-side navigations: The router renders only what is available in the prefetch cache. Dynamic data is deferred until the cookie is cleared.
  • Server renders (initial load, reload, MPA navigation): The server responds with only the static shell, without any per-request dynamic data.

When the callback completes, the cookie is cleared and normal behavior resumes.

Design

The layering between this package and Next.js is intentionally very thin. This serves as a reference implementation that other testing frameworks and dev tools can replicate with minimal effort. The entire mechanism is a single cookie:

// Set the cookie to enter instant mode
document.cookie = 'next-instant-navigation-testing=1; path=/'

// ... run assertions ...

// Clear the cookie to resume normal behavior
document.cookie = 'next-instant-navigation-testing=; path=/; max-age=0'