refactor: Bump express from 4.21.2 to 5.1.0
Bumps express from 4.21.2 to 5.1.0.
Release notes
Sourced from express's releases.
v5.1.0
What's Changed
- Update captains by
@UlisesGasconin expressjs/express#6027- build: Node.js 23.0 by
@bjohansebasin expressjs/express#6075- Add funding field (v5) by
@bjohansebasin expressjs/express#6064- ✅ add discarded middleware test by
@ctcpipin expressjs/express#5819- update homepage link http to https by
@bjohansebasin expressjs/express#5920- Improve readme by
@bjohansebasin expressjs/express#5994- Add bjohansebas as repo captain for expressjs.com by
@crandmckin expressjs/express#6058- Remove Object.setPrototypeOf polyfill by
@Phillip9587in expressjs/express#6081- fix(buffer): use node:buffer instead of safe-buffer by
@bhavya3024in expressjs/express#6071- docs: Add DCO by
@UlisesGasconin expressjs/express#6048- cleanup: remove promise support check from tests by
@Phillip9587in expressjs/express#6148- Use loop for acceptParams by
@blakeembreyin expressjs/express#6066- Improve documentation step in release process by
@bjohansebasin expressjs/express#6150- cleanup: remove unnecessary require for global Buffer by
@Phillip9587in expressjs/express#6146- cleanup: remove AsyncLocalStorage check by
@Phillip9587in expressjs/express#6147- update history.md for acceptParams change by
@jonchurchin expressjs/express#6177- docs: add
@rxmarblesto the triage team by@UlisesGasconin expressjs/express#6151- refactor: improve readability by
@sazk07in expressjs/express#6173- docs: clarify the security process in the triage role by
@bjohansebasin expressjs/express#6217- chore: replace
methodsdependency with standard library by@jonkoopsin expressjs/express#6196- Remove
utils-mergedependency - use spread syntax instead by@Phillip9587in expressjs/express#6091- fix(securite): fix vulnerabilities by
@Abdel-Monaam-Aouiniin expressjs/express#6211- refactor: prefix built-in node module imports by
@slagiewkain expressjs/express#6236- fix: remove download size badges by
@wesleytoddin expressjs/express#6266- Remove unused
depddependency by@jonkoopsin expressjs/express#6197- fix: usage of
Invalid action input 'persist-credentials'foractions/setup-node@v4inci.ymlby@hamirmahalin expressjs/express#6256- Add support for OSSF scorecard reporting by
@UlisesGasconin expressjs/express#5431- docs: add
@Phillip9587to the triage team by@bjohansebasin expressjs/express#6276- fix: added a missing semicolon in css styles in examples/auth by
@pr4j3shin expressjs/express#6297- docs: include team email in the security policy by
@UlisesGasconin expressjs/express#6278- refactor: simplify
normalizeTypesfunction by@Ayoub-Mabroukin expressjs/express#6097- ci: updated github actions ci workflow by
@Phillip9587in expressjs/express#6314- ci: fix npm install --include typo by
@Phillip9587in expressjs/express#6324- ci: updated scorecard actions by
@Phillip9587in expressjs/express#6322- build(deps): use carat notation for dependency versions by
@dpopp07in expressjs/express#6317- chore(deps): update
debugto ^4.4.0 by@Phillip9587in expressjs/express#6313- docs: retroactively note 5.0.0-beta.1 api change in history file by
@dpopp07in expressjs/express#6333- feat(deps): body-parser@^2.1.0 by
@wesleytoddin expressjs/express#6332- feat(deps): router@^2.1.0 by
@wesleytoddin expressjs/express#6331- Update repo captains by
@UlisesGasconin expressjs/express#6234- deps: upgrade nyc by
@agungjatiin expressjs/express#6122- fix (deps): update deps by
@wesleytoddin expressjs/express#6337- response: add support for ETag option in res.sendFile by
@juanarbolin expressjs/express#6073- Update multiple links to use
httpsinstead ofhttpby@Phillip9587in expressjs/express#6338- Extend res.links() to allow adding multiple links with the same rel #2729 by
@andveain expressjs/express#4885- docs: update emeritus triagers by
@UlisesGasconin expressjs/express#6345- docs: update guidance for triager nominations by
@bjohansebasin expressjs/express#6349- docs: clarify guidelines for becoming a committer by
@bjohansebasin expressjs/express#6364
... (truncated)
Changelog
Sourced from express's changelog.
5.1.0 / 2025-03-31
- Add support for
Uint8Arrayinres.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:
[email protected]- deps:
[email protected]5.0.1 / 2024-10-08
- Update
cookiesemver lock to address CVE-2024-477645.0.0 / 2024-09-10
- remove:
path-is-absolutedependency - usepath.isAbsoluteinstead- 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: [email protected]
res.redirect('back')andres.location('back')is no longer a supported magic string, explicitly usereq.get('Referrer') || '/'.- change:
res.clearCookiewill ignore user providedmaxAgeandexpiresoptions- deps: cookie-signature@^1.2.1
- deps: [email protected]
- deps: merge-descriptors@^2.0.0
- deps: serve-static@^2.1.0
- deps: [email protected]
- 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
cd7d4395.1.04c4f3eafix(deps): serve-static@^2.2.0 (#6418)cb4c56efix(docs): remove@mertcanaltinfrom Triagers (#6408)7b44e1dci: use full SHAs for github action versionseb6d125deps: router@^2.2.0 (#6417)f1a2dc8deps: type-is@^2.0.1 (#6420)6b51e8edeps: body-parser@^2.2.0 (#6419)1f311c5build(deps-dev): bump cookie-session from 2.0.0 to 2.1.0 (#6399)9e97144feat(deps): [email protected] (#6373)29d0980build(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1 (#6397)- Additional commits viewable in compare view
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill 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 versionwill 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 dependencywill 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.
Note Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
I will reformat the title to use the proper commit message syntax.
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein 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.
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
:tada: Snyk checks have passed. No issues have been found so far.
:white_check_mark: security/snyk check is complete. No issues have been found. (View Details)
Uffizzi Ephemeral Environment deployment-63530
:watch: Updated May 07, 2025, 20:59 UTC
:cloud: https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2787
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more
@coderabbitai review
✅ 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.
@coderabbitai Does this upgrade require any code changes?
[!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(): Theapp.del()function is no longer supported. Useapp.delete()for registering HTTP DELETE routes. (expressjs.com) -
app.param(fn): This signature, used for modifying the behavior ofapp.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 viareq.params,req.body, orreq.query. (expressjs.com) -
res.json(obj, status)andres.jsonp(obj, status): These signatures are no longer supported. Instead, set the status and then chain it to theres.json()orres.jsonp()method:
res.status(status).json(obj);
res.status(status).jsonp(obj);
-
res.redirect(url, status): This signature is no longer supported. Useres.redirect(status, url)instead. (expressjs.com) -
res.send(body, status): This signature is no longer supported. Useres.status(status).send(body)instead. (expressjs.com) -
res.send(status): This signature is no longer supported. Useres.sendStatus(statusCode)instead. (expressjs.com) -
res.sendfile(): This function has been replaced byres.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/*splatinstead 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)
- The wildcard
-
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
Errorto the error handling middleware. This means that usingasyncfunctions as middleware and handlers is easier than ever. (expressjs.com) -
express.urlencoded: Theexpress.urlencodedmethod makes theextendedoptionfalseby default. (expressjs.com) -
app.router: Theapp.routerobject, 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: Thereq.bodyproperty returnsundefinedwhen the body has not been parsed. In Express 4, it returns{}by default. (expressjs.com) -
req.host: In Express 4, thereq.hostfunction incorrectly stripped off the port number if it was present. In Express 5, the port number is maintained. (expressjs.com) -
req.query: Thereq.queryproperty 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: Theres.clearCookiemethod ignores themaxAgeandexpiresoptions provided by the user. (expressjs.com) -
res.status: Theres.statusmethod only accepts integers in the range of100to999, following the behavior defined by Node.js, and it returns an error when the status code is not an integer. (expressjs.com) -
res.vary: Theres.varymethod throws an error when thefieldargument 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:
- 1: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 2: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 3: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 4: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 5: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 6: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 7: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 8: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 9: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 10: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 11: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 12: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 13: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 14: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 15: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 16: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 17: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 18: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 19: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 20: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 21: https://expressjs.com/en/guide/migrating-5?utm_source=openai
- 22: https://expressjs.com/en/guide/migrating-5?utm_source=openai
🏁 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:
-
Wildcard Route Syntax: Express 5 requires named wildcards. The route in
Parse-Dashboard/app.jsusingapp.get('/*', function(req, res) {...}needs to be updated toapp.get('/*splat', function(req, res) {...}. -
Body Parsing Behavior: Express 5 changes how
req.bodybehaves (returnsundefinedinstead of{}when not parsed). This could affect code inParse-Dashboard/Authentication.jsthat accesses properties onreq.body. -
Express.urlencoded Defaults: The
extendedoption forexpress.urlencodednow defaults tofalseinstead oftrue. If this middleware is used without explicitly setting this option, behavior might change. -
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.
A newer version of express exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.