FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

zlib: convert classes to modern syntax and eol DEP0184 by anonrig · Pull Request #64849 · nodejs/node · GitHub

/ node Public

zlib: convert classes to modern syntax and eol DEP0184 - #64849

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
anonrig:zlib-class-syntax-eol-dep0184
Aug 14, 2026
Merged

zlib: convert classes to modern syntax and eol DEP0184#64849
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
anonrig:zlib-class-syntax-eol-dep0184

Conversation

anonrig commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

Convert the remaining node:zlib stream constructors (ZlibBase, Zlib, Deflate/Inflate/Gzip family, and Brotli) to ES6 class syntax, matching the earlier Zstd conversion.

Calling these constructors without new is End-of-Life for DEP0184. Use new or the create* factory helpers instead.

Why

DEP0184 has been a runtime deprecation since v24.0.0 (documentation-only since v22.9.0 / v20.18.0). Converting to class syntax both modernizes the implementation and hard-enforces the requirement for new.

Behavior change (semver-major)

Before After
zlib.Gzip() works with DEP0184 warning Throws TypeError
new zlib.Gzip() Unchanged
zlib.createGzip() Unchanged
Compression/decompression output Unchanged

Changes

  • lib/zlib.js: convert constructors to class / extends; drop deprecateInstantiation / ObjectSetPrototypeOf inheritance setup
  • doc/api/deprecations.md: mark DEP0184 as End-of-Life
  • Tests: require new, assert without-new throws, update subclass example to class syntax

Test plan

  • python3 tools/test.py all 65 test/parallel/test-zlib* tests — all pass
  • Smoke: gzip/brotli/zstd roundtrip with new and *Sync helpers
  • Smoke: without-new throws TypeError
  • make lint-js / make lint-md

Refs: #55718
Refs: #54708

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/userland-migrations

anonrig force-pushed the zlib-class-syntax-eol-dep0184 branch from f7c3750 to 920a4fe Compare July 30, 2026 19:11
nodejs-github-bot added needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib subsystem. labels Jul 30, 2026
anonrig force-pushed the zlib-class-syntax-eol-dep0184 branch from 920a4fe to cdbe481 Compare July 30, 2026 19:32
anonrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 30, 2026
anonrig requested review from a team, marco-ippolito and mcollina July 30, 2026 19:59
Comment thread doc/api/deprecations.md
Instantiating classes without the `new` qualifier exported by the `node:zlib` module is deprecated.
It is recommended to use the `new` qualifier instead. This applies to all Zlib classes, such as `Deflate`,
`DeflateRaw`, `Gunzip`, `Inflate`, `InflateRaw`, `Unzip`, and `Zlib`.
Instantiating classes without the `new` qualifier exported by the `node:zlib` module is no longer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

can we have small before/after code example

codecov Bot commented Jul 30, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.45161% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.31%. Comparing base (f914e45) to head (45769b6).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
lib/zlib.js 96.45% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64849      +/-   ##
==========================================
- Coverage   92.07%   90.31%   -1.76%     
==========================================
  Files         399      751     +352     
  Lines      177007   249738   +72731     
  Branches    27381    47158   +19777     
==========================================
+ Hits       162978   225557   +62579     
- Misses      13716    15582    +1866     
- Partials      313     8599    +8286     
Files with missing lines Coverage Δ
lib/zlib.js 98.14% <96.45%> (-0.07%) ⬇️

... and 483 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Renegade334 added the deprecations Issues and PRs related to deprecations. label Jul 30, 2026

anonrig commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

cc @nodejs/tsc this is a semver-major change and requires more TSC reviews

anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 31, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 31, 2026

Copy link
Copy Markdown
Collaborator

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

This would make backporting really hard, I'm not sure this is worth it, but ok.

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: nodejs#55718
Refs: nodejs#54708
Assisted-by: Grok
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
anonrig force-pushed the zlib-class-syntax-eol-dep0184 branch from cdbe481 to 45769b6 Compare August 13, 2026 18:43

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

anonrig added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 13, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 13, 2026

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2026
nodejs-github-bot merged commit 967d4af into nodejs:main Aug 14, 2026
84 of 85 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 967d4af

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. deprecations Issues and PRs related to deprecations. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. zlib Issues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL