LongYinan
bb9883ab09
fix(napi-derive): lifetime codegen issue ( #2794 )
2025-07-22 17:54:18 +08:00
Cong-Cong Pan
a2ade0dfe5
perf(napi): use Vec with_capacity in FromNapiValue ( #2793 )
2025-07-22 17:40:15 +08:00
github-actions[bot]
63d536be4f
chore(napi): release v3.1.1 ( #2792 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-21 20:47:24 +08:00
LongYinan
b6f883a053
Revert "fix(napi): callback should be Fn rather than FnOnce" ( #2791 )
...
This reverts commit 7449e5f5cc24e3b92e83aeba68991da7cf8a5b2c.
2025-07-21 20:45:17 +08:00
github-actions[bot]
03805d1d3a
chore: release ( #2788 )
...
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-21 16:12:40 +08:00
LongYinan
16dbf68dca
chore(napi): add UnwindSafe and RefUnwindSafe back to AbortSignal and AsyncWorkPromise ( #2789 )
2025-07-21 16:03:24 +08:00
LongYinan
1ca2bad43f
feat(napi): provide ScopedTask to resolve JsValue with lifetime ( #2786 )
2025-07-21 13:55:44 +08:00
LongYinan
c657665a01
ci: pin release-plz action
2025-07-21 10:39:48 +08:00
LongYinan
a9dc138aa0
Release independent packages
...
- napi@3.0.0
- napi-derive@3.0.0
- napi-sys@3.0.0
2025-07-17 17:40:38 +08:00
LongYinan
a30d42c624
style: rust warning ( #2776 )
2025-07-12 23:38:42 +08:00
LongYinan
b5fa1ff688
Release independent packages
...
- napi@3.0.0-beta.12
- napi-derive@3.0.0-beta.12
2025-07-04 22:50:28 +08:00
LongYinan
0119f09237
feat(napi): support untyped TypedArray slice ( #2762 )
2025-07-03 16:50:35 +08:00
Brooooooklyn
2fed7f85e0
fix(napi): spawn_future_with_callback lifetime ( #2760 )
2025-07-03 07:09:22 +00:00
LongYinan
5add173ca2
feat(napi): support c string for object apis ( #2759 )
2025-07-03 14:08:05 +08:00
LongYinan
7e34e30b66
feat!(napi): create function from #[napi] fn ( #2757 )
2025-07-02 16:54:31 +08:00
Cong-Cong Pan
6222b39f5a
perf(napi): use Cell<bool> to replace AtomicBool ( #2506 )
...
* perf: use Cell<bool> to replace AtomicBool
* cargo fmt
---------
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-07-02 09:29:07 +08:00
LongYinan
a64df02e84
perf(napi): sender in Promise does not need to be Arc ( #2756 )
2025-07-01 08:40:24 -07:00
LongYinan
718b7d1ee0
fix(napi): drop SymbolRef and ObjectRef properly ( #2755 )
2025-07-01 08:28:42 -07:00
LongYinan
99f4c089d4
feat(napi): add napi_ref impl for Object Symbol and External ( #2754 )
2025-07-01 00:45:32 -07:00
LongYinan
0a8de79fc4
Release independent packages
...
- napi-build@2.2.2
2025-06-30 17:15:43 +08:00
LongYinan
caf0400090
Release independent packages
...
- napi@3.0.0-beta.11
- napi-derive@3.0.0-beta.11
2025-06-30 17:12:39 +08:00
LongYinan
092f887f39
fix(napi-derive): generate object key types properly ( #2752 )
2025-06-30 17:10:17 +08:00
LongYinan
b5e9c41d14
fix(napi): remove DerefMut impl for all TypedArray types ( #2750 )
2025-06-29 08:49:29 -07:00
LongYinan
56998d5f12
fix(napi): callback should be Fn rather than FnOnce ( #2749 )
...
In ThreadsafeFunction::call_with_return_value
2025-06-28 21:57:54 +08:00
CPunisher
b25c5de30c
fix(build): increase wasi stack size ( #2748 )
2025-06-27 19:29:54 +08:00
LongYinan
3898211b3a
Release independent packages
...
- napi@3.0.0-beta.10
- napi-derive@3.0.0-beta.10
2025-06-25 16:06:28 +08:00
LongYinan
8c3db48686
style: run clippy on nightly Rust ( #2744 )
2025-06-25 13:55:11 +08:00
Cameron
562bb698d6
fix(napi-derive): single parentheses arg is provided in ThreadsafeFunction ( #2742 )
...
* test: add repro for #2726
* fix
---------
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-06-24 16:09:47 +00:00
LongYinan
3e2fe8a2a3
fix(napi): create external TypedArray in Electron env ( #2740 )
2025-06-24 22:48:00 +08:00
LongYinan
b40aaa8d71
Release independent packages
...
- napi@3.0.0-beta.9
- napi-derive@3.0.0-beta.9
2025-06-24 16:33:32 +08:00
LongYinan
a773f8d438
fix(napi): prevent panic in ThreadsafeFunctionHandle::drop if ThreadsafeFunction::create fail ( #2731 )
2025-06-24 15:01:08 +08:00
LongYinan
8df3f942e6
fix(napi): wrong drop impl for TypedArray::with_external_data ( #2724 )
2025-06-23 17:48:21 +08:00
LongYinan
1a90e82bb1
perf(napi): remove unnecessary wrap in Task ( #2714 )
2025-06-13 00:02:14 -07:00
LongYinan
2b443401ac
fix(napi): set AbortError name ( #2713 )
2025-06-11 14:05:40 -07:00
LongYinan
fcfac5083a
fix(napi): avoid allocate empty Box if closures is empty ( #2712 )
...
Ref: https://github.com/napi-rs/napi-rs/pull/2711
2025-06-11 13:19:38 -07:00
LongYinan
97ed022e46
fix(napi): avoid add finalizer if properties is empty ( #2711 )
2025-06-11 12:47:49 -07:00
LongYinan
668b53e849
Release independent packages
...
- napi@3.0.0-beta.8
- napi-derive@3.0.0-beta.8
2025-06-08 21:44:17 +08:00
LongYinan
54935e34fa
fix(napi-derive): panic while creating type definition when Rust comment contains escape syntax ( #2701 )
2025-06-08 18:25:09 +08:00
LongYinan
814bc79412
fix(napi-derive): using js_name generating wrong type defs ( #2700 )
...
This commit introduces two main changes:
1. Refactors the variable names used during the creation of
`NapiStruct` in `crates/macro/src/parser/mod.rs`. The goal is to
make the source of `NapiStruct.name` (the Rust identifier) and
`NapiStruct.js_name` (the JavaScript name, potentially from a
`#[napi(js_name = "...")]` attribute) more explicit. This change
is primarily for code readability and maintainability. The core
logic remains the same.
2. Adds a new test case to `examples/napi` to specifically verify
the behavior of `#[napi(js_name = "...")]` on structs. This
includes:
- A new Rust struct `OriginalRustNameForJsNamedStruct` in
`examples/napi/src/class.rs` decorated with
`#[napi(js_name = "MyJsNamedClass")]`.
- Corresponding tests in `examples/napi/__tests__/values.spec.ts`
that check for correct class instantiation, method calls, and
type alias generation (`OriginalRustNameForJsNamedStruct` as an
alias for `MyJsNamedClass`).
Note: I encountered some issues running the full build and tests for the example due to pre-commit hooks in the testing environment that I couldn't bypass. However, I believe the changes are correct based on static analysis and focused checks.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-08 17:14:57 +08:00
LongYinan
3f4338a907
fix(napi): memory leak in Object Property ( #2699 )
2025-06-07 22:24:05 +08:00
Hana
e31b898a35
feat(napi): support setting error_status of ThreadsafeFunctionBuilder ( #2695 )
2025-06-06 16:27:52 +08:00
Hana
0a90c8a8f2
feat(napi): support build_threadsafe_function variant with error status ( #2694 )
2025-06-05 21:35:18 +08:00
LongYinan
19146503ff
Release independent packages
...
- napi@3.0.0-beta.7
- napi-build@2.2.1
2025-06-04 20:25:05 +08:00
LongYinan
3450c7af43
fix(napi-build): compatible with v2
2025-06-04 20:24:02 +08:00
LongYinan
8256b9515e
Release independent packages
...
- napi@3.0.0-beta.6
- napi-derive@3.0.0-beta.6
- napi-build@3.0.0-beta.0
2025-06-04 18:24:11 +08:00
LongYinan
a8d39e98df
Release independent packages
...
- napi@3.0.0-beta.5
- napi-derive@3.0.0-beta.5
2025-06-04 17:07:12 +08:00
liuyi
5a17b88636
fix: revalidate shared libs if type def not found ( #2689 )
2025-06-04 15:05:24 +08:00
Cong-Cong Pan
a6f133cf7f
perf(napi): PersistedPerInstanceHashMap can be thread local ( #2681 )
...
* perf: PersistedPerInstanceHashMap can be thread local
* fix
* fix
* fix cargo clippy
2025-06-04 11:46:36 +08:00
LongYinan
375b32b2b1
chore: clippy fix
2025-06-03 20:18:57 +08:00
LongYinan
9dd929db4a
chore: update napi-derive-backend version in napi-derive
2025-06-03 19:41:59 +08:00