LongYinan
72afae3736
refactor!(napi): Ref::unref accept &mut self instead of self ( #2308 )
2024-10-14 11:14:25 +08:00
LongYinan
a38a24c359
Release independent packages
...
- napi@3.0.0-alpha.14
- napi-derive@3.0.0-alpha.14
2024-10-14 00:27:38 +08:00
Richer
16fc9cbe31
feat(napi): support arraybuffer for de ( #2296 )
...
* feat(napi): support arraybuffer for de
* use BufferSlice
* clippy fix
---------
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-10-14 00:24:45 +08:00
LongYinan
e0811d1644
fix(napi): data maybe null in custom_gc ( #2304 )
...
* fix(napi): data maybe null in custom_gc
Sometimes thread has not been disposed but the objects on it have been
recycled, we need to check if the data has been pointed to null before
unref it.
* disable v8 compile cache on CI
2024-10-13 23:33:39 +08:00
LongYinan
afd081d003
feat(napi,napi-derive): allow lifetime in Class ( #2298 )
2024-10-10 05:59:14 +02:00
LongYinan
724673225a
refactor!(napi): remove clone fn on ThreadsafeFunction ( #2291 )
2024-10-07 19:23:11 +02:00
LongYinan
eba0b52c59
chore(napi): env doesn't need to be mut ( #2292 )
2024-10-07 19:20:21 +02:00
LongYinan
9a6f01a20c
Release independent packages
...
- napi@3.0.0-alpha.13
- napi-derive@3.0.0-alpha.13
2024-10-03 00:01:16 +02:00
LongYinan
69cd73d71c
refactor!(napi,napi-derive): add lifetime to ClassInstance ( #2286 )
2024-10-02 10:42:34 +02:00
Richer
d3cf9cb143
fix(napi-derive-backend): should respect origin name for class factory ( #2280 )
2024-09-30 17:06:58 +02:00
LongYinan
34829fb5f7
Release independent packages
...
- napi@3.0.0-alpha.12
- napi-derive@3.0.0-alpha.12
2024-09-23 17:01:31 +08:00
LongYinan
a4a8d31a42
chore(napi): remove once_cell ( #2271 )
2024-09-23 16:57:14 +08:00
LongYinan
f704b4ac0f
feat(napi-derive): add async_runtime attribute ( #2270 )
2024-09-23 16:21:13 +08:00
Richer
daf4a80bdb
feat(napi): mark create_buffer as deprecated & use BufferSlice to replace JsBuffer for ser ( #2267 )
2024-09-22 11:22:05 +08:00
LongYinan
cfc88ee541
Release independent packages
...
- napi-derive@3.0.0-alpha.11
2024-09-21 14:21:38 +08:00
LongYinan
0698bb1d80
feat(napi-derive): allow napi fn with lifetime ( #2266 )
2024-09-21 12:26:41 +08:00
LongYinan
511340a52f
Release independent packages
...
- napi@3.0.0-alpha.11
- napi-derive@3.0.0-alpha.10
2024-09-20 23:08:34 +08:00
LongYinan
fc4b6a632d
refactor(napi-derive): expand order ( #2265 )
2024-09-20 22:44:34 +08:00
LongYinan
91af2c5961
Release independent packages
...
- napi@3.0.0-alpha.10
- napi-derive@3.0.0-alpha.9
2024-09-19 22:30:36 +08:00
LongYinan
521ef58f59
refactor(napi): allow create BufferSlice from external data ( #2263 )
...
- also refactor the enum codegen, now we will not emit #[derive(Copy,
Clone)] for the original enums.
- also refacotr the fn codegen, now #[napi] fn can accept env: &Env as
argument, this is useful when the return type contains lifetime
2024-09-19 22:22:33 +08:00
Richer
814188f1ad
fix(derive): fix clippy warning with newer rust version ( #2262 )
2024-09-19 21:55:48 +08:00
Igor Matuszewski
cc21452f65
fix(napi): nullptr handling in TypedArrays ( #2258 )
...
* fix: Safely return empty slices if TypedArray buffer is null ptr
* fix: Only dispose of TypedArray if the data is not a nullptr
* test: Add a regression test for typed array null ptr deref
2024-09-19 13:38:19 +08:00
LongYinan
a9690383c2
Release independent packages
...
- napi@3.0.0-alpha.9
- napi@3.0.0-alphq.8
2024-09-13 00:17:49 +08:00
LongYinan
bf8f568788
refactor!(napi): Ref should not hold the value ptr ( #2243 )
...
It's unsafe
2024-09-12 23:25:09 +08:00
Cong-Cong Pan
c04327e27b
perf(napi): remove unnecessary checks for strings from napi_get_value_string_utf8 ( #2247 )
...
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-09-12 23:24:50 +08:00
LongYinan
b0bf4f00d0
fix(napi): windows function registration timing ( #2248 )
...
* fix(napi): windows function registration timing
* fix clippy issue
* upgrade zig version
* pin rust version on zig cross compile ci
2024-09-12 23:18:05 +08:00
Richer
58bcb64c19
fix(napi-derive): call flush on the BufWriter ( #2242 )
2024-09-02 14:16:00 +08:00
Richer
8b6cc10d77
fix(napi): use error_ref should checkout it at first ( #2235 )
2024-08-31 14:31:53 +08:00
Richer
b9c884e788
fix(macro): constructor don't support asynchronous function ( #2239 )
2024-08-31 10:40:49 +08:00
Richer
5934ecd2a9
feat(napi): mark JsArraybufferValue's value pub ( #2226 )
2024-08-23 22:25:52 +08:00
CPunisher
249c27e06d
fix(napi-derive): tuple object and enum ( #2227 )
...
* Fix tuple struct
* Add testcase
2024-08-23 14:10:39 +08:00
CPunisher
c459f0acf6
feat: support structured enum with discriminated unions ( #2222 )
...
* Structured enum
* Type indent
* Add test example
* Remove trailing commas
* discriminant
* discriminant conflict
* more test
* typo
2024-08-22 14:59:50 +08:00
CPunisher
e02ec1e87c
Replace self for Result<T> ( #2224 )
2024-08-22 14:59:00 +08:00
LongYinan
8df3f0f596
docs: remove dev protocal badge
2024-08-22 10:45:32 +08:00
sjh
09a79edfb7
fix(napi,napi-derive): ffi lifetime and pointer sound issues ( #2216 )
...
* The ownership of the CString will be taken in map function
* for empty struct like `#[napi] struct A;`, the `value_ref` will be `0x1`, and it will be overwritten by the others instance of the same class
2024-08-18 18:21:13 +08:00
LongYinan
2e5bf773e3
fix(napi-derive): warning in empty enum codegen ( #2214 )
2024-08-10 22:30:50 +08:00
LongYinan
d84fc42832
fix(napi-derive): string enum validate logic ( #2213 )
2024-08-10 21:27:17 +08:00
CPunisher
a154612019
fix(napi-derive): add more cases for typegen of function args ( #2210 )
...
* Handle more arg pat
* Update testcase
* Revert
2024-08-08 11:07:21 +08:00
Louis
164ef2a9f3
chore: implement serde::Serialize for Either ( #2209 )
...
This adds an implementation of serde::Serialize for all the Either types.
Long term, we might want to use the either crate, but for now this makes this
implementation usable with serde.
2024-08-05 18:05:49 +08:00
LongYinan
282ce1c00a
fix(napi): allow ThreadsafeFunction in Either ( #2204 )
2024-08-03 13:22:09 +08:00
Cong-Cong Pan
327998d0ac
fix(napi-derive): error for missing impl FromNapiValue since object_from_js = false ( #2197 )
2024-07-25 12:18:13 +08:00
LongYinan
22dba74813
Release independent packages
...
- napi-derive@3.0.0-alpha.7
2024-07-23 22:07:15 +08:00
Louis
f88b90f71e
fix(napi-derive): call flush on the BufWriter ( #2195 )
...
This is mandated by the Rust doc of the BufWriter. We've also seen bugs where
the data doesn't seem to be flushed properly, and thus the CLI fails to parse
JSONs emitted by napi-derive. This might be it, or not, but flushing shouldn't
hurt.
2024-07-23 21:08:13 +08:00
LongYinan
b884f62f7b
Release independent packages
...
- napi@3.0.0-alpha.8
2024-07-18 14:26:43 +08:00
LongYinan
6acd3b94fb
chore: add fail reason to assert ( #2192 )
2024-07-18 14:19:50 +08:00
Hana
ba345be957
perf(napi): reduce allocation for ToNapiValue of &str ( #2191 )
2024-07-18 13:08:02 +08:00
LongYinan
0f7c40354f
Release independent packages
...
- napi-derive@3.0.0-alpha.6
2024-07-16 13:06:00 +08:00
Cong-Cong Pan
782d6ac5f8
fix(napi-derive): napi getter macros ( #2188 )
...
* fix: napi getter macros
* chore: cargo fmt
2024-07-16 12:48:38 +08:00
LongYinan
2fccedbaba
Release independent packages
...
- napi@3.0.0-alpha.7
2024-07-14 23:29:08 +08:00
LongYinan
54ec4897ea
fix(napi): PromiseRaw throw error logic ( #2187 )
2024-07-14 23:28:36 +08:00