From 939287734f1471211d1bfef423b4df7912492463 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 25 Apr 2020 21:16:51 +0200 Subject: [PATCH 1/5] doc: document major finished changes in v14 Added description of semver-major changes to finished in v14. --- doc/api/stream.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 4f155512ac4750..b234ad772eceb3 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1503,6 +1503,21 @@ further errors except from `_destroy` may be emitted as `'error'`. ### `stream.finished(stream[, options], callback)` * `stream` {Stream} A readable and/or writable stream. @@ -1580,6 +1595,16 @@ changes: - version: v13.10.0 pr-url: https://github.com/nodejs/node/pull/31223 description: Add support for async generators. + - version: v14.0.0 + pr-url: https://github.com/nodejs/node/pull/32158 + description: `pipeline(..., cb)` will wait for the `'close'` event + before invoking the callback. The implementation tries to detect legacy + streams and only apply this behavior to streams which are expected + to emit `'close'`. + - version: v14.0.0 + pr-url: https://github.com/nodejs/node/pull/31545 + description: Emitting `'close'` before `'end'` on a `Readable` stream + will cause an `ERR_STREAM_PREMATURE_CLOSE` error. --> * `source` {Stream|Iterable|AsyncIterable|Function} From ba8cfb66517bb8bc124b7a063461514b052768fe Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 25 Apr 2020 22:32:59 +0200 Subject: [PATCH 2/5] fixup: premature close does not apply to pipeline due to compat workaround --- doc/api/stream.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index b234ad772eceb3..a7d6dd3359620f 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1601,10 +1601,6 @@ changes: before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`. - - version: v14.0.0 - pr-url: https://github.com/nodejs/node/pull/31545 - description: Emitting `'close'` before `'end'` on a `Readable` stream - will cause an `ERR_STREAM_PREMATURE_CLOSE` error. --> * `source` {Stream|Iterable|AsyncIterable|Function} From fea09242c017676e473bf4579075d4850e820a4c Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 27 Apr 2020 09:29:09 +0200 Subject: [PATCH 3/5] fixup: formatting --- doc/api/stream.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index a7d6dd3359620f..2195ffd3271bf0 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1507,17 +1507,17 @@ changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 description: `finished(stream, cb)` will wait for the `'close'` event - before invoking the callback. The implementation tries to detect legacy - streams and only apply this behavior to streams which are expected - to emit `'close'`. + before invoking the callback. The implementation tries to + detect legacy streams and only apply this behavior to streams + which are expected to emit `'close'`. - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/31545 description: Emitting `'close'` before `'end'` on a `Readable` stream - will cause an `ERR_STREAM_PREMATURE_CLOSE` error. + will cause an `ERR_STREAM_PREMATURE_CLOSE` error. - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/31509 description: Callback will be invoked on streams which have already - finished before the call to `finished(stream, cb)`. + finished before the call to `finished(stream, cb)`. --> * `stream` {Stream} A readable and/or writable stream. @@ -1598,9 +1598,9 @@ changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 description: `pipeline(..., cb)` will wait for the `'close'` event - before invoking the callback. The implementation tries to detect legacy - streams and only apply this behavior to streams which are expected - to emit `'close'`. + before invoking the callback. The implementation tries to + detect legacy streams and only apply this behavior to streams + which are expected to emit `'close'`. --> * `source` {Stream|Iterable|AsyncIterable|Function} From 644278acb048877b8f5e8448272e920ad88ced69 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 27 Apr 2020 09:57:41 +0200 Subject: [PATCH 4/5] fixup: indent --- doc/api/stream.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 2195ffd3271bf0..0c46931c85d929 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1507,9 +1507,9 @@ changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 description: `finished(stream, cb)` will wait for the `'close'` event - before invoking the callback. The implementation tries to - detect legacy streams and only apply this behavior to streams - which are expected to emit `'close'`. + before invoking the callback. The implementation tries to + detect legacy streams and only apply this behavior to streams + which are expected to emit `'close'`. - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/31545 description: Emitting `'close'` before `'end'` on a `Readable` stream @@ -1598,9 +1598,9 @@ changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 description: `pipeline(..., cb)` will wait for the `'close'` event - before invoking the callback. The implementation tries to - detect legacy streams and only apply this behavior to streams - which are expected to emit `'close'`. + before invoking the callback. The implementation tries to + detect legacy streams and only apply this behavior to streams + which are expected to emit `'close'`. --> * `source` {Stream|Iterable|AsyncIterable|Function} From b4eea453518846809c27739a36948a7aafec77d5 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 27 Apr 2020 16:45:34 +0200 Subject: [PATCH 5/5] fixup: linting --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 0c46931c85d929..0f89b77bc35782 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1506,7 +1506,7 @@ added: v10.0.0 changes: - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 - description: `finished(stream, cb)` will wait for the `'close'` event + description: The `finished(stream, cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`. @@ -1597,7 +1597,7 @@ changes: description: Add support for async generators. - version: v14.0.0 pr-url: https://github.com/nodejs/node/pull/32158 - description: `pipeline(..., cb)` will wait for the `'close'` event + description: The `pipeline(..., cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`.