Skip to content

Conversation

@addaleax
Copy link
Member

src: move Node-API version detection to where it is used

src/js_native_api_types.h and other files actually depend on
the moved macros being evaluated, so before this change there
was an implicit requirement that src/js_native_api.h would be
included separately before any include of
src/js_native_api_types.h, direct or transitive.

src: move napi_addon_register_func to node_api_types.h

This means that node.h can include only this file, instead of
the entirety of node_api.h.

Split out from #60496 since
it was rightfully pointed out that the breaking part of the change
should not touch Node-API headers.

`src/js_native_api_types.h` and other files actually depend on
the moved macros being evaluated, so before this change there
was an implicit requirement that `src/js_native_api.h` would be
included separately before any include of
`src/js_native_api_types.h`, direct or transitive.
This means that `node.h` can include only this file, instead of
the entirety of `node_api.h`.

Split out from nodejs#60496 since
it was rightfully pointed out that the breaking part of the change
should not touch Node-API headers.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/node-api

@addaleax addaleax added the node-api Issues and PRs related to the Node-API. label Oct 31, 2025
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Oct 31, 2025
@addaleax addaleax requested a review from legendecas October 31, 2025 14:09
@addaleax addaleax added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Oct 31, 2025
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.56%. Comparing base (684c3b3) to head (ee3fb63).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #60512   +/-   ##
=======================================
  Coverage   88.56%   88.56%           
=======================================
  Files         704      704           
  Lines      207858   207858           
  Branches    40058    40053    -5     
=======================================
  Hits       184089   184089           
+ Misses      15807    15803    -4     
- Partials     7962     7966    +4     

see 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 31, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2025
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 2, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 2, 2025
@nodejs-github-bot
Copy link
Collaborator

Landed in 8f66bec...85ee01c

nodejs-github-bot pushed a commit that referenced this pull request Nov 2, 2025
`src/js_native_api_types.h` and other files actually depend on
the moved macros being evaluated, so before this change there
was an implicit requirement that `src/js_native_api.h` would be
included separately before any include of
`src/js_native_api_types.h`, direct or transitive.

PR-URL: #60512
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Nov 2, 2025
This means that `node.h` can include only this file, instead of
the entirety of `node_api.h`.

Split out from #60496 since
it was rightfully pointed out that the breaking part of the change
should not touch Node-API headers.

PR-URL: #60512
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@github-project-automation github-project-automation bot moved this from Need Triage to Done in Node-API Team Project Nov 2, 2025
aduh95 pushed a commit that referenced this pull request Nov 5, 2025
`src/js_native_api_types.h` and other files actually depend on
the moved macros being evaluated, so before this change there
was an implicit requirement that `src/js_native_api.h` would be
included separately before any include of
`src/js_native_api_types.h`, direct or transitive.

PR-URL: #60512
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 5, 2025
This means that `node.h` can include only this file, instead of
the entirety of `node_api.h`.

Split out from #60496 since
it was rightfully pointed out that the breaking part of the change
should not touch Node-API headers.

PR-URL: #60512
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. node-api Issues and PRs related to the Node-API.

Projects

Development

Successfully merging this pull request may close these issues.

5 participants