LongYinan
229128c3a7
chore(napi): make Object::from_raw pub ( #2645 )
...
- Close https://github.com/napi-rs/napi-rs/issues/2641
2025-05-17 22:47:23 +08:00
LongYinan
b1fb82dade
fix!(napi): unsound issues in Error ( #2644 )
...
- Close https://github.com/napi-rs/napi-rs/issues/1640
2025-05-17 22:44:24 +08:00
LongYinan
fddf6109b0
fix(napi): cleanup inner Stream when complete ( #2643 )
...
- Close https://github.com/napi-rs/napi-rs/issues/2604
2025-05-17 22:41:22 +08:00
LongYinan
8e481c1eba
style: clippy fix ( #2639 )
2025-05-16 22:24:11 +08:00
LongYinan
ce990542b9
fix(napi): module_exports binding ( #2632 )
2025-05-13 19:54:25 +08:00
LongYinan
8cd752db86
feat(napi): support #[napi(module_exports)] ( #2631 )
2025-05-13 17:47:52 +08:00
LongYinan
0a9980bad5
fix(napi): JsObjectValue::get_property signature ( #2628 )
...
* fix(napi): JsObjectValue::get_property signature
* debug
2025-05-12 12:20:06 +08:00
LongYinan
6548414b8f
feat(napi): add create_ref on JsObjectValue ( #2627 )
2025-05-12 00:38:31 +08:00
LongYinan
be00a9b017
feat(napi): impl full Uint8ClampedSlice type ( #2626 )
2025-05-12 00:35:34 +08:00
LongYinan
7a972425b8
fix(napi): nested Either and Promise validate logic ( #2625 )
...
- Close https://github.com/napi-rs/napi-rs/issues/2578
2025-05-12 00:33:14 +08:00
LongYinan
1c0f127178
fix(napi): reference leak in DeferredTrace ( #2624 )
2025-05-12 00:31:07 +08:00
LongYinan
653212ac7a
fix(napi): unused warning on JsString::from_raw ( #2622 )
...
* fix(napi): unused warning on JsString::from_raw
* Fix compile
2025-05-11 22:18:47 +08:00
LongYinan
9de545e7a2
refactor!(napi): add lifetime to Object ( #2619 )
2025-05-11 19:51:29 +08:00
LongYinan
65fe29c854
refactor!(napi): add lifetime to JsString ( #2614 )
2025-05-08 13:20:09 +08:00
LongYinan
c808386a8f
refactor!(napi): move JsBigint behind compat-mode feature ( #2613 )
...
* refactor!(napi): move JsBigint behind compat-mode feature
* reduce asan flaky
2025-05-08 12:04:02 +08:00
LongYinan
813c51e16a
refactor!(napi): move depracated types behind compat-mode feature flag ( #2612 )
2025-05-07 22:34:26 +08:00
LongYinan
23e9de2caa
refactor!(napi): add lifetime to Unkonwn ( #2611 )
...
Remove JsUnknown
2025-05-07 22:32:24 +08:00
LongYinan
ed9ca20daa
refactor!(napi): add lifetime for JsSymbol ( #2610 )
2025-05-07 20:12:19 +08:00
LongYinan
a456fcdbc7
refactor!(napi): add lifetime for JsNumber ( #2609 )
2025-05-07 20:11:33 +08:00
LongYinan
95832ff168
refactor!(napi): introduce JsValue and JsObjectValue trait ( #2606 )
...
Add lifetime for JsGlobal JsTimeout and JSON
2025-05-06 23:45:37 +08:00
LongYinan
bcf5e14aa8
feat(napi): add from_napi_value for Ref<T: FromNapiValue> ( #2603 )
2025-05-05 23:38:46 +08:00
LongYinan
674d7c7b56
refactor!(napi): add lifetime to Array ( #2599 )
2025-05-05 14:16:53 +08:00
LongYinan
4681ac927c
feat(napi): impl into_unknown for External ( #2598 )
2025-05-05 12:29:29 +08:00
Cong-Cong Pan
0ce726d9c7
feat(napi): serde value ref to napi_value ( #2550 )
...
* perf: convert serde value ref to napi_value
* chore: add test case
* fix: snapshot
2025-04-10 16:17:59 +08:00
LongYinan
3dd9143630
fix(napi): re-create async runtime ( #2519 )
2025-03-17 12:22:39 +08:00
Cong-Cong Pan
cc9989f4ac
fix(napi): js callback in threadsafefunction should not be Send ( #2510 )
2025-03-16 21:56:29 +08:00
LongYinan
1fe6ad0430
feat(napi): tokio multi-thread mode on wasi ( #2501 )
...
* feat(napi): tokio multi-thread mode on wasi
* tokio_unstable flag
* snapshot
* ensure runtime
* oncelock combine lazylock
* noop feature
2025-03-13 23:53:19 +08:00
Cong-Cong Pan
24e4662ff8
fix(napi): reference cannot impl send ( #2499 )
2025-03-11 19:07:51 +08:00
Cong-Cong Pan
920811f88a
chore(napi): SharedReference can be sync ( #2503 )
2025-03-11 19:07:24 +08:00
LongYinan
ee75b119cd
refactor!(napi): link crt1-reactor.o as poor man's wasi-exec-model=reactor ( #2480 )
2025-02-25 21:45:38 +08:00
LongYinan
ed6da2b741
fix(napi): compile error on noop feature ( #2478 )
2025-02-24 23:19:47 +08:00
LongYinan
86548570f2
fix(napi): compatible with Rust 1.85 ( #2477 )
...
Ref: https://github.com/rust-lang/rust/issues/137510
2025-02-24 20:14:12 +08:00
LongYinan
6ecc4503b5
Release independent packages
...
- napi@3.0.0-alpha.29
- napi-derive@3.0.0-alpha.27
2025-02-21 12:58:32 +08:00
LongYinan
d96bd288de
fix!(napi): upgrade to ctor 0.3.6 ( #2472 )
2025-02-20 12:22:29 +08:00
LongYinan
384dcac588
chore(napi): remove thread_local! in REFERENCE_MAP ( #2470 )
2025-02-16 18:08:04 +08:00
LongYinan
0ce8fab19c
chore(napi): merge thread cleanup ( #2469 )
2025-02-16 16:55:16 +08:00
LongYinan
13f4969ee2
chore: remove debug print
2025-02-11 18:12:50 +08:00
LongYinan
8d8ccdfc77
refactor!(napi): TypedArray API surfaces ( #2462 )
2025-02-11 13:35:43 +08:00
Zack Radisic
2d8e19d7c6
chore(napi): expose functions which turn raw pointer into External ( #2449 )
...
* Expose functions which turn raw pointer into External
* Add safety documentation
2025-02-03 13:03:29 +08:00
LongYinan
1868b0a214
chore: clippy fix ( #2433 )
2025-01-20 10:45:44 +08:00
LongYinan
05572bf1d4
feat(napi): allow create ReadableStream from polyfill ( #2424 )
2025-01-12 15:32:12 +08:00
LongYinan
73d5c1d803
fix(napi): add back Buffer/TypedArray custom gc on wasi ( #2421 )
2025-01-12 11:45:50 +08:00
LongYinan
35ebf8f7d4
fix(napi): remove feature flag on Object::new
2025-01-04 20:06:40 +08:00
LongYinan
98cb7671d3
feat(napi): impl ReadableStream and AsyncGenerator ( #2418 )
...
* feat(napi): impl ReadableStream and AsyncGenerator
* clippy fix
* Into<Vec<u8>> trait
* Skip node18 stream test due to Node.js bug
* Cleanup
* Also skip wasi test
* Merge test
* Skip wasi
* Useless expect-error
2025-01-03 17:09:42 +08:00
richerfu
a7c41f33ec
feat(napi): add get and try_get for FunctionCallContext ( #2409 )
...
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-02 17:14:53 +08:00
richerfu
5f7415c1fe
fix(napi): Function call with empty tuple should generate empty arguments ( #2407 )
...
Co-authored-by: LongYinan <lynweklm@gmail.com>
2025-01-02 17:10:53 +08:00
LongYinan
480f8cecd9
style(napi): code format
2025-01-02 16:59:36 +08:00
Stanisław Czech
b4b74d6f1f
refactor!(napi): arguments tuple behavior ( #2401 )
...
* Implement FromNapiValue trait as macro
Code behavior should remain the same, with much less copy-pasting of the same code.
Additionally, this commit adds a unit tests for test for FromNapiValue
for tuple trait which appears to be currently missing.
* Simplify macro arr_get
Rewrite the macro to reduce the size of expanded code of the macro
(from 4088 to 2429 lines). Although this is a minor change,
this may help reduce the size of compiled library.
* Refactor typegen Type::Path
Removes the need for keeping mutable variable, as its only assigned once.
* [API BREAKING] Update api for calling functions.
This commit introduces new type FnArgs,
that is created with the goal of distinguishing between
calling JS function from rust with tuple as argument
and calling with multiple arguments.
Currently there is no possibility to add ToNapiValue value,
as tuple is used to call callback functions with more than one
argument from rust.
With this change, callbacks with multiple arguments,
should be called, with converting tuple of argument
into FnArgs struct, either by calling into() on such
tuple, or by creating FnArgs struct directly.
* Add support for FnArgs when generating TS types
Updated the macro for generating typescript types,
to correctly handle FnArgs struct. This is now treated
as passthrough type and generates the output from the
type inside of FnArgs struct.
* Implement ToNapiValue trait for tuple
With the changes to callback calling API, it's now possible
to safely add this change. This change allows to pass tuple
from rust code to JS to match the existing FromNapiValue trait
currently existing in the library.
2025-01-02 16:58:58 +08:00
Cong-Cong Pan
24da4e6ffb
perf(napi): JsStringUtf8 take & into_owned & as_str fn ( #2404 )
2024-12-20 12:58:41 +08:00
LongYinan
8fffa49282
fix(napi): resuse threads worker on Node.js ( #2399 )
2024-12-18 23:48:30 +08:00