Performance Suggestion Checklist
Overview
Mocha right now uses glob internally for file pattern shell matching. Node.js >=22 has its own fs.glob + https://nodejs.org/api/fs.html#fspromisesglobpattern-options that we could use to remove that dependency altogether. That would make Mocha have a smaller node_modules/ install size and be more in line with what is now the first-party Node.js way to do globs.
Proposal: let's do this as part of Mocha 13? Note that it'd require dropping support for Node.js 20 as a breaking change.
Validations
I set up a basic reproduction in https://github.com/JoshuaKGoldberg/repros/tree/mocha-dependencies-with-and-without-glob. Tl;dr:
That's quite the savings!
Additional Info
See #5785 for past discussion around replacing glob. The previous suggestion was to use a much smaller glob library, i.e. tinyglobby. We'd resolved not to take on #5785 because:
tinyglobby has known missing support for some edge cases handled by glob (which partially explains why glob is larger!)
- Node.js 20 just exited LTS, so the big glob change is no longer blocked on LTS major version support (just now-non-LTS)
Performance Suggestion Checklist
faqlabel, but none matched my issue.Overview
Mocha right now uses
globinternally for file pattern shell matching. Node.js >=22 has its ownfs.glob+ https://nodejs.org/api/fs.html#fspromisesglobpattern-options that we could use to remove that dependency altogether. That would make Mocha have a smallernode_modules/install size and be more in line with what is now the first-party Node.js way to do globs.Proposal: let's do this as part of Mocha 13? Note that it'd require dropping support for Node.js 20 as a breaking change.
Validations
I set up a basic reproduction in https://github.com/JoshuaKGoldberg/repros/tree/mocha-dependencies-with-and-without-glob. Tl;dr:
That's quite the savings!
Additional Info
See #5785 for past discussion around replacing
glob. The previous suggestion was to use a much smaller glob library, i.e.tinyglobby. We'd resolved not to take on #5785 because:tinyglobbyhas known missing support for some edge cases handled byglob(which partially explains whyglobis larger!)