Skip to content

refactor: Bump express from 4.21.2 to 5.1.0 #2787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: alpha
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 5, 2025

Bumps express from 4.21.2 to 5.1.0.

Release notes

Sourced from express's releases.

v5.1.0

What's Changed

... (truncated)

Changelog

Sourced from express's changelog.

5.1.0 / 2025-03-31

  • Add support for Uint8Array in res.send()
  • Add support for ETag option in res.sendFile()
  • Add support for multiple links with the same rel in res.links()
  • Add funding field to package.json
  • perf: use loop for acceptParams
  • refactor: prefix built-in node module imports
  • deps: remove setprototypeof
  • deps: remove safe-buffer
  • deps: remove utils-merge
  • deps: remove methods
  • deps: remove depd
  • deps: debug@^4.4.0
  • deps: body-parser@^2.2.0
  • deps: router@^2.2.0
  • deps: content-type@^1.0.5
  • deps: finalhandler@^2.1.0
  • deps: qs@^6.14.0
  • deps: server-static@2.2.0
  • deps: type-is@2.0.1

5.0.1 / 2024-10-08

5.0.0 / 2024-09-10

  • remove:
    • path-is-absolute dependency - use path.isAbsolute instead
  • breaking:
    • res.status() accepts only integers, and input must be greater than 99 and less than 1000
      • will throw a RangeError: Invalid status code: ${code}. Status code must be greater than 99 and less than 1000. for inputs outside this range
      • will throw a TypeError: Invalid status code: ${code}. Status code must be an integer. for non integer inputs
    • deps: send@1.0.0
    • res.redirect('back') and res.location('back') is no longer a supported magic string, explicitly use req.get('Referrer') || '/'.
  • change:
    • res.clearCookie will ignore user provided maxAge and expires options
  • deps: cookie-signature@^1.2.1
  • deps: debug@4.3.6
  • deps: merge-descriptors@^2.0.0
  • deps: serve-static@^2.1.0
  • deps: qs@6.13.0
  • deps: accepts@^2.0.0
  • deps: mime-types@^3.0.0
    • application/javascript => text/javascript
  • deps: type-is@^2.0.0
  • deps: content-disposition@^1.0.0

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Summary by CodeRabbit

  • Chores
    • Updated the "express" dependency to version 5.1.0.

@dependabot dependabot bot added dependencies Bot label; pull requests that updates a dependency file javascript Pull requests that update javascript code labels May 5, 2025
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title refactor: bump express from 4.21.2 to 5.1.0 refactor: Bump express from 4.21.2 to 5.1.0 May 5, 2025
Copy link

coderabbitai bot commented May 5, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The version of the "express" dependency in the package.json file was updated from "4.21.2" to "5.1.0". No other dependencies or configurations were modified.

Changes

File Change Summary
package.json Updated "express" dependency version from 4.21.2 to 5.1.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented May 5, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

uffizzi-cloud bot commented May 5, 2025

Uffizzi Ephemeral Environment deployment-63530

⌚ Updated May 07, 2025, 20:59 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2787

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/express-5.1.0 branch 5 times, most recently from e604ae6 to de348b1 Compare May 6, 2025 01:46
@mtrezza
Copy link
Member

mtrezza commented May 6, 2025

@coderabbitai review

Copy link

