Skip to content

fs: restore fs patchability in ESM loader#62835

Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom
joyeecheung:fs-lookup
Apr 22, 2026
Merged

fs: restore fs patchability in ESM loader#62835
nodejs-github-bot merged 1 commit intonodejs:mainfrom
joyeecheung:fs-lookup

Conversation

@joyeecheung
Copy link
Copy Markdown
Member

Temporarily restore fs patchability in ESM loader as a workaround for helping downstream projects that depend on this undocumented hidden contract transition into using hook proper APIs. This patch intentionally avoids adding a test and instead adds warning comments to hopefully steer new code away from depending on it.

Refs: #62012

Temporarily restore fs patchability in ESM loader as a workaround
for helping downstream projects that depend on this undocumented
hidden contract transition into using hook proper APIs. This patch
intentionally avoids adding a test and instead adds warning
comments to hopefully steer new code away from depending on it.
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Apr 19, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.63%. Comparing base (dfe438d) to head (79a7b4c).
⚠️ Report is 99 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62835      +/-   ##
==========================================
- Coverage   89.81%   89.63%   -0.19%     
==========================================
  Files         699      706       +7     
  Lines      216379   219148    +2769     
  Branches    41366    41981     +615     
==========================================
+ Hits       194340   196424    +2084     
- Misses      14139    14617     +478     
- Partials     7900     8107     +207     
Files with missing lines Coverage Δ
lib/internal/modules/esm/load.js 91.62% <100.00%> (+0.15%) ⬆️
lib/internal/modules/esm/resolve.js 99.04% <100.00%> (+<0.01%) ⬆️
lib/internal/modules/esm/translators.js 97.68% <100.00%> (+0.01%) ⬆️

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

@targos targos added the lts-watch-v24.x PRs that may need to be released in v24.x label Apr 20, 2026
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 20, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/modules/esm/load.js
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@joyeecheung joyeecheung added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 22, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 22, 2026
@nodejs-github-bot nodejs-github-bot merged commit 9531947 into nodejs:main Apr 22, 2026
80 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in 9531947

aduh95 pushed a commit that referenced this pull request May 5, 2026
Temporarily restore fs patchability in ESM loader as a workaround
for helping downstream projects that depend on this undocumented
hidden contract transition into using hook proper APIs. This patch
intentionally avoids adding a test and instead adds warning
comments to hopefully steer new code away from depending on it.

PR-URL: #62835
Refs: #62012
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. lts-watch-v24.x PRs that may need to be released in v24.x needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants