Skip to content

Conversation

@heliocastro
Copy link
Contributor

  • Migrated middleware to new proxy recommendation

@heliocastro heliocastro self-assigned this Nov 18, 2025
@heliocastro heliocastro requested a review from Copilot November 18, 2025 10:44
Copilot finished reviewing on behalf of heliocastro November 18, 2025 10:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the Next.js framework from version 15.5.4 to 16.0.3, along with associated React updates (19.1.0 → 19.2.0) and numerous dependency updates. The primary change is migrating the middleware to follow Next.js 16's new proxy recommendation by renaming the default exported function from middleware to proxy.

Key changes:

  • Updated Next.js to 16.0.3 series with React 19.2.0
  • Renamed middleware function to proxy following Next.js 16 conventions
  • Removed dynamic imports with ssr: false in favor of direct static imports
  • Updated TypeScript configuration for better module resolution

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Updated module system to NodeNext, JSX to react-jsx, disabled allowJs, and reformatted configuration arrays
src/proxy.ts Renamed default export from middleware to proxy, reordered imports, and reformatted arrays/ternaries
src/app/[locale]/requests/clearingRequest/detail/[id]/components/ClearingRequestDetail.tsx Removed dynamic import for ClearingComments, replaced with static import
src/app/[locale]/projects/detail/[id]/components/LicenseClearing.tsx Removed dynamic imports for DependencyNetworkListView and DependencyNetworkTreeView
src/app/[locale]/admin/users/components/UserAdministration.tsx Removed dynamic import for EditSecondaryDepartmentAndRolesModal
src/app/[locale]/admin/users/components/EditSecondaryDepartmentsAndRolesModal.tsx Changed component from arrow function to function declaration
global.d.ts Removed duplicate import statement and trailing newline
package.json Updated Next.js, React, React-DOM, and type definitions to latest versions
pnpm-lock.yaml Dependency lockfile updates for all transitive dependencies
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

src/proxy.ts:61

  • [nitpick] The function is named proxy but the file is named proxy.ts and it serves as Next.js middleware. While this may follow Next.js 16 conventions for proxy middleware, the name proxy is less descriptive of its actual middleware functionality than the previous name. Consider verifying this naming follows the official Next.js 16 migration guide, or adding a comment explaining the proxy naming convention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 9 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

src/proxy.ts:61

  • The middleware export function has been renamed from middleware to proxy. This is a breaking change that will cause the Next.js middleware to not be recognized. Next.js specifically looks for a function named middleware as the default export in files named middleware.ts or middleware.js.

The function should be exported as middleware, not proxy, to comply with Next.js conventions.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



## Deployment of a test environment
Before test, a local build with your defined changes in bothe files:
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "bothe" should be "both".

Suggested change
Before test, a local build with your defined changes in bothe files:
Before test, a local build with your defined changes in both files:

Copilot uses AI. Check for mistakes.
- Migrated middleware to new proxy recommendation

Signed-off-by: Helio Chissini de Castro <[email protected]>
@heliocastro heliocastro merged commit b108fdd into main Nov 19, 2025
4 of 7 checks passed
@heliocastro heliocastro deleted the feat/next16 branch November 19, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants