Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7d2bc52

Browse filesBrowse files
committed
src: include node_api_types.h instead of node_api.h in node.h
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) 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>
1 parent 36c082b commit 7d2bc52
Copy full SHA for 7d2bc52

1 file changed

+2-1Lines changed: 2 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#include "v8-platform.h" // NOLINT(build/include_order)
7777
#include "node_version.h" // NODE_MODULE_VERSION
7878

79-
#include "node_api.h"
79+
#include "node_api_types.h" // napi_addon_register_func
8080

8181
#include <functional>
8282
#include <memory>
@@ -124,6 +124,7 @@
124124

125125
// Forward-declare libuv loop
126126
struct uv_loop_s;
127+
struct napi_module;
127128

128129
// Forward-declare these functions now to stop MSVS from becoming
129130
// terminally confused when it's done in node_internals.h

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.