-
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,http2: add parameters for Http2Session:connect event #20193
Conversation
We don't typically list parameters like that for events, do we? I think it's useful information to have, but I'm not sure that's the best way to list it. (Maybe it is. I honestly don't know.) @nodejs/documentation |
@Trott we do in the http and streams documentation. For example: https://nodejs.org/dist/latest-v9.x/docs/api/http.html#http_event_connect |
I never noticed that. OK, cool. If it's what we already do elsewhere, at least it's a unified approach. |
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 "The associated ... instance" is that helpful since the same information is conveyed by the type annotation already. Otherwise, LGTM.
doc/api/http2.md
Outdated
@@ -136,6 +136,9 @@ listener does not expect any arguments. | |||
added: v8.4.0 | |||
--> | |||
|
|||
* `session` {EventEmitter} The current `Http2Session` instance. |
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.
You can just use {Http2Session}
here.
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.
LGTM with @TimothyGu nit.
@TimothyGu @mcollina is this better? |
doc/api/http2.md
Outdated
@@ -136,6 +136,9 @@ listener does not expect any arguments. | |||
added: v8.4.0 | |||
--> | |||
|
|||
* {Http2Session} |
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.
It's a bit unclear what this line means. If this is the first parameter of an event listener, we need to add a name to it, as the only unnamed types in docs are types of properties and returned values. If this is an event emitter, I do not think we formally state them in this way, as this is already inferred from the section place; this can baffle doctools.
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.
Umm, so should I add a name to it or skip it?
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.
If this is not a listener parameter, but an event source, I think we can skip it as this event is already a subsection of Http2Session
section.
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.
It's a parameter. Code:
process.nextTick(emit, this, 'connect', this, socket);
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.
So we need to add a name then for consistency if I am not mistaken. It seems we normally have not unnamed parameters in docs.
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.
naming it session
, in that case.
This is a single documentation change, and I believe it should be fast-forwarded. Please respond with 👍 to approve fast-forwarding this. |
CI passed! 🎉 |
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment)
Squashing. |
Re-running CI Lite. CI Lite: https://ci.nodejs.org/job/node-test-pull-request-lite/568/ |
Passed again, landing. |
Landed in 31cbec7 |
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: #20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: #20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: nodejs#20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: nodejs#20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: nodejs#20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) PR-URL: nodejs#20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event inline with the pattern in the rest of the documentation. Refs: nodejs/help#877 (comment) Backport-PR-URL: #22850 PR-URL: #20193 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Add parameters for the callback for the Http2Session:connect event
inline with the pattern in the rest of the documentation.
Refs: nodejs/help#877 (comment)
Checklist
/cc @mcollina @nodejs/http2