nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

chore: migrate from middleware.ts to proxy.ts for Next.js 16 compatib…

Open Faizanahmedsy opened this issue 2 weeks ago • 12 comments

…ility

Migrate from the deprecated middleware.ts file convention to the new proxy.ts convention as required by Next.js 16.0.10.

The middleware file convention has been deprecated and renamed to 'proxy' to better clarify its purpose as a network boundary in front of the app, and to avoid confusion with Express.js middleware.

Changes:

  • Rename apps/site/middleware.ts to apps/site/proxy.ts
  • Add named export const proxy = createMiddleware({
  • Maintain full compatibility with next-intl internationalization
  • Update comments to reflect proxy terminology

This resolves the deprecation warning: 'The middleware file convention is deprecated. Please use proxy instead.'

Refs: https://nextjs.org/docs/messages/middleware-to-proxy

Description

Validation

Related Issues

Fixed #8418

Check List

  • [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [x] I have run pnpm format to ensure the code follows the style guide.
  • [x] I have run pnpm test to check if all tests are passing.
  • [x] I have run pnpm build to check if the website builds without errors.
  • [x] I've covered new added functionality with unit tests if necessary.

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nodejs-org Ready Ready Preview Dec 14, 2025 2:36pm

vercel[bot] avatar Dec 14 '25 14:12 vercel[bot]

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

github-actions[bot] avatar Dec 14 '25 14:12 github-actions[bot]

export const proxy = createMiddleware({

You should just be able to do this, no?

I have done as per documentation, but let me try if this similer approch works

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

hi @avivkeller I amended the commit to incorporate this feedback. I've verified that both approaches work correctly, and all tests pass

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

The reference to this file in CODEOWNERS needs updating, please

okay checking that

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

The reference to this file in CODEOWNERS needs updating, please

hi @MattIPv4 I have done that please check if I have done it correctly or not

- apps/site/middleware.ts @nodejs/web-infra
+ apps/site/proxy.ts @nodejs/web-infra

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

The added comment is still not needed, you only removed half of it.

avivkeller avatar Dec 14 '25 14:12 avivkeller

The added comment is still not needed, you only removed half of it.

yeah sorry about that check now f4507a886ae41f564729b0c843d3267b0bb4529b

Faizanahmedsy avatar Dec 14 '25 14:12 Faizanahmedsy

Looks like Matt and Claudio still have concerns, but LGTM with my blockers

Not concerns. This actually cannot be merged, otherwise it breaks Cloudflare builds.

ovflowd avatar Dec 14 '25 14:12 ovflowd

To be clear not against the changes, just, they cannot be merged meantime.

ovflowd avatar Dec 14 '25 15:12 ovflowd

To be clear not against the changes, just, they cannot be merged meantime.

Okay 👍, I will try to remind you once Open Next Supports it

Faizanahmedsy avatar Dec 15 '25 00:12 Faizanahmedsy

Thank you! You can keep the PR open although I'd recommend converting it back to a draft state.

ovflowd avatar Dec 15 '25 00:12 ovflowd