-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
perf: use node:
prefix to bypass require.cache call for builtins
#14515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Is there some eslint rule we can use which forces (and autofixes) this? |
Type error will probably be fixed by updating from node 14 types to node 16 (which will be done for Jest 30 - I'll start landing breaking changes next week) |
Probably something that should be rolled into https://github.com/eslint-community/eslint-plugin-n, are you happy for me to add the unicorn plugin in in the meantime with that rule enabled? |
I've landed the Lots of test failures here. Also, we have some tests that explicitly use one or the other to ensure Jest's own resolver handles both correctly. So in some files we'll need to disable the rule |
Cheers @SimenB, should be able to revisit this in the next few days. |
Great, thank you! |
@SimenB could you point me to a file that does this as an example, please? |
Might be it just matters here jest/e2e/native-esm/__tests__/native-esm.test.js Lines 8 to 15 in 6d2632a
I doubt unit tests of You might hit #14297 tho |
Going to be doing this piecemeal, package-by-package, just so I don't miss anything, so apologies in advance! |
No need to apologise! I'm super grateful you're taking the time to do this 🙂 |
New version of |
Yeah, it might make sense to fix that before changing our own references... |
fair 😀 |
Disappearing for a bit and probably won't be back until Feb next year. This will no doubt be mighty out of date by then so thought i'd just nuke it and return to it when I can. |
Enjoy your time off! 😃 I genuinely meant that it's fair to abandon this - it's very chore-y and onerous 🙂 I realize it might've come off as sarcastic 😅 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Introduced as part of v16.0.0 and v14.18.0, this allows redundant
require.cache
calls to be bypassed for builtin modules, saving a few yoctoseconds.See https://nodejs.org/api/modules.html#core-modules and discussion in nodejs/node repo regarding why
require.cache
calls are redundant for builtins.Test plan
N/A