GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — n-api: restrict exports by version by kfarnung · Pull Request #19962 · nodejs/node

Conversation

@kfarnung

@kfarnung kfarnung commented Apr 12, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Move napi_get_uv_event_loop into the NAPI_VERSION >= 2 section
  • Move napi_open_callback_scope, napi_close_callback_scope,
    napi_fatal_exception, napi_add_env_cleanup_hook, and
    napi_remove_env_cleanup_hook into the NAPI_VERSION >= 3 section
  • Added a missing added property to napi_get_uv_event_loop in the
    docs
  • Added a napiVersion property to the docs and updated the parser and
    generator to use it.
  • Added usage documentation
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kfarnung kfarnung self-assigned this Apr 12, 2018
@kfarnung
kfarnung requested review from addaleax and mhdawson April 12, 2018 01:11
@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 involving general changes in the lib/ or src/ directories. labels Apr 12, 2018
@kfarnung kfarnung mentioned this pull request Apr 12, 2018
Enforce NAPI version in module headers nodejs/abi-stable-node#286
Closed
@kfarnung kfarnung added doc Issues and PRs related to Node.js documentation. node-api Issues and PRs related to Node-API. labels Apr 12, 2018
@kfarnung

kfarnung commented Apr 12, 2018

Copy link
Copy Markdown
Contributor Author

An example of what the doc update looks like:

napiver

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devsnek

devsnek commented Apr 12, 2018

Copy link
Copy Markdown
Member

can we just call it napi_version

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Apr 12, 2018

Copy link
Copy Markdown
Contributor Author

I updated it to napiVersion, but I'm open to further feedback.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Apr 12, 2018

Copy link
Copy Markdown
Contributor Author

Note to self: Add a versioning section to the docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson

mhdawson commented Apr 12, 2018

Copy link
Copy Markdown
Member

Discussed a bit in the N-API meeting today, Kyle will do a few refinements and then we'll review in detail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Apr 21, 2018

Copy link
Copy Markdown
Member

What’s the motivation for restricting exports?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Apr 21, 2018

Copy link
Copy Markdown
Contributor Author

The idea is that an embedder can declare the version of N-API they want to target and trying to use any newer APIs would result in a build break.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

devsnek
devsnek reviewed Apr 21, 2018
View reviewed changes
Comment thread src/node_api.h Outdated

@devsnek devsnek Apr 21, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with our styles i think this should be

#ifndef NAPI_VERSION
#define NAPI_VERSION 2
#endif  // NAPI_VERSION

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kfarnung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@kfarnung

kfarnung commented Apr 24, 2018

Copy link
Copy Markdown
Contributor Author

@mhdawson I bumped the default NAPI_VERSION to 3 since v10.0.0 is coming out soon and we're in the process of backporting the version 3 changes anyway.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson

mhdawson commented Apr 24, 2018

Copy link
Copy Markdown
Member

The changes look good but I think we discussed adding a section to the doc which explains how the to use the define etc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Apr 24, 2018

Copy link
Copy Markdown
Contributor Author

Yeah, sorry about that, I haven't had a chance to flesh that out yet. Now that 10.0.0 is out I should have a little more time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung
kfarnung force-pushed the napiver branch 3 times, most recently from 2902039 to 3ce6459 Compare May 4, 2018 01:00
@BridgeAR

BridgeAR commented May 15, 2018

Copy link
Copy Markdown
Member

Ping @kfarnung

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung
kfarnung force-pushed the napiver branch from 3ce6459 to c0ab388 Compare May 15, 2018 17:37
@kfarnung

kfarnung commented May 15, 2018

Copy link
Copy Markdown
Contributor Author

I rebased the changes (pending a build/test locally), I believe I have addressed @mhdawson's comments as well.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented May 15, 2018

Copy link
Copy Markdown
Contributor Author

Ping @nodejs/n-api

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson

mhdawson commented May 29, 2018

Copy link
Copy Markdown
Member

@kfarnung I think the one thing we discussed addint to this since you updated was the concept of EXPERIMENTAL that we could use to manage the flow of new functions into N-API.

kfarnung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson mhdawson mentioned this pull request May 29, 2018
n-api: add API for asynchronous functions (simpler version) #17887
Closed
4 tasks done
@kfarnung

kfarnung commented May 29, 2018

Copy link
Copy Markdown
Contributor Author

That change is on my backlog, I've just been busy with other stuff. I'm hoping to get to that before the N-API meeting on Thursday.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gabrielschulhof
gabrielschulhof approved these changes May 31, 2018
View reviewed changes

@gabrielschulhof gabrielschulhof left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kfarnung
kfarnung force-pushed the napiver branch from 36380aa to 292a6ed Compare June 28, 2018 19:49
@kfarnung

kfarnung commented Jun 28, 2018

Copy link
Copy Markdown
Contributor Author

Rebased and squashed: https://ci.nodejs.org/job/node-test-pull-request/15657/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Jun 29, 2018

Copy link
Copy Markdown
Contributor Author

One more: https://ci.nodejs.org/job/node-test-pull-request/15659/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mhdawson
mhdawson reviewed Jun 29, 2018
View reviewed changes
Comment thread src/node_api.h Outdated

@mhdawson mhdawson Jun 29, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe fatal_exception is part of NAPI_VERSION 3, it is already exposed in 6.x

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhdawson
mhdawson reviewed Jun 29, 2018
View reviewed changes
Comment thread src/node_api.h Outdated

