node icon indicating copy to clipboard operation
node copied to clipboard

module: cache synchronous module jobs before linking

Open joyeecheung opened this issue 9 months ago • 4 comments

test: add common.expectRequiredModule()

To minimize changes if/when we change the layout of the result returned by require(esm).

module: cache synchronous module jobs before linking

So that if there are circular dependencies in the synchronous module graph, they could be resolved using the cached jobs. In case linking fails and the error gets caught, reset the cache right after linking. If it succeeds, the caller will cache it again. Otherwise the error bubbles up to users, and since we unset the cache for the unlinkable module the next attempt would still fail.

Fixes: https://github.com/nodejs/node/issues/52864

joyeecheung avatar May 07 '24 00:05 joyeecheung

Review requested:

  • [ ] @nodejs/loaders

nodejs-github-bot avatar May 07 '24 00:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/58996/

nodejs-github-bot avatar May 07 '24 00:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59018/

nodejs-github-bot avatar May 07 '24 20:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59020/

nodejs-github-bot avatar May 07 '24 21:05 nodejs-github-bot

Landed in 1291d3d5c406ffc3d85820f14cda662d4b495a38...2863c5425734d404101c190d53b66f7c475c42e3

nodejs-github-bot avatar May 09 '24 00:05 nodejs-github-bot