Skip to content

Conversation

@krzysdz
Copy link
Contributor

@krzysdz krzysdz commented Nov 1, 2025

Fixes #2090

@netlify
Copy link

netlify bot commented Nov 1, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit b7d13cf
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6944b01af5f04f0008903599
😎 Deploy Preview https://deploy-preview-2092--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

🚦 Lighthouse Results (Mobile & Desktop)

URL Device Perf A11y Best Practices
/ mobile 🔴 70 🟢 100 🟢 96
/en/blog/posts.html mobile 🔴 73 🟢 96 🟢 96
/en/5x/api.html mobile 🟠 75 🟢 95 🟢 96
/ desktop 🟢 100 🟢 100 🟢 96
/en/blog/posts.html desktop 🟢 100 🟢 96 🟢 92
/en/5x/api.html desktop 🟢 99 🟢 95 🟢 96

@krzysdz krzysdz marked this pull request as ready for review November 1, 2025 23:03
@krzysdz krzysdz requested a review from a team as a code owner November 1, 2025 23:03
@krzysdz krzysdz changed the title docs: Document req.params changes in 5.x docs: document req.params changes in 5.x Nov 1, 2025
@krzysdz
Copy link
Contributor Author

krzysdz commented Dec 18, 2025

Just one thing that I remembered - req.params has null prototype, unless the path is a regular expression. With regexes req.params is a normal object (see regexpMatcher in router)

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

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

Thanks @krzysdz!

What do you think about changing it to this suggestion, which includes more information and code examples showing what changed, to make the change easier to understand?

@krzysdz
Copy link
Contributor Author

krzysdz commented Dec 19, 2025

Your suggestion is definitely clearer. I'll admit that I'm not great at writing documentation.

There is just the question about prototype that may or may not be null... I did not notice it initially and forgot to update the PR when I tested some more things and realised that regular expressions have req.params with a regular Object prototype. To be fair this inconsistency is probably something that should be changed in router.

@bjohansebas
Copy link
Member

There is just the question about prototype that may or may not be null... I did not notice it initially and forgot to update the PR when I tested some more things and realised that regular expressions have req.params with a regular Object prototype. To be fair this inconsistency is probably something that should be changed in router.

yep, when it's not regexp then the object is created here, whereas here is where the object is created, probably we should change that in the router so both ways are the same

@bjohansebas bjohansebas added docs Issues/pr concerning content 5.x Docs for 5.x version labels Dec 19, 2025
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x Docs for 5.x version docs Issues/pr concerning content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5.x - undocumented wildcard behaviour change in req.params

2 participants