Skip to content

Commit 920a4fe

Browse files
committed
zlib: convert classes to modern syntax and eol DEP0184
Convert ZlibBase, Zlib, and the remaining zlib/Brotli stream constructors to ES6 class syntax. Calling these constructors without `new` is no longer supported (DEP0184 End-of-Life); use `new` or the create* factory helpers instead. This is a semver-major change: code that relied on `zlib.Gzip()` (without `new`) will now throw TypeError. The createGzip/createDeflate/... helpers and all documented `new`-based usage remain unchanged. The wire behavior and public options are preserved. Refs: #55718 Refs: #54708 Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
1 parent f9e2fe0 commit 920a4fe

7 files changed

Lines changed: 345 additions & 373 deletions

doc/api/deprecations.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,6 +4126,9 @@ and [`crypto.setEngine()`][] all depend on this functionality from OpenSSL.
41264126

41274127
<!-- YAML
41284128
changes:
4129+
- version: REPLACEME
4130+
pr-url: https://github.com/nodejs/node/pull/64849
4131+
description: End-of-Life.
41294132
- version: v24.0.0
41304133
pr-url: https://github.com/nodejs/node/pull/55718
41314134
description: Runtime deprecation.
@@ -4136,11 +4139,12 @@ changes:
41364139
description: Documentation-only deprecation.
41374140
-->
41384141

4139-
Type: Runtime
4142+
Type: End-of-Life
41404143

4141-
Instantiating classes without the `new` qualifier exported by the `node:zlib` module is deprecated.
4142-
It is recommended to use the `new` qualifier instead. This applies to all Zlib classes, such as `Deflate`,
4143-
`DeflateRaw`, `Gunzip`, `Inflate`, `InflateRaw`, `Unzip`, and `Zlib`.
4144+
Instantiating classes without the `new` qualifier exported by the `node:zlib` module is no longer
4145+
supported. The `new` qualifier must be used instead. This applies to all Zlib classes, such as
4146+
`Deflate`, `DeflateRaw`, `Gunzip`, `Inflate`, `InflateRaw`, `Unzip`, `BrotliCompress`,
4147+
`BrotliDecompress`, `ZstdCompress`, and `ZstdDecompress`.
41444148

41454149
### DEP0185: Instantiating `node:repl` classes without `new`
41464150

0 commit comments

Comments
 (0)