Skip to content

feat(deps)!: update express to v5#88

Open
chenjiahan wants to merge 2 commits intomainfrom
express_v5_0228
Open

feat(deps)!: update express to v5#88
chenjiahan wants to merge 2 commits intomainfrom
express_v5_0228

Conversation

@chenjiahan
Copy link
Member

Copilot AI review requested due to automatic review settings February 28, 2026 07:34
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant infrastructure upgrade by migrating the project's Express framework to its fifth major version. This update involves not only bumping the core Express package but also meticulously updating its associated type definitions and a cascade of underlying dependencies to maintain compatibility and leverage the latest features and improvements offered by Express v5. The changes ensure the application remains robust and aligned with modern web development practices.

Highlights

  • Express v5 Upgrade: The primary change is the upgrade of the express dependency to version 5.2.1, along with its corresponding TypeScript type definitions (@types/express) to 5.0.6. This is a major version bump, indicating potential breaking changes and new features.
  • Dependency Resolution Updates: The pnpm-lock.yaml file reflects extensive updates across numerous transitive dependencies. This includes updates to middleware like body-parser, finalhandler, send, serve-static, and various utility packages, ensuring compatibility with Express v5.
  • Middleware Handling Adjustment: A minor but significant change was made in src/server.ts to explicitly return after calling proxyMiddleware. This adjustment likely addresses a change in how middleware functions are expected to handle control flow in Express v5.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package.json
    • Updated express dependency from ^4.22.1 to ^5.2.1.
    • Updated @types/express dependency from ^4.17.25 to ^5.0.6.
    • Removed @types/express from devDependencies.
  • pnpm-lock.yaml
    • Updated resolutions for express and @types/express to their new major versions.
    • Removed @types/express-serve-static-core from dependencies.
    • Updated body-parser from 1.20.3 to 2.2.2.
    • Updated content-disposition from 0.5.4 to 1.0.1.
    • Updated cookie-signature from 1.0.6 to 1.2.2.
    • Removed array-flatten and destroy packages.
    • Updated finalhandler from 1.3.1 to 2.1.1.
    • Updated fresh from 0.5.2 to 2.0.0.
    • Removed http-errors@2.0.0 entry.
    • Updated iconv-lite from 0.4.24 to 0.7.2.
    • Added is-promise@4.0.0 package.
    • Updated media-typer from 0.3.0 to 1.1.0.
    • Updated merge-descriptors from 1.0.3 to 2.0.0.
    • Updated mime-types from 2.1.35 to 3.0.2.
    • Added negotiator@1.0.0 package.
    • Updated path-to-regexp from 0.1.12 to 8.3.0.
    • Updated raw-body from 2.5.2 to 3.0.2.
    • Added router@2.2.0 package.
    • Updated send from 0.19.0 to 1.2.1.
    • Updated serve-static from 1.16.2 to 2.2.1.
    • Removed statuses@2.0.1 entry.
    • Updated type-is from 1.6.18 to 2.0.1.
  • src/server.ts
    • Modified proxyMiddleware call to explicitly return after execution, aligning with potential changes in Express v5 middleware handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates Express to version 5. This is a major update with breaking changes, and my review focuses on ensuring the migration is correct and all related dependencies are compatible.

I've identified a couple of critical issues:

  • The http-proxy-middleware package needs to be updated to a version compatible with Express v5. The current version is for Express v4.
  • The way the proxy middleware is called in src/server.ts is incorrect for Express v5's async handling and could lead to issues.

Additionally, @types/express is no longer needed with Express v5 and should be removed.

Please see my detailed comments for suggestions on how to address these points.

Comment on lines +2036 to +2037
proxyMiddleware(req, res, next);
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This change incorrectly handles the async proxy middleware in Express v5. Instead of a fire-and-forget call, you should await the proxyMiddleware promise to ensure the request is fully handled, including any asynchronous operations and error handling.

The root cause is that http-proxy-middleware@2 is not compatible with Express v5. You should update http-proxy-middleware to ^3.0.0 in package.json, which is designed for Express v5.

After updating the package, you can fix this line as follows:

Suggested change
proxyMiddleware(req, res, next);
return;
await proxyMiddleware(req, res, next);

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

Updates the dev server’s Express dependency to the Express v5 major line, aligning runtime and type dependencies with the new Express API and its transitive dependency set.

Changes:

  • Bump express to ^5.2.1 and @types/express to ^5.0.6.
  • Adjust proxy middleware invocation in src/server.ts for the updated middleware typing/behavior.
  • Refresh pnpm-lock.yaml to reflect Express v5’s updated dependency graph.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/server.ts Tweaks how the proxy middleware is invoked under the proxy handler path.
package.json Updates Express and Express type dependencies; removes redundant devDependency entries.
pnpm-lock.yaml Lockfile updates for Express v5 and related transitive upgrades.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

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