The big rename
In Next.js 16, middleware.ts was renamed to proxy.ts, and the exported function changed from middleware() to proxy(). The default runtime also moved from Edge to Node.js (since v15.5).
Where it lives
proxy.ts sits at the project root, next to app/. It runs on every request that matches the matcher config — before the route renders.
Why the rename
The old name suggested it was "in the middle of React rendering." It isn't — it sits between the network and the route, like a reverse proxy. The new name reflects that. The codemod renames it for you.