Skip to content

loader: lazy-load source map cache in CJS loader#62267

Open
gurgunday wants to merge 1 commit intonodejs:mainfrom
gurgunday:perf/lazy-load-source-map
Open

loader: lazy-load source map cache in CJS loader#62267
gurgunday wants to merge 1 commit intonodejs:mainfrom
gurgunday:perf/lazy-load-source-map

Conversation

@gurgunday
Copy link
Member

Not sure why we're not lazy loading this? Seems like a good candidate

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels Mar 15, 2026
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (8ccbe8e) to head (5001e4c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/cjs/loader.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62267      +/-   ##
==========================================
- Coverage   89.68%   89.68%   -0.01%     
==========================================
  Files         676      676              
  Lines      206495   206554      +59     
  Branches    39537    39549      +12     
==========================================
+ Hits       185204   185243      +39     
- Misses      13435    13450      +15     
- Partials     7856     7861       +5     
Files with missing lines Coverage Δ
lib/internal/modules/cjs/loader.js 98.14% <75.00%> (-0.01%) ⬇️

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

};

const { BuiltinModule } = require('internal/bootstrap/realm');
const {
Copy link
Member

Choose a reason for hiding this comment

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

Usually when you lazy load like this, there's one test that fails if this file is not included anymore in the main path.

'NativeModule internal/source_map/source_map_cache',

Did you run the tests locally? If not, try run this test and see if it fails.

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

Labels

module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants