Age | Commit message (Collapse) | Author |
|
|
|
The two BSD ports are reusing the Linux code here.
|
|
exposes node-api symbols in denort so that `deno compile` can run native
addons.
|
|
|
|
This makes the permission system more versatile.
|
|
Part of #20613.
If a node addon is using the legacy `napi_module_register` on ctor
approach to module registration, we have to store the registered module
so that other threads can load the addon (because `napi_module_register`
will only be called once per process).
|
|
- Update ffi turbocall to use revised fast call api
- Remove `v8_version` function calls
- `*mut OwnedIsolate` is no longer stored in OpCtx gotham store
|
|
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
|
|
these symbols are re-exported from runtime/cli using `build.rs`, so we
don't need them in the same crate.
|
|
- 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.
|
|
- fix a few napi_* types
- clean up env hooks
- implement blocking queue in tsfn
- reduce transmutes
- use new `DataView::new` api from rusty_v8
|
|
Phase 1 node-api rewrite
|
|
Also removes permissions being passed in for node resolution. It was
completely useless because we only checked it for reading package.json
files, but Deno reading package.json files for resolution is perfectly
fine.
My guess is this is also a perf improvement because Deno is doing less
work.
|
|
update to Rust 1.77.2
---------
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
|
|
Fixes #22150
|
|
|
|
Part 2 of removing middleware.
This is somewhat awkward because `V8CrossThreadTaskSpawner` requires
tasks to be `Send`, but NAPI makes heavy use of `!Send` pointers. In
addition, Rust causes a closure to be `!Send` if you pull a `!Send`
value out of a struct.
---------
Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
|
|
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
|
|
This should return an error to the caller to make it
easier to track what went wrong.
Should help with debugging https://github.com/denoland/deno/issues/19389
|
|
This commit fixes problem with loading N-API modules that use
the "old" way of registration (using "napi_module_register" API).
The slot was not cleared after loading modules, causing subsequent
calls that use the new way of registration (using
"napi_register_module_v1" API) to try and load the previous module.
Ref https://github.com/denoland/deno/issues/16460
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
|
|
This commit removes "Error" and "Result" structs from
"ext/napi". In turn all NAPI functions now return "napi_status"
instead of "napi::Result".
|
|
Fixes https://github.com/denoland/deno/issues/17325
|
|
(#18210)
This implements two macros to simplify extension registration and centralize a lot of the boilerplate as a base for future improvements:
* `deno_core::ops!` registers a block of `#[op]`s, optionally with type
parameters, useful for places where we share lists of ops
* `deno_core::extension!` is used to register an extension, and creates
two methods that can be used at runtime/snapshot generation time:
`init_ops` and `init_ops_and_esm`.
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
This commit partially reverts changes from
https://github.com/denoland/deno/pull/18095.
Turns out I made a mistake that became apparent when working
on removing "RuntimeOptions::extensions_with_js" in a follow up.
|
|
There's no point for this API to expect result. If something fails it should
result in a panic during build time to signal to embedder that setup is
wrong.
|
|
This commit stabilizes Node-API, the "--unstable" flag is no longer
required to load native extensions. "--allow-ffi" permission is still
required to load them.
|
|
Fixes https://github.com/denoland/deno/issues/17587
|
|
|
|
Fixes https://github.com/denoland/deno/issues/17349
|
|
I mistakenly held on to a RefCell's borrow for the whole time of
iteration, but since these counters can be refed/unrefed from any
thread that is a mistake.
|
|
This commits fixes various NAPI functions related to creation and
throwing of errors.
|
|
This commit fixes "cleanup hooks" in NAPI integration in two ways:
- don't hold to RefCell's borrow while iterating over hooks
- allow a hook to remove itself when being called
|
|
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
This commit adds support for "napi_add_env_cleanup_hook" and
"napi_remove_env_cleanup_hook" function for Node-API.
|
|
Adds support for static properties when using "napi_define_class".
|
|
|
|
|
|
Yearly tradition of creating extra noise in git.
|
|
|
|
|
|
This PR implements the NAPI for loading native modules into Deno.
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
|