859 Commits

Author SHA1 Message Date
renovate[bot]
3cf39a7005
fix(deps): update rust crate ctor to v0.5.0 (#2865)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-10 17:59:10 +00:00
github-actions[bot]
fa5fa53a76
chore: release (#2858)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-09 23:05:46 +08:00
LongYinan
bcef141990
fix(napi-derive): comments idents regression (#2857) 2025-08-09 23:02:07 +08:00
github-actions[bot]
72ad262a29
chore(napi): release v3.2.2 (#2852)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-08 22:16:45 +08:00
LongYinan
8cada96703
fix(napi): no need to cleanup thread_local stuff (#2851) 2025-08-08 20:57:23 +08:00
github-actions[bot]
ce1fdbcdeb
chore: release (#2848)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-08 20:21:05 +08:00
LongYinan
913e42f47c
fix(napi): ensure tokio runtime is initialized for dlopen (#2850)
* fix(napi): ensure tokio runtime is initialized for dlopen

Fixes async functions panic when using nodejs dlopen by ensuring
the tokio runtime is properly initialized before accessing it.

When modules are loaded via dlopen instead of require, the runtime
initialization might not happen through the normal module registration
path. This fix adds start_async_runtime() calls to all runtime access
functions to handle this scenario.

Fixes #2847

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix

* Fix

* Remove

* cargo check

* fix for wasm

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-08 20:12:14 +08:00
LongYinan
dca00683d8
fix(napi): handle the return_if_invalid for Array param (#2846)
* fix(napi): handle the return_if_invalid for Array param

* Update crates/backend/src/codegen/fn.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update crates/backend/src/codegen/fn.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-08 15:10:43 +08:00
github-actions[bot]
fa9d578d3b
chore: release (#2843)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-07 23:39:50 +08:00
Mikaël Francoeur
83389a186b
feat(napi): add ScopeGenerator trait (#2831)
* add lifetime to iterator

* Add ScopedIterator

* fix type gen

* Clippy fix

---------

Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-08-07 21:44:01 +08:00
LongYinan
b997c4eeaf
fix(napi): user_defined_rt can only be used once (#2841) 2025-08-07 02:58:03 -07:00
Mikaël Francoeur
88fca29e3b
feat: make generator an iterator (#2784)
* make the generator an iterator

* add JSDoc for generators

* prevent naming conflicts

* add JSDoc struct

* update snapshot

* clippy

* Update typedef

* update fmt

* Apply code review

* test compatible

---------

Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-08-07 08:03:37 +00:00
7f5013eee3
feat(napi): add Error.cause support to napi::Error (#2829)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-08-05 12:53:36 +08:00
github-actions[bot]
b35ff14e77
chore(napi): release v3.1.6 (#2825)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-01 15:10:53 +08:00
LongYinan
e175512d43
fix(napi): async task finally is not called (#2824) 2025-08-01 15:05:08 +08:00
github-actions[bot]
e44329a059
chore(napi): release v3.1.5 (#2820)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-31 09:53:58 +08:00
LongYinan
10416f1b43
fix(napi): relax the lifetime restriction in PromiseRaw callbacks (#2819) 2025-07-31 09:51:10 +08:00
github-actions[bot]
045f0afedd
chore(napi): release v3.1.4 (#2818) 2025-07-31 07:01:10 +08:00
LongYinan
7a26a98ee9
fix(napi): the generic trait rectiction of Env::spawn should be ScopedTask (#2817) 2025-07-31 00:49:24 +08:00
github-actions[bot]
a40e2368e6
chore: release (#2814)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-30 11:56:41 +08:00
bde407ddab
fix(napi-derive): generate types for threadsafe_function with WEAK=true correctly (#2813) 2025-07-30 00:24:15 +08:00
github-actions[bot]
069661e91d
chore: release (#2805)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-24 21:41:32 +08:00
LongYinan
552f9c9ac4
chore(cli): setjmp link path (#2808) 2025-07-24 21:24:28 +08:00
Cong-Cong Pan
7c3dc968c1
perf(napi): optimize HashMap allocation in FromNapiValue implementation for HashMap (#2796)
* perf(napi): optimize HashMap allocation in FromNapiValue implementation for HashMap

* fix type

---------

Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-07-24 15:41:00 +08:00
github-actions[bot]
da45fc2d30
chore(napi): release v3.1.2 (#2795)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-22 18:02:31 +08:00
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