-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Cherrypick v0.12 doc updates #2302
Conversation
Per nodejs#4409, the documentation on http.abort is a bit lacking. This provides a slight improvement. Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
per: nodejs/node-v0.x-archive#6847 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Per: nodejs/node-v0.x-archive@b7229de The documentation for createWriteStream() references an 'encoding' property that has a default value of null. However, this property is never referenced by createWriteStream() or WritableState(). Instead a 'defaultEncoding' property is referenced in WritableState() with a default of 'utf8' if no value is supplied. This fix updates the documentation to rename the 'encoding' property to 'defaultEncoding' and indicate its default value of 'utf8'. Originally Contributed By: @chrisneave (The original patch did not apply clean)
per: nodejs/node-v0.x-archive@53b6a61 fixes nodejs/node-v0.x-archive#7230 Original commit patch did not apply cleanly Originally contributed by @sarathms
Original: nodejs/node-v0.x-archive#8682 Slightly modified version of the original PR (nodejs#8682) to add appropriate line wrapping and fix a couple of grammar nits. Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Per: nodejs/node-v0.x-archive@16f5476 Originally contributed by: @scop Original commit patch did not apply cleanly
Per: nodejs/node-v0.x-archive@5ccb429 Originally contributed by @scop Original commit patch did not apply cleanly
per: nodejs/node-v0.x-archive@59c67fe Originally contributed by @skypjack Original commit patch did not land cleanly
'the' to 'then' Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Made explicitely clear that when size bytes are not available, it will return null, unless we've ended, in which case the data remaining in the buffer will be returned. Fixes nodejs#7273 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Clarifies that emitter.listener() returns a copy, not a reference Resolves issue nodejs#9022 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
per: nodejs/node-v0.x-archive#14596 1. document that a runtime error will occur if you attempt to unshift after the end event 2. document that calling read after the end event will return null and will not trigger a runtime error Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Minor clarifications around Readable._read and Readable.push to make their implementation/usage easier to understand. nodejs/node-v0.x-archive#14124 (comment) Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Per nodejs/node-v0.x-archive#14604, Document that performing an `unshift` during a read can have unexpected results. Following the `unshift` with a `push('')` resets the reading state appropriately. Also indicate that doing an `unshift` during a read is not optimal and should be avoided. Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
per nodejs/node-v0.x-archive#14597 Indicate that `'readable'` indicates only that data can be read from the stream, not that there is actually data to be consumed. `readable.read([size])` can still return null. Includes an example that illustrates the point. Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
Per nodejs/node-v0.x-archive#25635 (comment) Additional refinement to the clarification on the `readable` event Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: nodejs/node-v0.x-archive#25591
@@ -801,6 +801,10 @@ on Unix systems, it never was. | |||
|
|||
Returns a new ReadStream object (See `Readable Stream`). | |||
|
|||
Be aware that, unlike the default value set for `highWaterMark` on a | |||
readable stream(16kb), the stream returned by this method has a |
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.
Space before paren? Also, isn't it more common (and correct) to write it as 16 kB
?
I don't really care for the typo fixes in comments but whatever. LGTM sans the two things I pointed out. |
Additional edits based on Ben's feedback
LGTM |
Just as a clarification, would you prefer that I land this as separate commits or squash them down and list each of the originals in the commit message? |
* doc: improve http.abort description * doc: mention that mode is ignored if file exists * docs: Fix default options for fs.createWriteStream() * Documentation update about Buffer initialization * doc: add a note about readable in flowing mode * doc: Document http.request protocol option * doc, comments: Grammar and spelling fixes * updated documentation for fs.createReadStream * Update child_process.markdown, spelling * doc: Clarified read method with specified size argument. * docs:events clarify emitter.listener() behavior * doc: two minor stream doc improvements * doc: clarify Readable._read and Readable.push * doc: stream.unshift does not reset reading state * doc: readable event clarification * doc: additional refinement to readable event Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noorduis <ben@strongloop.com> PR-URL: #2302
Landed in 936c9ff |
applied the new |
+1. It would be trivial to cherry pick 936c9ff onto v3.x but agreed, this one is a low priority. |
Cherrypicked commits from nodejs/node-v0.x-archive#25635
These include a handful of doc and comment fixes that landed in v0.12. Some of the commits had to be updated slightly to land.