coderabbitai bot commented May 6, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Bumps [express](https://github.com/expressjs/express) from 4.21.2 to 5.1.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.21.2...v5.1.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 5.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/express-5.1.0 branch from de348b1 to f913238 Compare May 6, 2025 20:54
@mtrezza
Copy link
Member

mtrezza commented May 7, 2025

@coderabbitai Does this upgrade require any code changes?

Copy link

coderabbitai bot commented May 7, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🌐 Web query:

What are the breaking changes between Express 4 and Express 5?

💡 Result:

Express 5 introduces several breaking changes compared to Express 4. Here's a summary of the key differences:

Removed Methods and Properties:

  • app.del(): The app.del() function is no longer supported. Use app.delete() for registering HTTP DELETE routes. (expressjs.com)

  • app.param(fn): This signature, used for modifying the behavior of app.param(name, fn), has been deprecated since v4.11.0 and is removed in Express 5. (expressjs.com)

  • Pluralized Method Names: The following methods have been pluralized:

    • req.acceptsCharset()req.acceptsCharsets()
    • req.acceptsEncoding()req.acceptsEncodings()
    • req.acceptsLanguage()req.acceptsLanguages()

    Using the old methods will result in an error in Express 5. (expressjs.com)

  • req.param(name): This method has been removed. Access parameters directly via req.params, req.body, or req.query. (expressjs.com)

  • res.json(obj, status) and res.jsonp(obj, status): These signatures are no longer supported. Instead, set the status and then chain it to the res.json() or res.jsonp() method:

  res.status(status).json(obj);
  res.status(status).jsonp(obj);

(expressjs.com)

  • res.redirect(url, status): This signature is no longer supported. Use res.redirect(status, url) instead. (expressjs.com)

  • res.send(body, status): This signature is no longer supported. Use res.status(status).send(body) instead. (expressjs.com)

  • res.send(status): This signature is no longer supported. Use res.sendStatus(statusCode) instead. (expressjs.com)

  • res.sendfile(): This function has been replaced by res.sendFile() in Express 5. (expressjs.com)

Changed Features:

  • Path Route Matching Syntax: Express 5 introduces changes to how path strings are matched to incoming requests:

    • The wildcard * must have a name, matching the behavior of parameters :, use /*splat instead of /*.
    • The optional character ? is no longer supported; use braces instead.
    • Regular expression characters are not supported.
    • Some characters have been reserved to avoid confusion during upgrade (()[]?+!), use \ to escape them.
    • Parameter names now support valid JavaScript identifiers or quoted like :"this".
      (expressjs.com)
  • Rejected Promises Handled from Middleware and Handlers: Request middleware and handlers that return rejected promises are now handled by forwarding the rejected value as an Error to the error handling middleware. This means that using async functions as middleware and handlers is easier than ever. (expressjs.com)

  • express.urlencoded: The express.urlencoded method makes the extended option false by default. (expressjs.com)

  • app.router: The app.router object, which was removed in Express 4, has made a comeback in Express 5. In the new version, this object is just a reference to the base Express router. (expressjs.com)

  • req.body: The req.body property returns undefined when the body has not been parsed. In Express 4, it returns {} by default. (expressjs.com)

  • req.host: In Express 4, the req.host function incorrectly stripped off the port number if it was present. In Express 5, the port number is maintained. (expressjs.com)

  • req.query: The req.query property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple". (expressjs.com)

  • res.clearCookie: The res.clearCookie method ignores the maxAge and expires options provided by the user. (expressjs.com)

  • res.status: The res.status method only accepts integers in the range of 100 to 999, following the behavior defined by Node.js, and it returns an error when the status code is not an integer. (expressjs.com)

  • res.vary: The res.vary method throws an error when the field argument is missing. In Express 4, if the argument was omitted, it gave a warning in the console. (expressjs.com)

Improvements:

  • res.render(): This method now enforces asynchronous behavior for all view engines, avoiding bugs caused by view engines that had a synchronous implementation and that violated the recommended interface. (expressjs.com)

  • Brotli Encoding Support: Express 5 supports Brotli encoding for requests received from clients that support it. (expressjs.com)

For a comprehensive list of changes and migration guidance, refer to the official Express 5 migration guide. (expressjs.com)

Citations:


🏁 Script executed:

#!/bin/bash
# Find files that import or require Express
echo "=== Files that import Express ==="
rg -l "express" --type js --type ts

# Find where Express is initialized 
echo "=== Express initialization patterns ==="
rg "require\('express'\)" -A 3
rg "import express" -A 3
rg "new express" -A 3

# Look for potentially affected API usage based on breaking changes
echo "=== Potentially affected Express methods ==="
rg "app\.del\("
rg "app\.param\("
rg "req\.acceptsCharset\("
rg "req\.acceptsEncoding\("
rg "req\.acceptsLanguage\("
rg "req\.param\("
rg "\.json\([^,]+, [^,]+\)"
rg "\.jsonp\([^,]+, [^,]+\)"
rg "\.redirect\([^,]+, [^,]+\)"
rg "\.send\([^,]+, [^,]+\)"
rg "\.send\(\s*\d+\s*\)"
rg "\.sendfile\("
rg "\.body"
rg "\.host"
rg "\.query"
rg "\.clearCookie\("
rg "\.status\("
rg "\.vary\("
rg "\.render\("

# Look for route definitions
echo "=== Route definitions ==="
rg "app\.(get|post|put|delete|all)\(" -A 2

# Look for wildcard routes that might be affected by path matching changes
echo "=== Wildcard routes ==="
rg "app\.(get|post|put|delete|all)\(['\"].*\*" -A 2

Length of output: 19885


@mtrezza Yes, this Express upgrade from 4.21.2 to 5.1.0 will require some code changes. Based on my analysis of the codebase and Express 5 breaking changes, here are the modifications needed:

  1. Wildcard Route Syntax: Express 5 requires named wildcards. The route in Parse-Dashboard/app.js using app.get('/*', function(req, res) {...} needs to be updated to app.get('/*splat', function(req, res) {...}.

  2. Body Parsing Behavior: Express 5 changes how req.body behaves (returns undefined instead of {} when not parsed). This could affect code in Parse-Dashboard/Authentication.js that accesses properties on req.body.

  3. Express.urlencoded Defaults: The extended option for express.urlencoded now defaults to false instead of true. If this middleware is used without explicitly setting this option, behavior might change.

  4. Promise Rejection Handling: Express 5 handles rejected promises from middleware differently, which could affect async route handlers if they don't properly catch errors.

These changes aren't extensive, but skipping them could lead to runtime errors after the upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Bot label; pull requests that updates a dependency file javascript Pull requests that update javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants