Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • upgrade to nextjs 16

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Dec 5, 2025 1:49am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 5, 2025

Greptile Overview

Greptile Summary

This PR successfully upgrades the codebase from Next.js 15.4.8 to 16.0.7, along with React 19.1.0 to 19.2.1. The upgrade includes all necessary breaking change adaptations required by Next.js 16.

Key Changes

  • Middleware Rename: Renamed middleware.ts to proxy.ts with function export changes (Next.js 16 requirement)
  • Async Route Params: Updated all dynamic API routes to handle params as Promise<T> with proper async unwrapping
  • HOC Type Safety: Enhanced withMcpAuth middleware with generic type support for better type inference
  • TypeScript Config: Updated jsx compiler to react-jsx and added .next/dev/types/**/*.ts includes
  • Build Configuration: Removed TurboPack CLI flags (now default), added pino logging packages to serverExternalPackages, enabled turbopackFileSystemCacheForDev
  • Package Scripts: Changed dev:classic to dev:webpack reflecting TurboPack as the new default

Testing Recommendations

  • Verify all API routes with dynamic segments work correctly (MCP servers, workflows, workspaces, knowledge bases)
  • Test middleware routing and authentication flows
  • Confirm build process completes successfully with new TurboPack defaults
  • Check that logging functionality works with pino externalized packages

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - changes follow Next.js 16 migration requirements precisely
  • All changes are systematic framework upgrades following Next.js 16 breaking changes documentation. The params Promise pattern is consistently applied across all affected routes, middleware rename is correct, TypeScript config updates are standard, and the changes have been manually tested according to the PR description.
  • No files require special attention - all changes are standard framework upgrade adaptations

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/package.json 5/5 Updated dependencies and changed build scripts to remove turbopack flags (now default)
apps/sim/lib/mcp/middleware.ts 5/5 Added generic type support and updated signature to handle async params per Next.js 16
apps/sim/next.config.ts 5/5 Removed eslint config, added pino logging packages to serverExternalPackages, enabled turbopack file system cache
apps/sim/proxy.ts 5/5 Renamed from middleware.ts with function name changed from middleware to proxy per Next.js 16
apps/sim/tsconfig.json 5/5 Changed jsx to react-jsx and added .next/dev/types/**/*.ts to includes per Next.js 16

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant NextJS as Next.js 16
    participant Routes as API Routes
    participant Middleware as Middleware/Proxy
    participant TSConfig as TypeScript Config
    
    Dev->>NextJS: Upgrade from 15.4.8 to 16.0.7
    NextJS->>Routes: params now Promise-based
    Routes->>Routes: Update withMcpAuth HOC signature
    Routes->>Routes: Add generic type TParams support
    Routes->>Routes: Change params access to await params
    
    NextJS->>Middleware: Rename middleware.ts to proxy.ts
    Middleware->>Middleware: Rename default export from middleware to proxy
    
    NextJS->>TSConfig: Update jsx compiler option
    TSConfig->>TSConfig: Change "preserve" to "react-jsx"
    TSConfig->>TSConfig: Add .next/dev/types/**/*.ts
    
    NextJS->>NextJS: TurboPack now default bundler
    NextJS->>Dev: Remove --turbo and --turbopack flags
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

13 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit dcbdcb4 into staging Dec 5, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/nextjs branch December 5, 2025 01:57
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