Skip to content

fs: move DEP0180 to End-of-Life - #67491

Open
jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:fs-eol-dep0180
Open

jasnell wants to merge 3 commits into
nodejs:mainfrom
jasnell:fs-eol-dep0180

Conversation

@jasnell

@jasnell jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member

Calling the fs.Stats constructor directly, with or without new, now throws ERR_ILLEGAL_CONSTRUCTOR. fs.Stats instances are only created internally.

The class remains exported from node:fs so that instanceof checks continue to work. Internally, instances are constructed through a private symbol.

This has been a runtime deprecation since v22.0.0.

Refs: #52067
Refs: #51879

@jasnell
jasnell requested a review from a team November 15, 2026 16:46
@jasnell jasnell added semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels Nov 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/userland-migrations

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Nov 15, 2026
Comment thread doc/api/deprecations.md Resolved
Comment thread doc/api/fs.md Resolved
@jasnell jasnell added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Nov 15, 2026
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.59%. Comparing base (f2eea74) to head (0fff732).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67491      +/-   ##
==========================================
- Coverage   93.01%   90.59%   -2.42%     
==========================================
  Files         432      802     +370     
  Lines      201247   287036   +85789     
  Branches    30737    55456   +24719     
==========================================
+ Hits       187183   260045   +72862     
- Misses      13736    17068    +3332     
- Partials      328     9923    +9595     
Files with missing lines Coverage Δ
lib/internal/fs/utils.js 98.04% <100.00%> (+7.10%) ⬆️

... and 506 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.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

@jasnell

jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@nodejs/tsc ... will need another sign off here

@mcollina 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.

lgtm

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 15, 2026

@LiviaMedeiros LiviaMedeiros 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.

I think this shouldn't land until we have better alternative (e.g. fs.isStats()) to instanceof Stats that we can recommend in the docs, or make such instanceof work with BigIntStats as well.

Comment thread doc/api/deprecations.md Resolved
@LiviaMedeiros LiviaMedeiros removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 18, 2026
@jasnell

jasnell commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Ok, for now just going to close then given the comments from @LiviaMedeiros

@LiviaMedeiros

Copy link
Copy Markdown
Member

Now that Stats.isStats() is available, this can be reopened.

@LiviaMedeiros LiviaMedeiros reopened this Dec 6, 2026
Calling the fs.Stats constructor directly, with or without new, now
throws ERR_ILLEGAL_CONSTRUCTOR. fs.Stats instances are only created
internally.

The class remains exported from node:fs so that instanceof checks
continue to work. Internally, instances are constructed through a
private symbol.

This has been a runtime deprecation since v22.0.0.

Refs: nodejs#52067
Refs: nodejs#51879
Assisted-by: Claude
Signed-off-by: James M Snell <jasnell@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Assisted-by: Claude Code
@jasnell

jasnell commented Dec 6, 2026

Copy link
Copy Markdown
Member Author

@mcollina @anonrig ... rebased with @LiviaMedeiros' suggestions applied. PTAL

@gurgunday gurgunday 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.

Lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash PRs the Commit Queue should land as one squashed commit. deprecations Issues and PRs related to deprecations. fs Issues and PRs related to file-system APIs and the fs module. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants