Repository navigation
feat(npm): implement Node API - #13633
Merged
Merged
Conversation
aapoalas
reviewed
Feb 9, 2022
littledivy
commented
Feb 9, 2022
littledivy
commented
Feb 9, 2022
Comment on lines
+13
to
+17
| shared.data_finalize = if !(finalize_cb as *const c_void).is_null() { | ||
| Some(finalize_cb) | ||
| } else { | ||
| None | ||
| }; |
Member
Author
There was a problem hiding this comment.
finialize_cb should just be a Option<napi_finalize> here
littledivy
commented
Feb 10, 2022
Member
Author
There was a problem hiding this comment.
https://github.com/denoland/deno/runs/5127562468?check_suite_focus=true#step:34:2786 The WASM streaming tests are failing, it seems to be using the default V8 WASM streaming callback instead of what Deno defines using Deno.core.setWasmStreamingCallback()
EDIT: Fixed
Member
Author
|
Thank you @DjDeveloperr and @bartlomieju for the help! |
24 of 25 tasks
littledivy
pushed a commit
that referenced
this pull request
Oct 10, 2022
Changes introduced in #13633 have broken the ability to compile for linux/aarch64 - specifically the use of a `i8` as a char type, which is an `u8` on linux/aarch64. This PR: - Replaces instances of `i8` with the architecture-aware wrapper type `c_char` - Skips the use of `--export-dynamic-symbol` on linux-aarch64, because the target environments often rely on older libc/binutils versions
bartlomieju
pushed a commit
that referenced
this pull request
Oct 17, 2022
Changes introduced in #13633 have broken the ability to compile for linux/aarch64 - specifically the use of a `i8` as a char type, which is an `u8` on linux/aarch64. This PR: - Replaces instances of `i8` with the architecture-aware wrapper type `c_char` - Skips the use of `--export-dynamic-symbol` on linux-aarch64, because the target environments often rely on older libc/binutils versions
littledivy
added a commit
that referenced
this pull request
Jan 14, 2023
This commit removes the libuv pollyfills introduced with Node-API support. It is too much Node-specific. Most Node-API modules that depend on libuv are already giving up the benefits of Node-API. We should rather encourage modules to use `ThreadSafeFunction` or `AsyncWork` to interface with the event loop. Relevant discussion a few months ago: #13633 (comment) cc @bartlomieju
bartlomieju
pushed a commit
that referenced
this pull request
Jan 16, 2023
This commit removes the libuv pollyfills introduced with Node-API support. It is too much Node-specific. Most Node-API modules that depend on libuv are already giving up the benefits of Node-API. We should rather encourage modules to use `ThreadSafeFunction` or `AsyncWork` to interface with the event loop. Relevant discussion a few months ago: #13633 (comment) cc @bartlomieju
This was referenced Oct 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements the NAPI for loading native modules into Deno.
Closes #15717
Feature tracking
napi_set_instance_datanapi_get_instance_datanapi_statusnapi_extended_error_infonapi_envnapi_valuenapi_threadsafe_functionnapi_threadsafe_function_release_modenapi_threadsafe_function_call_modenapi_handle_scopenapi_escapable_handle_scopenapi_refnapi_type_tagnapi_async_cleanup_hook_handlenapi_callback_infonapi_callbacknapi_finalizenapi_async_execute_callbacknapi_async_complete_callbacknapi_threadsafe_function_call_jsnapi_async_cleanup_hooknapi_get_last_error_infonapi_thrownapi_throw_errornapi_throw_type_errornapi_throw_range_errornode_api_throw_syntax_errornapi_create_errornapi_create_type_errornapi_create_range_errornode_api_create_syntax_errornapi_get_and_clear_last_exceptionnapi_is_exception_pending(stubbed)napi_fatal_exceptionnapi_fatal_errornapi_open_handle_scopenapi_close_handle_scopenapi_open_escapable_handle_scope(stubbed)napi_close_escapable_handle_scope(stubbed)napi_escape_handle(stubbed)napi_create_reference(stubbed) Weak handles and finalizersΒ rusty_v8#895napi_delete_reference(stubbed) Weak handles and finalizersΒ rusty_v8#895napi_reference_ref(stubbed) Weak handles and finalizersΒ rusty_v8#895napi_reference_unref(stubbed) Weak handles and finalizersΒ rusty_v8#895napi_get_reference_value(stubbed) Weak handles and finalizersΒ rusty_v8#895napi_add_env_cleanup_hook(stubbed)napi_remove_env_cleanup_hook(stubbed)napi_add_async_cleanup_hooknapi_remove_async_cleanup_hooknapi_module_registernapi_key_collection_modenapi_key_filternapi_key_conversionnapi_valuetypenapi_typedarray_typenapi_create_arraynapi_create_array_with_lengthnapi_create_arraybuffernapi_create_buffernapi_create_buffer_copynapi_create_datenapi_create_externalnapi_create_external_arraybuffernapi_create_external_buffernapi_create_objectnapi_create_symbolnapi_create_typedarraynapi_create_dataviewnapi_create_int32napi_create_uint32napi_create_int64napi_create_doublenapi_create_bigint_int64napi_create_bigint_uint64napi_create_bigint_wordsnapi_create_string_latin1napi_create_string_utf16napi_create_string_utf8napi_get_array_lengthnapi_get_arraybuffer_infonapi_get_buffer_infonapi_get_prototypenapi_get_typedarray_infonapi_get_dataview_infonapi_get_date_valuenapi_get_value_boolnapi_get_value_doublenapi_get_value_bigint_int64napi_get_value_bigint_uint64napi_get_value_bigint_wordsnapi_get_value_externalnapi_get_value_int32napi_get_value_int64napi_get_value_string_latin1napi_get_value_string_utf8napi_get_value_string_utf16napi_get_value_uint32napi_get_booleannapi_get_globalnapi_get_nullnapi_get_undefinednapi_coerce_to_boolnapi_coerce_to_numbernapi_coerce_to_objectnapi_coerce_to_stringnapi_typeofnapi_instanceof(Add v8::Value::InstanceOf bindingsΒ rusty_v8#879)napi_is_arraynapi_is_arraybuffernapi_is_buffernapi_is_datenapi_is_errornapi_is_typedarraynapi_is_dataviewnapi_strict_equalsnapi_detach_arraybuffernapi_is_detached_arraybuffernapi_property_attributesnapi_property_descriptornapi_get_property_namesnapi_get_all_property_names(needs v8 binding)napi_set_propertynapi_get_propertynapi_has_propertynapi_delete_propertynapi_has_own_propertyAdd v8::Object::HasOwnProperty bindingsΒ rusty_v8#897napi_set_named_propertynapi_get_named_propertynapi_has_named_propertynapi_set_elementnapi_get_elementnapi_has_elementnapi_delete_elementnapi_define_properties(incomplete)napi_object_freezenapi_object_sealnapi_call_functionnapi_create_functionnapi_get_cb_infonapi_get_new_targetAdd v8::FunctionCallbackInfo::NewTarget bindingsΒ rusty_v8#898napi_new_instancenapi_define_class(TODO: proper getter/setters)napi_wrapnapi_unwrapnapi_remove_wrapnapi_type_tag_objectnapi_check_object_type_tagnapi_add_finalizerWeak handles and finalizersΒ rusty_v8#895napi_create_async_worknapi_delete_async_worknapi_queue_async_worknapi_cancel_async_worknapi_async_initnapi_async_destroynapi_make_callbacknapi_open_callback_scopenapi_close_callback_scopenapi_get_node_versionnapi_get_versionnapi_adjust_external_memoryAdd v8::Isolate:AdjustAmountOfExternalAllocatedMemory bindingsΒ rusty_v8#880napi_create_promisenapi_resolve_deferrednapi_reject_deferrednapi_is_promisenapi_run_scriptnapi_get_uv_event_loopnapi_call_threadsafe_functionnapi_create_threadsafe_functionnapi_get_threadsafe_function_contextnapi_acquire_threadsafe_functionnapi_release_threadsafe_functionnapi_ref_threadsafe_functionnapi_unref_threadsafe_functionnode_api_get_module_file_name