Commit Graph

8 Commits

Author SHA1 Message Date
Sebastian "Sebbie" Silbermann 6ba71046b0 [test] Move the harness off node-fetch (#98195)
Node.js ships with a built-in `fetch` now so `node-fetch` is no longer
necessary. Mostly motivated by tracing Node.js deprecation warnings
which originated from `node-fetch` by calling the deprecated
`url.parse`.

Call sites keep working through a compatibility type on `fetchViaHTTP`
that translates node-fetch-only options: Instead of `agent` we pass to
`http(s)` directly, `timeout` becomes `AbortSignal.timeout`, and Node.js
readable streams are accepted as bodies with `duplex: 'half'` set
automatically.

The `abort-controller` polyfill is dropped since its signal type
predates the current AbortSignal and undici would not honor it.
`node-fetch` stays installed because `scripts/generate-release-log.mjs`,
`scripts/reset-project.mjs`, and `scripts/update-google-fonts.js` still
import it (follow-up material). Fixture apps will be migrated
separately.
2026-09-10 13:50:35 +02:00
Tim Neutkens 5f59616ff2 Change names of logged times (#90688)
## What?

Reduces confusion of time spent in Next.js compared to application code
executing
2026-03-02 16:23:38 +01:00
JJ Kasper 69d63edcc7 Fix missing incremental cache in middleware unstable_cache (#89980)
## Summary
- pass `IncrementalCache` into the shared middleware template adapter so
middleware/proxy modules initialize `globalThis.__incrementalCache`
- add regression coverage for `unstable_cache` usage inside both
deprecated `middleware` (edge) and `proxy` (node) fixtures
- verify both e2e suites pass without hitting `Invariant:
incrementalCache missing in unstable_cache`

## Verification
- `pnpm build`
- `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=dev pnpm testonly
test/e2e/app-dir/app-middleware/app-middleware.test.ts`
- `NEXT_SKIP_ISOLATE=1 NEXT_TEST_MODE=dev pnpm testonly
test/e2e/app-dir/app-middleware-proxy/app-middleware-proxy.test.ts`
2026-02-13 14:22:32 -08:00
Niklas Mischkulnig 074262baf3 Only allow node runtime in proxy (#85139)
This PR is the initiative of deprecating the edge runtime. Proxy will
default to Node.js runtime, and will not allow runtime config. If the
users want to use the edge runtime, they should stay on the Middleware,
though we recommend starting the migration.

---------

Co-authored-by: devjiwonchoi <devjiwonchoi@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-10-21 16:06:11 -07:00
Benjamin Woodruff 40f48ebb5e Turbopack: Remove redundant log line, increase delay for compiling log message (#85133)
We've already got output logging for this stuff, and the "compiling" message is too noisy.

Only print `Compiling /...` it if the compilation takes more than 3s, stop printing `Compiled in` altogether.

After this PR:
<img width="1075" height="335" alt="Screenshot 2025-10-20 at 3 15 59 PM" src="https://github.com/user-attachments/assets/34e87d18-8feb-4470-ae11-0d8e4b3a8a6b" />

Removes this line:
<img width="1095" height="254" alt="Screenshot 2025-10-20 at 3 17 56 PM" src="https://github.com/user-attachments/assets/76fb795e-760a-4782-889a-dd98bcf09125" />
2025-10-20 22:53:45 -07:00
Sebastian "Sebbie" Silbermann 6feaddf73e Remove unused eslint-disable directives (#84797)
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
2025-10-12 23:17:08 +02:00
Jiwon Choi 537f8c7890 Log Compiled proxy in ... (#84746)
When using `proxy`, the `Compiled X in ...` message in Turbopack had
hardcoded `middleware`. Therefore, modify to display `proxy` if using a
proxy. Also, Webpack displayed with a leading slash `/proxy`, which
could be misinterpreted as a route, so I removed the leading slash.
2025-10-10 19:39:52 +02:00
Jiwon Choi d7a58203d1 Deprecate middleware and recommend proxy (#84119)
We recommend users avoid relying on Middleware unless no other options
exist. Our goal is to give them APIs with better ergonomics so they can
achieve their goals without Middleware.

The term “middleware” often confuses users with Express.js middleware,
which can encourage misuse. To clarify our direction, we are renaming
the file convention to “proxy.” This highlights that we are moving away
from Middleware, breaking down its overloaded features, and making the
Proxy clear in its purpose.

`proxy.js` should be a drop-in replacement for `middleware.js` for its
features, but ONE thing:

```diff
- export function middleware
+ export function proxy
```

Codemod: https://github.com/vercel/next.js/pull/84127

---------

Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
2025-10-09 04:00:53 +02:00