Skip to content

feat: adding support for Node 24 and Node 26#24

Open
erunion wants to merge 3 commits into
masterfrom
node-24-26-support
Open

feat: adding support for Node 24 and Node 26#24
erunion wants to merge 3 commits into
masterfrom
node-24-26-support

Conversation

@erunion

@erunion erunion commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Adds Node 24 (Active LTS) and Node 26 (current) support to @readme/nodegit: tests run on and prebuilds ship for Node 22, 24, and 26.

Changes

  • Swap @axosoft/nan for upstream nan@^2.28.0 via npm alias. The fork is stale at 2.22.0-gk.1; upstream nan ≥2.27.0 is required for Node 26 / V8 14.x. The alias keeps the require('@axosoft/nan') include-path lookup in the binding.gyp template working unchanged, minimizing the diff vs upstream nodegit for future merges. The fork's -gk patches are Electron/cppgc-specific and unused by this repo.
  • Fix V8 14.x removal: v8::Context::GetIsolate() no longer exists on Node 26. Replaced the Nan::GetCurrentContext()->GetIsolate() pattern with v8::Isolate::GetCurrent() at four JS-thread call sites in generate/templates/. This was the only compile fix Node 26 needed.
  • Widen engines to ^22 || ^24 || >=26 (even/LTS lines only).
  • CI matrices: tests.yml and publish.yml now run Node 22/24/26. Removed hardcoded CXXFLAGS: -std=c++17 env overrides — binding.gyp already emits the correct -std=c++<ver> per running Node (C++20 on 24/26), and the override would fight it.
  • Publish artifact merging generalized from hardcoded -node22 artifact names to a glob over all prebuild-* artifacts. ABI-tagged prebuild filenames don't collide, so all versions merge into the same platform dirs.
  • Alpine Dockerfile: node:${NODE_VERSION}-alpine3.19 has no 24/26 tags; moved to the floating -alpine tag, bumped the default from 20 to 22, and dropped the -std=c++17 portion of CXXFLAGS so the gyp-derived standard applies.
  • Docs (README, CLAUDE.md) updated to 22/24/26.

Verification (local, macOS arm64)

Clean build (rm -rf build node_modules && npm install) + full mocha suite on each version:

Node Build Tests
22.21.0 (regression) 420 passing, 12 pending, 7 failing; lint ✅
24.11.0 420 passing, 12 pending, 7 failing
26.5.0 420 passing, 12 pending, 7 failing

The 7 failures are byte-identical across all three versions and are pre-existing local-environment issues, not regressions: three require SSH test credentials (test/id_rsa is only checked in encrypted; CI decodes it) and four fail on local git default-branch config (no reference found for shorthand 'master'). CI has the SSH/git setup these need.

Before release

  • Full CI matrix green on this PR
  • Optional musl smoke test: docker build --build-arg NODE_VERSION=26 -f scripts/Dockerfile.alpine .
  • After merge: workflow_dispatch run of publish.yml and confirm find ./prebuilds shows 18 .node files (3 versions × 6 platform/libc targets) before tagging v3.3.0

🤖 Generated with Claude Code

erunion and others added 2 commits July 14, 2026 11:11
- Swap @axosoft/nan for upstream nan@^2.28.0 via npm alias (fork was
  stale at 2.22.0-gk.1; upstream 2.27+ is required for Node 26 / V8 14)
- Replace removed v8::Context::GetIsolate() with v8::Isolate::GetCurrent()
  in templates (V8 14.x removal, Node 26)
- Widen engines to ^22 || ^24 || >=26
- Expand test and publish matrices to Node 22/24/26; drop hardcoded
  -std=c++17 overrides so the gyp-derived C++ standard applies per version
- Generalize publish artifact merging across node versions
- Move Alpine Dockerfile to floating -alpine tag (no 24/26-alpine3.19 tags)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Node 24+ headers use C++20 std::source_location, which requires
clang >= 16; ubuntu 22.04 ships clang 14. Install clang 18 from
apt.llvm.org instead of moving to a newer runner image so Linux
prebuilds keep the glibc 2.35 baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@erunion erunion added the enhancement New feature or request label Jul 14, 2026
@erunion erunion changed the title Add Node 24 and Node 26 support feat: adding support for Node 24 and Node 26 Jul 14, 2026
@erunion
erunion marked this pull request as ready for review July 14, 2026 19:52
Comment thread CLAUDE.md Outdated
Co-authored-by: Dom Harrington <domharrington@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants