-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: general improvements to url.md copy #6904
Conversation
`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` is used to | ||
illustrate each. | ||
|
||
### `href` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious how those render in HTML. The GH markdown doesn't look pretty here, but I think there is no alternative. ff
Semantically very good, with one big concern inline. Rubber stamp LGTM if there we don't have better ideas, since it's anyhow an improvement. |
* A new empty string `result` is created. | ||
* If `urlObj.protocol` is a string, it is appended as-is to `result`. | ||
* Otherwise, if `urlObj.protocol` is not `undefined` and is not a string, an | ||
[`Error`][] is thrown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think the reference for [
Error][]
is defined yet
Bonus points if you or someone else manages to get the diagram from nodejs/node-v0.x-archive#8755 (comment) in here… I think someone said something about wanting to make an SVG out of it and including it here a few weeks ago. 😄 |
@addaleax ... who needs SVG!! |
LGTM |
@eljefedelrodeodeljefe ... I'm thinking of going ahead with landing this and working on making additional improvements later on in another round. Would that work for you? |
Sure LGTM then |
begins with one of `http`, `https`, `ftp`, `gopher`, or `file`, or | ||
`urlObject.protocol` is `undefined`, the literal string `//` will be appended | ||
to `result`. | ||
* If the value of the `urlObject.auth` property is `truthy`, and either |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
truthy is not code component.
LGTM |
@thefourtheye ... updated to address the |
@mscdex ... can I ask you to please double check this before I land? |
|
||
`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` | ||
A URL String is a structured string containing multiple meaningful components. | ||
When parsed, a URL Object is returned containing properties for each of these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowercase object
here?
@mscdex ... updated! thank you for the review! |
| || | hostname | port | pathname | search | | | ||
| || | | | +-+------------+ | | ||
| || | | | | | query | | | ||
" http: // user:pass @ host.com : 8080 | /p/a/t/h |?query=string | #hash " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the |
between the port
and pathname
should just be removed, same with the |
between pathname
and search
, and with the |
between search
and hash
.
Also placing query=string
completely inside the query
section is clearer.
Like this:
| || | | | | | query | |
" http: // user:pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
LGTM although I agree with @mscdex 's suggestions |
|
||
The following methods are provided by the URL module: | ||
No decoding of the query string is performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to clarified to say that this is only the case when the query string isn't parsed. When it is parsed, keys and values are decoded.
@mscdex ... updated! |
be set to an object returned by the `querystring` module's `parse()` method. | ||
If `false`, the `query` property on the returned URL object will be an | ||
be set to an object returned by the [`querystring`][] module's `parse()` | ||
method. If `false`, the `query` property on the returned URL object will be an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: make "function"/"method" usage consistent
General cleanup and restructuring of the doc. Added additional detail to how URLs are serialized.
@mscdex ... updated, simply did s/function/method. |
@mscdex... LGTY? |
LGTM |
General cleanup and restructuring of the doc. Added additional detail to how URLs are serialized. PR-URL: #6904 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Landed in dbdea02. Thanks all! |
General cleanup and restructuring of the doc. Added additional detail to how URLs are serialized. PR-URL: nodejs#6904 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
General cleanup and restructuring of the doc. Added additional detail to how URLs are serialized. PR-URL: #6904 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
added don't land label for v4.x Please feel free to backport |
Checklist
Affected core subsystem(s)
doc (url)
Description of change
General improvements to url.md copy
@nodejs/documentation @mscdex