Skip to content

src: officially deprecate node::ObjectWrap#63756

Closed
addaleax wants to merge 3 commits into
nodejs:mainfrom
addaleax:deprecate-object-wrap
Closed

src: officially deprecate node::ObjectWrap#63756
addaleax wants to merge 3 commits into
nodejs:mainfrom
addaleax:deprecate-object-wrap

Conversation

@addaleax

@addaleax addaleax commented Jun 5, 2026

Copy link
Copy Markdown
Member

This interface has long been unmaintained and doesn't match current best practices for C++ object management.

It's also simply not a good idea to have this header be part of Node.js core; since it is an inline header, user code will depend on the Node.js version it was compiled with, and there is no way to adopt changes to this header independently of changing the target Node.js version.

Better userland alternatives exist and have long been more popular, notably, node-addon-api and, for use cases where direct V8 API access is required, nan.

@addaleax addaleax added semver-major PRs that contain breaking changes and should be released in the next major version. addons Issues and PRs related to native addons. labels Jun 5, 2026
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jun 5, 2026
@addaleax addaleax added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Jun 5, 2026
@Renegade334

Copy link
Copy Markdown
Member

Note that this class is mentioned extensively in addons.md, so this probably needs an edit.

addaleax added 3 commits June 10, 2026 15:51
This interface has long been unmaintained and doesn't
match current best practices for C++ object management.

It's also simply not a good idea to have this header be
part of Node.js core; since it is an inline header, user
code will depend on the Node.js version it was compiled with,
and there is no way to adopt changes to this header
independently of changing the target Node.js version.

Better userland alternatives exist and have long been
more popular, notably, `node-addon-api` and, for use cases
where direct V8 API access is required, `nan`.

Signed-off-by: Anna Henningsen <anna@addaleax.net>
@addaleax addaleax force-pushed the deprecate-object-wrap branch from f19268a to 450d97a Compare June 10, 2026 15:33
@addaleax

Copy link
Copy Markdown
Member Author

@Renegade334 Thanks for pointing this out! Can't really believe we seriously recommended this 🙃

I've added changes to account for this in 450d97a – went back and forth on the approach a bit, but ultimately decided that it would be most helpful to just include a trimmed-down copy of the class in our docs.

@ronag @legendecas You may want to re-review this since there's a fairly large addition now compared to the original change

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 12, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 13, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleax addaleax added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 13, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 13, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in d097de8...fc28d94

nodejs-github-bot pushed a commit that referenced this pull request Jun 13, 2026
This interface has long been unmaintained and doesn't
match current best practices for C++ object management.

It's also simply not a good idea to have this header be
part of Node.js core; since it is an inline header, user
code will depend on the Node.js version it was compiled with,
and there is no way to adopt changes to this header
independently of changing the target Node.js version.

Better userland alternatives exist and have long been
more popular, notably, `node-addon-api` and, for use cases
where direct V8 API access is required, `nan`.

Signed-off-by: Anna Henningsen <anna@addaleax.net>
PR-URL: #63756
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addons Issues and PRs related to native addons. 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. 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