feat: support both v4 and v5#350
Open
cesco69 wants to merge 5 commits into
Open
Conversation
cesco69
marked this pull request as ready for review
July 16, 2026 13:28
Owner
|
For this to be merged, provide full list of changes and what's left to support Express 5. Also looking at your tests, it seems that you test against express and not express5 ("express5": "npm:express@5" in package.json). Every Expess 5 divergence should be tested. |
Contributor
Author
|
Thanks for the feedback. I've updated the PR. I also fixed two behaviors I got wrong in the first iteration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds dual Express 4/5 support through a new version option in the constructor. Default behavior remains on Express 4:
Motivation
Express 5 is now the dominant version in the ecosystem:
latestlatest-4With Express 5 having more than double the weekly downloads compared to v4, it's important for ultimate-express to support both. In a future major version we may deprecate and remove v4 behavior entirely.
Full list of Express 5 changes implemented
Every behavioral divergence listed below is tested against
express5(npm:express@5) in thetests/tests/v5/directory using theSKIP_V4marker.Removed APIs (throw on use)
app.del()removedapp-del-removed.jsapp.delete()app.param(fn)removedapp-param-fn-removed.jsapp.param(name, fn)req.param()removedreq-param-removed.jsreq.params/req.body/req.queryBehavioral changes
async-errors-native.jsres.status()validationres-status-validation.jsRangeErrorotherwiseres.vary()validationres-vary-throws.jsres.redirect('back')removedres-redirect-back-removed.js'back'as literal URL (no Referrer magic)res.location('back')removedres-redirect-back-removed.jsreq.queryread-onlyreq-query-readonly.jsreq.hostincludes portreq-host-port.jshost:portinstead of just hostreq.paramsnull prototypereq-params-prototype.jsres.clearCookieignores maxAge/expiresres-clearCookie.jsexpress.urlencoded()defaultextended: falseurlencoded-default.jsexpress.static()dotfiles default'ignore'static-dotfiles.jsapp.listen()error handlingapp-listen-error.jsPath route matching (new syntax)
/*splatpath-matching-splat.js/{*splat}path-matching-splat.js/(splat is undefined)/:file{.:ext}path-matching-optional.js?+,(),[],?are treated as literals or throwWhat's NOT yet implemented (left to do)
res.sendFile()hidden/fromoptions rejectionrouter.param()rejects array of namesexpress.static.mimeremoved.js→text/javascript)mime-dbversion usedexpress:routerdebug namespace changedebugmoduleres.render()enforced asyncTests
Added 16 tests in
tests/tests/v5/withSKIP_V4marker. Each test:SKIP_V4marker)express@5(viaexpress5package in devDependencies)ultimate-expresswithversion: 5close #83