Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dbabdf751c66eec1032c9b0f10041ee89ad1b457
Choose a base ref
...
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5065a0acb34a3f69607ac072b7806ca26a854653
Choose a head ref
  • 7 commits
  • 66 files changed
  • 3 contributors

Commits on Apr 27, 2026

  1. esm: populate separate cache for require(esm) in imported CJS

    Otherwise if the ESM happens to be cached separately by the ESM loader
    before it gets loaded with `require(esm)` from within an imported
    CJS file (which uses a re-invented require() with a couple of quirks,
    including a separate cache), it won't be able to load the esm properly
    from the cache.
    
    PR-URL: #59679
    Backport-PR-URL: #62029
    Refs: #59666
    Refs: #52697
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    1769d74 View commit details
    Browse the repository at this point in the history
  2. module: only put directly require-d ESM into require.cache

    This reduces the impact of
    https://redirect.github.com/nodejs/node/pull/59679
    by delaying the require.cache population of ESM until they
    are directly required. After that, it's necessary for them
    to be in the cache to maintain correctness.
    
    PR-URL: #59874
    Backport-PR-URL: #62029
    Refs: #59868
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    12a2462 View commit details
    Browse the repository at this point in the history
  3. module: use sync cjs when importing cts

    PR-URL: #60072
    Backport-PR-URL: #62029
    Fixes: #59963
    Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    Fixes: #61801
    marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    39147c1 View commit details
    Browse the repository at this point in the history
  4. module: handle null source from async loader hooks in sync hooks

    This relaxes the validation in sync hooks so that it accepts
    the quirky nullish source returned by the default step of the
    async loader when the module being loaded is CommonJS.
    When there are no customization hooks registered, a saner
    synchronous default load step is used to use a property
    instead of a reset nullish source to signify that the module
    should go through the CJS monkey patching routes and reduce
    excessive reloading from disk.
    
    PR-URL: #59929
    Backport-PR-URL: #62029
    Fixes: #59384
    Fixes: #57327
    Refs: #59666
    Refs: https://github.com/dygabo/load_module_test
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    Reviewed-By: Jacob Smith <jacob@frende.me>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    2e91b28 View commit details
    Browse the repository at this point in the history
  5. module: fix sync resolve hooks for require with node: prefixes

    Previously, when require()-ing builtins with the node: prefix,
    the sync resolve hooks were not properly invoked, and load hooks
    could not override the builtin's format. This fixes the
    handling and enables redirecting prefixed built-ins to on-disk
    files and overriding them with other module types via hooks.
    
    PR-URL: #61088
    Backport-PR-URL: #62029
    Fixes: #60005
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    b9240bc View commit details
    Browse the repository at this point in the history
  6. module: do not wrap module._load when tracing is not enabled

    This prevents clobbering the stack traces with another internal
    frame and removes the unnecessary hoops from step-debugging.
    
    PR-URL: #61479
    Backport-PR-URL: #62029
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    9a2e213 View commit details
    Browse the repository at this point in the history
  7. module: do not invoke resolve hooks twice for imported cjs

    Previously the resolve hook can be invoked twice from the
    synthetic module evaluation step of imported CJS in the extra
    module._load() call that's invoked on the resolved full path.
    Add an option to avoid it, since the resolution and loading
    has already been done before.
    
    PR-URL: #61529
    Backport-PR-URL: #62029
    Fixes: #57125
    Refs: #55808
    Refs: #56241
    Reviewed-By: Jacob Smith <jacob@frende.me>
    Fixes: #61801
    joyeecheung authored and marco-ippolito committed Apr 27, 2026
    Configuration menu
    Copy the full SHA
    5065a0a View commit details
    Browse the repository at this point in the history
Loading