Skip to content

Commit ec514a6

Browse files
ronagtargos
authored andcommitted
doc: deprecate http finished
PR-URL: #28679 Refs: #28651 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 2bb364a commit ec514a6

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

doc/api/deprecations.md

+25
Original file line numberDiff line numberDiff line change
@@ -2521,6 +2521,27 @@ Type: Documentation-only (supports [`--pending-deprecation`][])
25212521
The `process._tickCallback` property was never documented as
25222522
an officially supported API.
25232523
2524+
<a id="DEP0136"></a>
2525+
### DEP0136: `http` `finished`
2526+
<!-- YAML
2527+
changes:
2528+
- version: REPLACEME
2529+
pr-url: https://github.com/nodejs/node/pull/28679
2530+
description: Documentation-only deprecation.
2531+
-->
2532+
2533+
Type: Documentation-only
2534+
2535+
[`response.finished`][] indicates whether [`response.end()`][] has been
2536+
called, not whether `'finish'` has been emitted and the underlying data
2537+
is flushed.
2538+
2539+
Use [`response.writableFinished`][] or [`response.writableEnded`][]
2540+
accordingly instead to avoid the ambigiuty.
2541+
2542+
To maintain existing behaviour `response.finished` should be replaced with
2543+
`response.writableEnded`.
2544+
25242545
[`--http-parser=legacy`]: cli.html#cli_http_parser_library
25252546
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
25262547
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
@@ -2580,6 +2601,10 @@ an officially supported API.
25802601
[`request.connection`]: http.html#http_request_connection
25812602
[`response.socket`]: http.html#http_response_socket
25822603
[`response.connection`]: http.html#http_response_connection
2604+
[`response.end()`]: http.html#http_response_end_data_encoding_callback
2605+
[`response.finished`]: #http_response_finished
2606+
[`response.writableFinished`]: #http_response_writablefinished
2607+
[`response.writableEnded`]: #http_response_writableended
25832608
[`script.createCachedData()`]: vm.html#vm_script_createcacheddata
25842609
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args
25852610
[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args

doc/api/http.md

+8
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,11 @@ is finished.
620620
### `request.finished`
621621
<!-- YAML
622622
added: v0.0.1
623+
deprecated: REPLACEME
623624
-->
624625

626+
> Stability: 0 - Deprecated. Use [`request.writableEnded`][].
627+
625628
* {boolean}
626629

627630
The `request.finished` property will be `true` if [`request.end()`][]
@@ -1297,8 +1300,11 @@ is finished.
12971300
### `response.finished`
12981301
<!-- YAML
12991302
added: v0.0.2
1303+
deprecated: REPLACEME
13001304
-->
13011305

1306+
> Stability: 0 - Deprecated. Use [`response.writableEnded`][].
1307+
13021308
* {boolean}
13031309

13041310
The `response.finished` property will be `true` if [`response.end()`][]
@@ -2353,12 +2359,14 @@ not abort the request or do anything besides add a `'timeout'` event.
23532359
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
23542360
[`request.socket`]: #http_request_socket
23552361
[`request.writableFinished`]: #http_request_writablefinished
2362+
[`request.writableEnded`]: #http_request_writableended
23562363
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback
23572364
[`response.end()`]: #http_response_end_data_encoding_callback
23582365
[`response.getHeader()`]: #http_response_getheader_name
23592366
[`response.setHeader()`]: #http_response_setheader_name_value
23602367
[`response.socket`]: #http_response_socket
23612368
[`response.writableFinished`]: #http_response_writablefinished
2369+
[`response.writableEnded`]: #http_response_writableended
23622370
[`response.write()`]: #http_response_write_chunk_encoding_callback
23632371
[`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback
23642372
[`response.writeContinue()`]: #http_response_writecontinue

doc/api/http2.md

+4
Original file line numberDiff line numberDiff line change
@@ -3091,8 +3091,11 @@ is finished.
30913091
#### `response.finished`
30923092
<!-- YAML
30933093
added: v8.4.0
3094+
deprecated: REPLACEME
30943095
-->
30953096

3097+
> Stability: 0 - Deprecated. Use [`response.writableEnded`][].
3098+
30963099
* {boolean}
30973100

30983101
Boolean value that indicates whether the response has completed. Starts
@@ -3576,6 +3579,7 @@ following additional properties:
35763579
[`response.end()`]: #http2_response_end_data_encoding_callback
35773580
[`response.setHeader()`]: #http2_response_setheader_name_value
35783581
[`response.socket`]: #http2_response_socket
3582+
[`response.writableEnded`]: #http2_response_writableended
35793583
[`response.write()`]: #http2_response_write_chunk_encoding_callback
35803584
[`response.write(data, encoding)`]: http.html#http_response_write_chunk_encoding_callback
35813585
[`response.writeContinue()`]: #http2_response_writecontinue

0 commit comments

Comments
 (0)