Back to Tsx

Node.js research

notes/node/README.md

4.23.61.5 KB
Original Source

Node.js research

Node runtime and loader implementation references. These notes record Node behavior and version boundaries only.

Reading order

FileCovers
module-hooks.mdAsync module.register() and sync module.registerHooks()
cjs-loader.mdCommonJS resolution, cache identity, extensions, and ESM error decoration
cjs-esm-interop.mdNode's CJS-to-ESM and ESM-to-CJS interoperability
type-stripping.mdNode's native TypeScript type-stripping runtime
feature-boundaries.mdSmaller Node feature and bug-fix boundaries

Verification workflow

Version boundaries are pinned from Node git history because backports can land after the main-line commit.

text
cd /path/to/nodejs/node
git fetch --tags

# Every commit carrying a PR-URL trailer = main-line commit + all backport
# cherry-picks. Collect all release tags containing them, first per major line:
pr=59929
{ for sha in $(git log --grep "PR-URL: https://github.com/nodejs/node/pull/${pr}\$" --format=%H --all); do
    git tag --contains "$sha" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$'
  done; } | sort -u -V | awk -F. '{maj=$1} maj!=prev{print; prev=maj}'

After finding a boundary, verify the source shape with git show <tag>:<path> and cite the matching tagged GitHub URL. A PR can fix a feature after it shipped, and a backport can be narrower than the main-line implementation.