FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Migrate NodeGit native bindings from NAN to Node-API by yumin-chen · Pull Request #9 · Chen-Software/nodegit · GitHub

Repository navigation

Migrate NodeGit native bindings from NAN to Node-API - #9

Open
yumin-chen wants to merge 6 commits into
napifrom
migrate-nodegit-to-node-api-16678422678852110768
Open

yumin-chen wants to merge 6 commits into
napifrom
migrate-nodegit-to-node-api-16678422678852110768

Conversation

Copy link
Copy Markdown

Migrated NodeGit's C++ bindings and template generator architecture from NAN (nan.h) to Node-API (node-addon-api / napi.h).

Summary of Changes:

  1. Updated generator templates in generate/templates/ and manual C++ wrappers in generate/templates/manual/ to use Node-API.
  2. Updated binding.gyp template to include node-addon-api include paths, NAPI_CPP_EXCEPTIONS, and -fexceptions flags.
  3. Updated numeric type conversions in v8_helpers.h using std::enable_if to handle 64-bit integer types without ambiguity.
  4. Refactored AsyncWorker persistent storage to use Napi::ObjectReference for JS object and callback management.
  5. Added exception handling around MakeCallback in callback templates (callback_helpers.cc, configurable_callbacks.cc).
  6. Corrected TrackerWrap list management and cleanup logic during Node.js environment teardown.

PR created automatically by Jules for task 16678422678852110768 started by @yumin-chen

yumin-chen and others added 6 commits September 18, 2026 11:55
- Update generator templates and manual C++ wrappers to use node-addon-api (napi.h).
- Configure binding.gyp to define NAPI_CPP_EXCEPTIONS and compiler flags.
- Refactor v8_helpers.h using std::enable_if for arithmetic types.
- Fix AsyncWorker persistent storage and memory lifetime management.
- Wrap MakeCallback calls in async callbacks with try/catch for Napi::Error.
- Fix TrackerWrap intrusive list unlinking and tree cleanup during environment shutdown.

Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

yumin-chen force-pushed the napi branch 5 times, most recently from f99272f to ba0e77d Compare September 21, 2026 14:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL