Files
vercel__next.js/test
Will Binns-Smith 0ae8c72462 Consolidate Promise.withResolvers polyfills (#96772)
### What?

Replace `DetachedPromise` with the shared `createPromiseWithResolvers`
helper and use that helper in the vendored `@mswjs/interceptors` Node 20
shim.

This can go away entirely when we support Node 22 at minimum.

### Why?

Next.js maintained duplicate deferred-promise implementations in
`src/lib/detached-promise.ts`,
`src/shared/lib/promise-with-resolvers.ts`, and the interceptor bundle
entry.

### How?

- Migrate `DetachedPromise` consumers to `createPromiseWithResolvers`
- Delete the duplicate `DetachedPromise` implementation
- Delegate the interceptor's required global polyfill to the shared
helper
- Update the generated interceptor bundle and server trace snapshot

Validated with `pnpm --filter=next types`, focused Jest tests, ESLint,
Prettier, and the `ncc_mswjs_interceptors` bundle task.

<!-- NEXT_JS_LLM -->

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-08-06 08:28:16 -07:00
..
…

See Testing for more information on how you can run/write/debug tests for Next.js.