summaryrefslogtreecommitdiff
path: root/cli/napi
AgeCommit message (Collapse)Author
2024-10-24feat: support node-api in denort (#26389)snek
exposes node-api symbols in denort so that `deno compile` can run native addons.
2024-10-18chore: forward v2.0.2 release commit to main (#26376)denobot
This is the release commit being forwarded back to main for 2.0.2 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-17fix(cli): set napi object property properly (#26344)LongYinan
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. -->
2024-10-16chore: forward v2.0.1 release commit to main (#26338)denobot
This is the release commit being forwarded back to main for 2.0.1 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-16fix: node-api function call should use preamble (#26297)snek
`napi_call_function` should use our equiv of NAPI_PREAMBLE (`&mut Env` instead of `*mut Env`) since it needs to set error codes based on whether the body of the function raised a JS exception. Fixes: https://github.com/denoland/deno/issues/26282
2024-10-14fix(ext/napi): pass user context to napi_threadsafe_fn finalizers (#26229)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/26228
2024-10-082.0.0 (#26063)denobot
Bumped versions for 2.0.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-02fix(node): implement libuv APIs needed to support `npm:sqlite3` (#25893)Nathan Whitaker
Fixes #24740. Implements the `uv_mutex_*` and `uv_async_*` APIs. The mutex API is implemented exactly as libuv, a thin wrapper over the OS's native mutex. The async API is implemented in terms of napi_async_work. As documented in the napi docs, you really shouldn't call `napi_queue_async_work` multiple times (it is documented as undefined behavior). However, our implementation doesn't have any issue with this, so I believe it suits our purpose here.
2024-10-02chore: release deno_* crates (#25987)denobot
Testing once again if the crates are being properly released. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-02chore: release deno_* crates (#25976)denobot
Test run before Deno 2.0 release to make sure that the publishing process passes correctly. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-04chore: forward v1.46.3 release commit to main (#25425)denobot
This is the release commit being forwarded back to main for 1.46.3
2024-08-29chore: forward v1.46.2 release commit to main (#25296)denobot
This is the release commit being forwarded back to main for 1.46.2
2024-08-28fix(napi): Don't run microtasks in napi_resolve_deferred (#25246)Nathan Whitaker
Fixes an incredibly obscure bug that causes parcel's file watcher to not get any file update notifications on macOS. The issue was that the native addon was calling `napi_resolve_deferred`, but when we resolved the promise, v8 was running microtasks automatically. That executed JS, which called back into the native addon and broke the addon's assumption that the call wouldn't be reentrant.
2024-08-22chore: forward v1.46.1 release commit to main (#25155)denobot
2024-08-221.46.0 (#25139)denobot
Bumped versions for 1.46.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-31chore: forward v1.45.5 release commit to main (#24818)denobot
2024-07-23chore: forward v1.45.3 release commit to main (#24681)denobot
This is the release commit being forwarded back to main for 1.45.3 --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-23Revert "chore: move all node-api impl to ext (#24662)" (#24680)Bartek Iwańczuk
This reverts commit d00fbd70258a77a267fe20bdd2c4a028c799b693. Reverting because, it caused a failure during v1.45.3 publish: https://github.com/denoland/deno/actions/runs/10048730693/job/27773718095
2024-07-22chore: move all node-api impl to ext (#24662)snek
these symbols are re-exported from runtime/cli using `build.rs`, so we don't need them in the same crate.
2024-07-12chore: forward v1.45.2 release commit to main (#24564)denobot
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2024-07-12chore: forward v1.45.1 release commit to main (#24540)denobot
This is the release commit being forwarded back to main for 1.45.1 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-07-111.45.0 (#24512)denobot
Bumped versions for 1.45.0 --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-19fix: more node-api fixes (#24220)snek
- add fallback impls of external string apis which always copy. after upstream changes to rusty_v8 we can support non-copying api as well. - `napi_get_buffer_data` needs to work on all TypedArray instances. - Fixes: https://github.com/denoland/deno/issues/24209 - `target_defaults.default_configuration` is used by some modules to find the corresponding node file from node-gyp - `node_api_get_module_filename` expects the filename to be a `file:` url.
2024-06-19chore: forward v1.44.4 release commit to main (#24271)denobot
This is the release commit being forwarded back to main for 1.44.4 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-06-19chore: forward v1.44.3 release commit to main (#24256)denobot
This is the release commit being forwarded back to main for 1.44.3 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-13fix(napi): Read reference ownership before calling finalizer to avoid crash ↵Nathan Whitaker
(#24203) Fixes #23493. What was happening here was that napi-rs was freeing the napi reference ([here](https://github.com/napi-rs/napi-rs/blob/19e3488efcbc601afa1f11a979372eb6c5ea6130/crates/napi/src/bindgen_runtime/mod.rs#L62)) during its finalize callback (which we call [here](https://github.com/denoland/deno/blob/fb31eaa9ca59f6daaee0210d5cd206185c7041b9/cli/napi/js_native_api.rs#L132)). We then were [reading the `ownership` field](https://github.com/denoland/deno/blob/fb31eaa9ca59f6daaee0210d5cd206185c7041b9/cli/napi/js_native_api.rs#L136) of that freed reference. For some reason on arm macs the freed memory gets zeroed, so the value of `ownership` was `0` when we read it (i.e. it was `ReferenceOwnership::Runtime`). We then freed it again (since we thought we owned it), causing the segfault.
2024-06-12fix: node-api get_value_string_utf8 should use utf8_length (#24193)snek
whoops. also did a drive-by cleanup of `isolate` usage since i noticed it while using `utf8_length(isolate)`
2024-06-13chore: forward v1.44.2 release commit to main (#24194)denobot
Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
2024-06-11fix: clean up some node-api details (#24178)snek
- fix a few napi_* types - clean up env hooks - implement blocking queue in tsfn - reduce transmutes - use new `DataView::new` api from rusty_v8
2024-06-10fix: Rewrite Node-API (#24101)snek
Phase 1 node-api rewrite
2024-06-06chore: forward v1.44.1 release commit to main (#24115)denobot
This is the release commit being forwarded back to main for 1.44.1 Co-authored-by: devsnek <devsnek@users.noreply.github.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-05-301.44.0 (#24045)denobot
Bumped versions for 1.44.0 Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2024-05-22chore: forward v1.43.6 release commit to main (#23936)Bartek Iwańczuk
Bumped versions for 1.43.6 Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-05-17chore: forward v1.43.4 commit to main (#23861)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-05-13chore: cleanup unused dependencies (#23787)Leo Kettmeir
2024-05-10chore: forward v1.43.3 release commit to main (#23771)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-09chore: forward v1.43.2 release commit to main (#23749)denobot
**THIS PR HAS GIT CONFLICTS THAT MUST BE RESOLVED** This is the release commit being forwarded back to main for 1.43.2 Please ensure: - [x] Everything looks ok in the PR - [x] The release has been published To make edits to this PR: ```shell git fetch upstream forward_v1.43.2 && git checkout -b forward_v1.43.2 upstream/forward_v1.43.2 ``` Don't need this PR? Close it. cc @nathanwhit Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com> Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-05-06fix(ext/node): napi_get_element and napi_set_element work with objects (#23713)Bartek Iwańczuk
This change makes DuckDB example work: https://github.com/denoland/deno/issues/23656.
2024-05-011.43.0 (#23629)denobot
Bumped versions for 1.43.0 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-04-251.43.0 (#23549)denobot
Bumped versions for 1.43.0 Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2024-04-18fix(ext/node): remove unwraps from fallible conversions (#23447)Bartek Iwańczuk
Removes `.unwrap()` calls from fallible conversion and replaces with graceful error returns.
2024-04-16chore: forward v1.42.4 commit to `main` (#23394)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-04-12chore: forward v1.42.3 release commit to main (#23335)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-04-11chore: forward v1.42.2 release commit to main (#23315)denobot
Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-04-01chore: forward v1.42.1 release commit to main (#23162)denobot
This is the release commit being forwarded back to main for 1.42.1 Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2024-03-281.42.0 (#23105)denobot
Bumped versions for 1.42.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-03-14chore: Forward 1.41.3 release commit (#22930)Nathan Whitaker
Forward 1.41.3 release commit Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
2024-03-08chore: forward v1.41.2 release commit to main (#22793)denobot
This is the release commit being forwarded back to main for 1.41.2 Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-02-29chore: forward v1.41.1 release commit to main (#22643)denobot
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2024-02-221.41.0 (#22524)denobot
Bumped versions for 1.41.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>