@mhdawson mhdawson Jun 29, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 are already in 10.x but not in 6.x so we probably missed bumping the NAPI_VERSION when they went out.

If we leave as experimental like this PR does we risk breaking somebody, but the same goes if we add a guard for NAPI_VERSION 4. I think we'll need to figure out who added them and figure out what makes the most sense. I do think getting this PR landed would be good though, so maybe just leave them in the regular set (ie non-experimental) for this PR ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kfarnung kfarnung Jun 29, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax What do you think the best approach is? I've moved them to NAPI_VERSION 3 for now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhdawson
mhdawson reviewed Jun 29, 2018
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once napi_fatal_exception is moved under version 3, and napi_add_env_cleanup_hook and napi_remove_env_cleanup_hook are moved out of experimental

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kfarnung
kfarnung force-pushed the napiver branch 2 times, most recently from 86b0958 to fa003a3 Compare June 29, 2018 22:22
@kfarnung

kfarnung commented Jun 29, 2018

Copy link
Copy Markdown
Contributor Author

Rebased: https://ci.nodejs.org/job/node-test-pull-request/15677/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Jul 3, 2018

Copy link
Copy Markdown
Contributor Author

One more CI: https://ci.nodejs.org/job/node-test-pull-request/15711/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung

kfarnung commented Jul 3, 2018

Copy link
Copy Markdown
Contributor Author

@mhdawson Any other issues? I'm hoping to land this today, if possible

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mhdawson
mhdawson approved these changes Jul 4, 2018
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mhdawson

mhdawson commented Jul 4, 2018

Copy link
Copy Markdown
Member

@kfarnung agreeing we should land, as would like this in place so we can make sure all future API are added as experimental. Can you take the action to follow up on napi_add_env_cleanup_hook/napi_remove_env_cleanup_hook to see if we can move out to NAPI_VERSION 4.x without breaking people?

kfarnung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kfarnung added a commit that referenced this pull request Jul 5, 2018
@kfarnung
n-api: restrict exports by version
8476053
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section
* Move `napi_open_callback_scope`, `napi_close_callback_scope`,
  `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and
  `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section
* Added a missing `added` property to `napi_get_uv_event_loop` in the
  docs
* Added a `napiVersion` property to the docs and updated the parser and
  generator to use it.
* Added usage documentation

PR-URL: #19962
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@kfarnung kfarnung closed this Jul 5, 2018
@kfarnung
kfarnung force-pushed the napiver branch from fa003a3 to 8476053 Compare July 5, 2018 17:42
@kfarnung

kfarnung commented Jul 5, 2018

Copy link
Copy Markdown
Contributor Author

Landed in 8476053

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kfarnung
kfarnung deleted the napiver branch July 5, 2018 17:42
targos pushed a commit that referenced this pull request Jul 6, 2018
@kfarnung @targos
n-api: restrict exports by version
cec166e
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section
* Move `napi_open_callback_scope`, `napi_close_callback_scope`,
  `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and
  `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section
* Added a missing `added` property to `napi_get_uv_event_loop` in the
  docs
* Added a `napiVersion` property to the docs and updated the parser and
  generator to use it.
* Added usage documentation

PR-URL: #19962
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@kfarnung kfarnung mentioned this pull request Jul 14, 2018
n-api: move cleanup_hook to version 4 #21807
Closed
4 tasks done
@targos targos mentioned this pull request Jul 17, 2018
v10.7.0 proposal #21851
Merged
This was referenced Jul 18, 2018
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#207
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#208
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#209
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#210
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#211
Closed
gabrielschulhof pushed a commit to gabrielschulhof/node that referenced this pull request Mar 4, 2019
@kfarnung Gabriel Schulhof
n-api: restrict exports by version
80fa044
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section
* Move `napi_open_callback_scope`, `napi_close_callback_scope`,
  `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and
  `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section
* Added a missing `added` property to `napi_get_uv_event_loop` in the
  docs
* Added a `napiVersion` property to the docs and updated the parser and
  generator to use it.
* Added usage documentation

PR-URL: nodejs#19962
Backport-PR-URL: nodejs#25648
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
BethGriggs pushed a commit that referenced this pull request Mar 20, 2019
@kfarnung @BethGriggs
n-api: restrict exports by version
44609d1
* Move `napi_get_uv_event_loop` into the `NAPI_VERSION >= 2` section
* Move `napi_open_callback_scope`, `napi_close_callback_scope`,
  `napi_fatal_exception`, `napi_add_env_cleanup_hook`, and
  `napi_remove_env_cleanup_hook` into the `NAPI_VERSION >= 3` section
* Added a missing `added` property to `napi_get_uv_event_loop` in the
  docs
* Added a `napiVersion` property to the docs and updated the parser and
  generator to use it.
* Added usage documentation

PR-URL: #19962
Backport-PR-URL: #25648
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 26, 2019
v8.16.0 proposal #26933
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gabrielschulhof gabrielschulhof gabrielschulhof approved these changes
@addaleax addaleax Awaiting requested review from addaleax
+2 more reviewers
@devsnek devsnek devsnek left review comments
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@kfarnung kfarnung

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. doc Issues and PRs related to Node.js documentation. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. node-api Issues and PRs related to Node-API.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@kfarnung @devsnek @mhdawson @addaleax @BridgeAR @gabrielschulhof @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.