Comments (4)
Since the content of EXPERIMENTAL
can change there is not guarrantee that any build made with EXPERIMENTAL
will work with the latest version (the APIs can be removed or modified while experimental). I think it's safer to not include them in the separate headers but if we do documentation should make it clear that anything that uses that option make break with any future version.
from abi-stable-node.
I'll reply to nodejs/node-api-headers#3 (comment) over here, as it feels like a better place to continue discussion
Hi @Julusian, I like to hear your feedback. We created
node-api-headers
to allow the build of native addon without download all the headers for a specific version of Node.js. This is possible because Node-API is an ABI stable API and it's independent from any Node.js version what matters is the version of Node-API.Node-API has some experimental API that are not part of any version because they are not considered stable. We removed from the headers the features e / o functions that are under
NAPI_EXPERIMENTAL
so this means that if a developer set theNAPI_EXPERIMENTAL
flag he will obtain a compilation error.I don't know if this could be a problem, but I want to discuss at the next Node-API meeting nodejs/abi-stable-node#meeting. If you have time and want to join us it will be a pleasure to discuss about this together.
My idea is to use the original Node-API's headers (without removing the experimental feature) and add a new section named
EXPERIMENTAL
in thesymbol.js
like reported below:EXPERIMENTAL: { js_native_api_symbols: [ // List of symbols in js_native_api.h considered experimental. ], node_api_symbols: [ // List of symbols in node_api.h considered experimental. ] }
At this stage, the experimental apis are not something I have thought about, so I dont have any insight on how I think they should be handled.
My main focus has been on wrapping native libraries as npm packages (https://www.npmjs.com/package/@julusian/jpeg-turbo, https://www.npmjs.com/package/node-hid, https://www.npmjs.com/package/freetype2), so I've typically been targetting an older node-api version, and have not considered using anything from experimental.
That said, if someone does want to use experimental with cmake-js v7, I will need to do something to allow them to. But that might be best achieved by letting them use the old flow of downloading a specific version of the nodejs headers and building against that. That flow wont be removed anytime soon, as it is still necessary for non node-api projects.
from abi-stable-node.
We discussed in the 10 Jun Node API meeting to include the experimental APIs under a new EXPERIMENTAL
property like @NickNaso suggested in #438 (comment) . This property will include all of the previous version's symbols as well, since someone using experimental APIs would only target the most recent Node API version. It doesn't make sense to target a previous version and still use experimental APIs, since those APIs would never be included in the previous version.
from abi-stable-node.
Proposal to sue node-api-headers
in node-gyp
nodejs/node-gyp#2736
from abi-stable-node.
Related Issues (20)
- Discuss https://github.com/nodejs/node-addon-api/pull/902 HOT 1
- Thread safety of napi_threadsafe_function
- Ask for review of node-serialport Node-API port - https://github.com/serialport/node-serialport/pull/2305/files HOT 2
- Drive towards full coverage HOT 5
- Discuss Node-API addition https://github.com/nodejs/node/pull/41329#issuecomment-1015667899 HOT 1
- Regular hang in Running test 'typed_threadsafe_function/typed_threadsafe_function_sum' HOT 1
- Node-API v9 HOT 7
- Better coverage of node-api in Youtube HOT 13
- Add list of non C language bindings to Node.js doc HOT 10
- Document how to check for memory leaks in addon/default leak. HOT 4
- Electron 21 breaks api compatability with some modules HOT 9
- Get contacts for each of the runtimes supporting Node-API HOT 8
- What's new in the Node-API and node-addon-api world? - 2023 version HOT 20
- Can references be shared between different modules/envs? HOT 3
- Improve score on OpenSSF scorecard HOT 8
- Consider changing the license for examples to MIT HOT 2
- Tracking issues for V8 changes needed HOT 1
- Help with node-sqlite3 performance HOT 3
- What's new in the Node-API and node-addon-api world? - 2024 version HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abi-stable-node.