From 79378b7388618680fd185559e1185b6d2a6d999f Mon Sep 17 00:00:00 2001 From: FaizanahmedSy Date: Sun, 14 Dec 2025 19:26:02 +0530 Subject: [PATCH 1/4] chore: migrate from middleware.ts to proxy.ts for Next.js 16 compatibility 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 function 'proxy' instead of default export - Add NextRequest type import for type safety - 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 --- apps/site/{middleware.ts => proxy.ts} | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) rename apps/site/{middleware.ts => proxy.ts} (65%) diff --git a/apps/site/middleware.ts b/apps/site/proxy.ts similarity index 65% rename from apps/site/middleware.ts rename to apps/site/proxy.ts index 58c3ded5d1d70..fe5051cfe0254 100644 --- a/apps/site/middleware.ts +++ b/apps/site/proxy.ts @@ -2,7 +2,11 @@ import createMiddleware from 'next-intl/middleware'; import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs'; -export default createMiddleware({ +// Migrated from middleware.ts to proxy.ts as per Next.js 16 deprecation +// The middleware file convention is deprecated and has been renamed to proxy +// See: https://nextjs.org/docs/messages/middleware-to-proxy + +export const proxy = createMiddleware({ // A list of all locales that are supported locales: availableLocaleCodes, @@ -17,6 +21,6 @@ export default createMiddleware({ alternateLinks: false, }); -// We only want the middleware to run on the `/` route +// We only want the proxy to run on the `/` route // to redirect users to their preferred locale export const config = { matcher: ['/'] }; From 3443dc6c709bff3b45bc37826bfebd87e1b4b8f6 Mon Sep 17 00:00:00 2001 From: FaizanahmedSy Date: Sun, 14 Dec 2025 19:48:44 +0530 Subject: [PATCH 2/4] refactor: removed unnecessary comment --- apps/site/proxy.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/site/proxy.ts b/apps/site/proxy.ts index fe5051cfe0254..e0f4959e092d2 100644 --- a/apps/site/proxy.ts +++ b/apps/site/proxy.ts @@ -2,7 +2,6 @@ import createMiddleware from 'next-intl/middleware'; import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs'; -// Migrated from middleware.ts to proxy.ts as per Next.js 16 deprecation // The middleware file convention is deprecated and has been renamed to proxy // See: https://nextjs.org/docs/messages/middleware-to-proxy From 1e4b33353c034657bc54096f0350436f1843ea4a Mon Sep 17 00:00:00 2001 From: FaizanahmedSy Date: Sun, 14 Dec 2025 19:52:48 +0530 Subject: [PATCH 3/4] chore: update CODEOWNERS to reference proxy.ts instead of middleware.ts --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7037998ac1bd6..0d843abbca8a0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -15,7 +15,7 @@ pnpm-lock.yaml @nodejs/web-infra # Framework apps/site/next.config.mjs @nodejs/web-infra apps/site/next.dynamic.mjs @nodejs/web-infra -apps/site/middleware.ts @nodejs/web-infra +apps/site/proxy.ts @nodejs/web-infra apps/site/navigation.mjs @nodejs/web-infra apps/site/playwright.config.ts @nodejs/web-infra From f4507a886ae41f564729b0c843d3267b0bb4529b Mon Sep 17 00:00:00 2001 From: FaizanahmedSy Date: Sun, 14 Dec 2025 20:05:01 +0530 Subject: [PATCH 4/4] refactor: removed proxy realted comments --- apps/site/proxy.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/site/proxy.ts b/apps/site/proxy.ts index e0f4959e092d2..8780a316d6214 100644 --- a/apps/site/proxy.ts +++ b/apps/site/proxy.ts @@ -2,9 +2,6 @@ import createMiddleware from 'next-intl/middleware'; import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs'; -// The middleware file convention is deprecated and has been renamed to proxy -// See: https://nextjs.org/docs/messages/middleware-to-proxy - export const proxy = createMiddleware({ // A list of all locales that are supported locales: availableLocaleCodes,