Skip to content

src: include node_api_types.h instead of node_api.h in node.h#60496

Closed
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:node-h-only-include-node-api-types.h
Closed

src: include node_api_types.h instead of node_api.h in node.h#60496
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:node-h-only-include-node-api-types.h

Conversation

@addaleax

@addaleax addaleax commented Oct 30, 2025

Copy link
Copy Markdown
Member

Edit: Split out #60512 from this PR and marking this PR as blocked on it

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: #60345 (comment)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants