Commit graph

17 commits

Author SHA1 Message Date
LongYinan
0550c56fcf
fix(napi): External should impl FromNapiRef rather than FromNapiValue (#2013)
- Close https://github.com/napi-rs/napi-rs/issues/1994
2024-03-25 15:11:11 +08:00
LongYinan
4719caa643
feat(napi): support Return generic of ThreadsafeFunction (#1997)
* feat(napi): support to use tuple with either (#1993)

`Either` uses `ValidateNapiValue` + `TypeName` to validate and report error on value not being matched. So there's no way to remove these super traits from it. So I implemented these types to `Tuple` types.

* feat(napi): support `Return` generic of ThreadsafeFunction

* depracate JsFunction

* CalleeHandled tsfn should handle Result in callback

* Pass env to call_with_return_value callback

* Fix compile

* clippy fix

* Fix electron test

* Function args

---------

Co-authored-by: Hana <andywangsy@gmail.com>
2024-03-20 21:37:08 +08:00
LongYinan
e9de5681be
fix(napi): also apply electron external data fallback to lowlevel APIs (#1458)
* fix(napi): also apply electron external data fallback to lowlevel APIs

* chore: allow uninlined_format_args in tests
2023-01-28 21:31:57 +08:00
LongYinan
49a0139f81
style: clippy fix 2021-12-03 16:49:25 +08:00
LongYinan
e74fe2fb94
feat(napi): implement AsyncTask with AbortSignal support 2021-11-06 13:51:54 +08:00
forehalo
2467b7139b
Introduce #[napi] procedural macro to automation development boilerplate (#696)
* napi procedural macro for basic rust/JavaScript types
* introduce the `compat-mode` for `napi` and `napi-derive` crates for backward compatible
* remove #[inline] and let compiler to decide the inline behavior
* cli now can produce the `.d.ts` file for native binding
* many tests and example for the new procedural macro

Co-authored-by: LongYinan <lynweklm@gmail.com>
2021-09-23 01:29:09 +08:00
LongYinan
d864c71228
chore: rust 1.54.0 clippy suggestions 2021-07-30 12:54:59 +08:00
LongYinan
291def2d70
perf(napi): make FuturePromise static dispatch 2021-06-21 23:36:54 +08:00
LongYinan
7651fd1f6f
perf(napi): reducer tokio future execution overhead 2021-06-02 23:17:53 +08:00
LongYinan
b835c7ef3f
feat(build): remove ureq to support windows arm64 2021-05-31 23:31:17 +08:00
LongYinan
b01dae728b
bench: add array suite 2021-05-17 11:42:57 +08:00
LongYinan
91609a2343
chore: add bench suite for object getter setter 2020-12-29 18:03:10 +08:00
LongYinan
ff5c103020
chore: add thread safe function bench suite 2020-12-28 14:02:28 +08:00
LongYinan
0446e463c8
fix(napi): memory issues in create_external_buffer 2020-12-21 16:10:30 +08:00
LongYinan
1a3621b727
feat(napi): major upgrades for napi@1
1. inline everything
2. change `check_status` and `type_of` to macro
3. provide #[module_exports] macro
4. remove debug and repr[transparent] for ffi struct
2020-11-26 11:31:49 +08:00
LongYinan
9c921ffaa3
refactor(napi): scope and Ref 2020-09-30 15:54:54 +08:00
LongYinan
fb4d07edd4
feat: add benchmark crate and frameworks 2020-09-30 15:31:17 +08:00