Skip to content
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

doc: expand req.query change documentation #1127

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

gireeshpunathil
Copy link
Contributor

Refs: #1126

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

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

The notes was to expand the req.query docs, not the migration guide.

You can keep it also in the guide if you are saying that this is a change in behavior between 4 and 5.

@gireeshpunathil
Copy link
Contributor Author

@dougwilson - got it, and added to the API doc too!

@dougwilson
Copy link
Contributor

Ok, but I don't think this behavior changed between 4 and 5. Can you elaborate on why you think it should be in the migration guide? Did the behavior actually change and I am just mistaken on it not?

@@ -1,7 +1,7 @@
<h3 id='req.query'>req.query</h3>

This property is an object containing a property for each query string parameter in the route.
If there is no query string, it is the empty object, `{}`.
When disabled, the `req.query` will be an empty object (`{}`). Else, the result of configured query parser.
Copy link
Contributor

Choose a reason for hiding this comment

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

(Sorry that the mobile view doesn't allow me to make suggested changes).

Would the wording sound better as

When "query parser" (ed: make a link) is set to disabled, it is the empty object {}, otherwise it is the result of the configured query parser.

My thought is beginning a sentence with "Else" seems weird (not sure if there is an English rule around that though), but also that "When disabled" is not clear it refers to the query parser setting when a user just jumps to req.query docs. Same with what "configured query parser" refers to, so having that called out and a back link to it seems useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dougwilson - made those changes, mostly as is. Please have a look at the link - as I am not sure about the link target as well as the link semantics.

Copy link
Contributor

Choose a reason for hiding this comment

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

as I am not sure about the link target as well as the link semantics.

The best method to know is to test locally: https://github.com/expressjs/expressjs.com#local-setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately it failed (consistently) for me at the setup stage (missing ruby headers while installing json module). I will check with @HarshithaKP when she comes online and try to verify the link semantics.

meanwhile let me know if you are fine with the link target

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, link semantics is now verified, and fixed:

  • removed back-quote of href, as it was appearing in grey
  • removed the import of the link target document, as it wasn't necessary

@gireeshpunathil
Copy link
Contributor Author

Can you elaborate on why you think it should be in the migration guide? Did the behavior actually change and I am just mistaken on it not?

My rationale is that because we are expanding on the API doc for better clarity, it also makes sense to add wherever it is mentioned. However, removed it from the migration guide.

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

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

LGTM

@dougwilson dougwilson merged commit 1e50c57 into expressjs:gh-pages Apr 14, 2020
@github-pages github-pages bot temporarily deployed to github-pages April 14, 2020 00:12 Inactive
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