Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): stabilize Node-API #17553

Merged
merged 2 commits into from
Feb 14, 2023
Merged

Conversation

bartlomieju
Copy link
Member

Closes #16709

@bartlomieju bartlomieju added this to the 1.31 milestone Jan 26, 2023
@aapoalas
Copy link
Collaborator

A bit sad to see N-API become stable before FFI, but on the other hand FFI is nowhere near stable so I think this is fine :D

@bartlomieju
Copy link
Member Author

A bit sad to see N-API become stable before FFI, but on the other hand FFI is nowhere near stable so I think this is fine :D

Yeah - I kinda agree with that, but the thing is Node-API is defined and if something doesn't work as expected is simply a bug. FFI on the other hand is still being worked on (mostly by you 😛) so I think it's fair that it would still remain unstable.

I'm still thinking if it should use other flag than --allow-ffi

@aapoalas
Copy link
Collaborator

Yeah - I kinda agree with that, but the thing is Node-API is defined and if something doesn't work as expected is simply a bug. FFI on the other hand is still being worked on (mostly by you stuck_out_tongue) so I think it's fair that it would still remain unstable.

Yeah, N-API simply is a stable interface to implement, there's no way around it :)

I'm still thinking if it should use other flag than --allow-ffi

This may probably a good idea.

I'm bouncing between ideas of splitting --allow-ffi internally into two (--allow-ffi-extend for opening new libraries and creating new functions from pointers, and --allow-ffi-use for the rest, roughly) and implementing some sort of "key" API to enable usage of some FFI APIs with a "key" created using the --allow-ffi permission which can then be ditched.

Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

Test still currently requires --unstable due to Deno.Command usage. Need to either wait for #17628 or change the test.

@bartlomieju bartlomieju changed the title [WIP] feat(napi): stabilize Node-API feat(napi): stabilize Node-API Feb 13, 2023
@bartlomieju bartlomieju changed the title feat(napi): stabilize Node-API feat(node): stabilize Node-API Feb 13, 2023
Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM - towards a reliable node-api 🥂

@bartlomieju bartlomieju merged commit b3c85c3 into denoland:main Feb 14, 2023
@bartlomieju bartlomieju deleted the stabilize_napi branch February 14, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--unstable needed to generate Prisma client
3 participants