src: include `node_api_types.h` instead of `node_api.h` in `node.h` by addaleax · Pull Request #60496 · nodejs/node
nodejs-github-bot
added
c++
labels
Oct 30, 2025
addaleax
added
semver-major
labels
Oct 30, 2025addaleax added a commit to addaleax/node that referenced this pull request
Oct 31, 2025This 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 pushed a commit that referenced this pull request
Nov 2, 2025This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Including `node.h` should not result in all of Node-API also being available to callers. Users who want `node_api.h` contents should explicitly include that header. We currently include it specifically for `napi_addon_register_func`; by moving that into `node_api_types.h` and including that instead, we can reduce unintentionally included API surface a lot. Refs: nodejs#60345 (comment)
addaleax
marked this pull request as ready for review
addaleax added a commit that referenced this pull request
Nov 4, 2025Including `node.h` should not result in all of Node-API also being available to callers. Users who want `node_api.h` contents should explicitly include that header. We currently include it specifically for `napi_addon_register_func`; by moving that into `node_api_types.h` and including that instead, we can reduce unintentionally included API surface a lot. Refs: #60345 (comment) PR-URL: #60496 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
addaleax
deleted the
node-h-only-include-node-api-types.h
branch
aduh95 pushed a commit that referenced this pull request
Nov 5, 2025This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request
Nov 11, 2025This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request
Nov 13, 2025This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request
Feb 17, 2026This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request
Feb 19, 2026This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 pushed a commit that referenced this pull request
Feb 23, 2026This 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 <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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