LongYinan
54a9654fae
fix(napi-derive): add paren for function types ( #3044 )
2025-12-02 14:56:17 +08:00
LongYinan
a10be50edb
fix(napi): shutdown runtime at env cleanup on windows ( #3026 )
2025-11-25 17:31:09 +08:00
LongYinan
2a34f77272
fix(napi): TypedArraySlice creation ( #3004 )
2025-11-07 21:22:48 +08:00
khj809
694db41895
feat(napi-derive): add discriminant_case to allow changing case of discriminant ( #2960 )
2025-10-23 10:25:17 +08:00
LongYinan
656bdca927
refactor(napi-derive): make typegen easier to read ( #2956 )
2025-10-11 14:46:38 +08:00
LongYinan
8f40ebd206
fix(napi): cleanup memory issues ( #2949 )
2025-10-05 19:35:20 +08:00
richerfu
9df9f890f7
feat(napi): add on_abort for AbortSignal ( #2942 )
...
* feat(napi): add on_abort for AbortSignal
* chore: upgrade example code
* fix: fix lint error
* fix: fix lint error
* Update examples/napi/src/task.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update crates/napi/src/bindgen_runtime/js_values/task.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fmt
---------
Co-authored-by: LongYinan <lynweklm@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-03 16:14:32 +08:00
LongYinan
38b0b42592
chore: fix rust 1.90 behavior ( #2932 )
2025-09-19 19:44:42 +08:00
LongYinan
08869f5e7f
fix(napi): node_api_create_external_string_utf16 on wasm ( #2912 )
2025-09-08 22:37:33 +08:00
LongYinan
3894db5e42
fix(napi): JsStringUtf8 memory leak ( #2911 )
2025-09-08 13:45:17 +08:00
LongYinan
484ca281dd
feat(napi): implement from_static on JsStringLatin1 and JsStringUtf16 ( #2908 )
2025-09-05 12:48:41 +08:00
LongYinan
07380dfe49
feat(napi): support external JsStringLatin1 and JsStringUtf16 ( #2898 )
2025-09-01 10:40:40 +08:00
lghuahua
9d338543b9
chore(napi): extends the Set types interoperability ( #2875 )
2025-08-15 19:12:46 -07:00
LongYinan
cf5807f9f9
fix(napi-derive): codegen issue for &'env [u8] param ( #2881 )
2025-08-15 05:18:51 -07:00
LongYinan
bcef141990
fix(napi-derive): comments idents regression ( #2857 )
2025-08-09 23:02:07 +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
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
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
LongYinan
1e30088198
fix(wasm-runtime): avoid wasm-util from tree shaking by rollup ( #2810 )
...
* fix(wasm-runtime): avoid wasm-util from tree shaking by rollup
* fix filename
2025-08-07 12:55:48 +08: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
LongYinan
e175512d43
fix(napi): async task finally is not called ( #2824 )
2025-08-01 15:05:08 +08:00
LongYinan
10416f1b43
fix(napi): relax the lifetime restriction in PromiseRaw callbacks ( #2819 )
2025-07-31 09:51:10 +08:00
翠
bde407ddab
fix(napi-derive): generate types for threadsafe_function with WEAK=true correctly ( #2813 )
2025-07-30 00:24:15 +08:00
LongYinan
bb9883ab09
fix(napi-derive): lifetime codegen issue ( #2794 )
2025-07-22 17:54:18 +08:00
LongYinan
1ca2bad43f
feat(napi): provide ScopedTask to resolve JsValue with lifetime ( #2786 )
2025-07-21 13:55:44 +08:00
LongYinan
485befffcb
chore(example): add define_class example ( #2765 )
2025-07-06 21:43:35 -07: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
LongYinan
99f4c089d4
feat(napi): add napi_ref impl for Object Symbol and External ( #2754 )
2025-07-01 00:45:32 -07:00
LongYinan
092f887f39
fix(napi-derive): generate object key types properly ( #2752 )
2025-06-30 17:10:17 +08:00
LongYinan
2273031264
test(napi): add fixture for #2746 ( #2747 )
2025-06-25 22:35:25 +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
3dce1533fd
test(napi): add fixture for re-export complex class ( #2733 )
2025-06-24 16:31:26 +08:00
LongYinan
1486b1f174
test(napi): add complex pub type fixture ( #2732 )
2025-06-24 15:37:43 +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
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
d5a16483c5
fix(napi-derive): Either<f64, u32> should generate number ts type ( #2683 )
2025-06-02 23:53:14 +08:00
Hana
f4731bb566
feat!(napi): support custom tsfn result error code ( #2672 )
2025-06-02 22:47:50 +08:00
Cong-Cong Pan
9173e8eb28
feat!(napi): define propertes support symbol as name ( #2673 )
...
* feat: define properties support symbol as name
* fix
* fix
2025-05-30 23:37:19 +08:00
LongYinan
3a720f09cf
feat(sys): sync Node-API version changes ( #2661 )
...
* feat(sys): sync Node-API version changes
* upgrade electron
* move node_api_create_buffer_from_arraybuffer to experimental
2025-05-25 00:48:56 +08:00
LongYinan
f8fab45de7
feat(napi): serialize BigInt to serde::Value ( #2659 )
2025-05-24 23:18:40 +08:00
LongYinan
3c5f22001b
fix(napi): wrong error status in ThreadsafeFunction callback ( #2656 )
2025-05-22 17:24:46 +08:00
LongYinan
7182db3a81
feat(napi): EscapableHandleScope API ( #2652 )
2025-05-19 19:52:21 +08:00
LongYinan
92b094e487
feat(napi): new handle scope API ( #2650 )
2025-05-18 23:16:40 +08:00