Commit graph

228 commits

Author SHA1 Message Date
ebe97257a6
feat(napi-derive): add use_nullable attribute (#1971)
* feat(napi-derive): add use_nullable attribute

Co-authored-by: naskya <m@naskya.net>

* chore(napi-derive): update tests

Co-authored-by: naskya <m@naskya.net>

---------

Co-authored-by: naskya <m@naskya.net>
2024-02-24 21:49:54 +08:00
Louis
43415251b8
feat(napi): allow Reference as a class method param (#1966)
As of before this commit, there was a lock in the codegen preventing Reference
from being used as a function argument outside of a Reference<Self>.

This changes it, allowing Reference of any class to be added as a class method
argument anywhere. It has the same limitations as reference, as in it requires
the class to have been created with a factory or constructor. This change
implements FromNapiValue on Reference, which will unwrap the class and call the
existing from_value_ptr method. It also updated typegen so that we only emit
the reference type if we're in an impl block that doesn't match the Reference
we're getting. This ensures that typegen works as expected with the previous
behaviour.
2024-02-22 22:37:50 +08:00
LongYinan
20e0983288
style: apply clippy fix (#1953) 2024-02-17 14:12:24 +08:00
LongYinan
5ac153388f
feat(napi): accept slice as TypedArray (#1951) 2024-02-15 23:40:45 +08:00
LongYinan
d7dc4dc5a2
feat(napi): extends the Map types interoperability (#1950) 2024-02-15 15:43:21 +08:00
LongYinan
0007e3aaf6
chore: upgrade all dependencies (#1933) 2024-02-01 12:14:56 +08:00
LongYinan
f69771e2d4
fix(napi-derive): JsArrayBuffer generated type 2024-01-26 14:32:24 +08:00
LongYinan
5be7ab0f6b
feat(napi): new Function/FunctionRef API 2024-01-26 02:27:46 +00:00
LongYinan
44dc39f1f0
fix(cli,wasm-runtime): dependencies (#1905) 2024-01-17 00:57:29 +08:00
LongYinan
120accd965
feat: add wasm runtime package (#1904) 2024-01-16 23:28:40 +08:00
LongYinan
78de67e08f
chore: bump memfs-browser (#1900) 2024-01-16 11:10:55 +08:00
LongYinan
fc3d5cbcff
fix(cli): add browser entry (#1899) 2024-01-10 11:18:13 +08:00
LongYinan
a6934ab041
chore: fix generated .d.ts file 2024-01-09 00:58:41 +08:00
LongYinan
9b8dab6b63
fix(cli): missing files in created wasi package (#1894) 2024-01-09 00:34:59 +08:00
LongYinan
7d3b53d41d
feat(cli): support generate browser compatible codes (#1891) 2024-01-08 21:02:46 +08:00
LongYinan
b0ba466f95
fix(cli): also load wasm file from packages (#1876) 2023-12-30 00:43:38 +08:00
LongYinan
43a080d52b
fix(napi): apply clippy suggestions (#1878) 2023-12-29 23:08:56 +08:00
LongYinan
84f3092d70
fix(napi-derive): proc-macro crash on enum (#1870) 2023-12-27 21:18:02 +08:00
LongYinan
02dd4c3fd3
fix(napi-derive): catch_unwind on constructor (#1869)
- Close https://github.com/napi-rs/napi-rs/issues/1852
2023-12-27 12:49:10 +08:00
LongYinan
c42f00ff43
feat(cli): support wasi target test & release workflow (#1867) 2023-12-26 23:16:42 +08:00
liuyi
6f40f94d09
fix(napi-derive): more accurate napi expanding error (#1854) 2023-12-13 15:23:00 +08:00
liuyi
e32c105a26
fix(napi-derive): upgrade syn (#1849) 2023-12-13 12:40:01 +08:00
LongYinan
dab4ce7fe0
fix(napi-derive,cli): register function cross crates (#1848) 2023-12-11 00:36:26 +08:00
LongYinan
db89395966
chore: upgrade all npm dependencies (#1843) 2023-12-06 19:41:21 +08:00
LongYinan
d5ecf90d29
feat(cli): change wasm binding output format to cjs (#1831) 2023-11-30 23:21:49 +08:00
LongYinan
440bea29f8
test(napi): decrease the worker sizes on Linux x64 musl platform 2023-11-20 23:07:43 +08:00
LongYinan
8a9c42a985
fix(napi): compile error for wasm32-unknown-unknown target
- Close https://github.com/napi-rs/napi-rs/issues/1816
2023-11-20 17:10:58 +08:00
LongYinan
8c911b5d34
chore: upgrade emnapi dependencies (#1817) 2023-11-19 15:13:06 +08:00
LongYinan
8ddd35c788
fix(cli): wrong wasm file name with --platform flag (#1798) 2023-11-08 20:08:28 +08:00
LongYinan
e930a6aab3
fix(napi-derive): async task optional output type (#1796) 2023-11-08 20:06:27 +08:00
LongYinan
938f4df83d
fix(napi-derive): async task void output type (#1795) 2023-11-08 20:05:09 +08:00
LongYinan
36581336c6
feat(napi): pass the rest of async tests (#1792)
Pass the rest of async tests, including await the JavaScript Promise in the Rust side, and the worker_threads tests.
2023-11-07 01:46:43 +08:00
LongYinan
feabcd7f16
test(napi): add tests for napi9 features (#1784) 2023-11-06 11:03:44 +08:00
LongYinan
546b108a5b
feat(napi): support async class factory (#1779)
- Close https://github.com/napi-rs/napi-rs/issues/1777
2023-11-06 10:58:23 +08:00
LongYinan
0dc1ef738b fix(napi): asan caught memory safety issue 2023-11-04 15:26:07 +08:00
LongYinan
7a3cd77bc8
ci: add YARN_IGNORE_NODE on macOS arm64 build 2023-11-02 20:32:36 +08:00
LongYinan
13d0ce075e
feat: integrate with emnapi (#1669)
* Integrate with emnapi

* resolve conflict

* ignore wasm

* generate wasi file

* Add wasi test to workflow

* Fix wasi template

* emnapi new initialize api

* Finish test

* Purne tsconfig

* Generate wasi worker

* Fix electron test

* Finalize check

* Noop adjust_external_memory

* Apply cr suggestions
2023-11-02 12:57:11 +08:00
LongYinan
69c0223b9b
test: reduce memory usage while testing aginst worker thread (#1769) 2023-11-02 00:44:08 +08:00
LongYinan
2e03db1fec
test: refactor the example tests to esm, add bun:test => ava polyfill (#1730) 2023-09-20 01:18:01 -07:00
Tom Sherman
3418fd3e8f
feat(napi,sys): implement Symbol.for (#1721)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2023-09-13 15:45:14 -07:00
yoogo
4259e85e0e fix(backend): attribute of a struct marked as #[napi(constructor)] contain Rust keywords, causing to throw is not a valid identifier when generating getters and setters 2023-08-17 20:48:54 +08:00
LongYinan
a7eeb0c31c
fix(napi): promise resolve error (#1664) 2023-07-24 00:36:24 +08:00
LongYinan
6d62b3f714
chore: upgrade dependencies (#1657) 2023-07-17 14:56:02 +08:00
Markus
73a704a19e
feat(napi): keep stack traces in a deferred context (#1637)
* feat(napi): keep stack traces in deferred context

* chore: reformat code

Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>

* chore: use napi wrappers

Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>

* test(napi): add test for deferred trace

Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>

* chore: fix format

Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>

---------

Signed-off-by: Markus <28785953+MarkusJx@users.noreply.github.com>
2023-07-15 12:07:14 +08:00
LongYinan
53cf696cf8
ci: reduce the complex of CI config (#1628) 2023-06-17 17:03:57 +08:00
LongYinan
c6258cf633
feat(napi): support chrono::NaiveDateTime (#1601) 2023-05-26 18:28:34 +08:00
LongYinan
5bc098144c
chore(example): add callback return promise (#1590) 2023-05-16 11:05:37 +08:00
LongYinan
d9c191d270
test(napi): skip worker tests in slow Docker env (#1569) 2023-04-16 23:59:15 +08:00
LongYinan
d9ff0b4ddf
fix(napi): do nothing in deferred if thread is destroyed (#1568) 2023-04-15 18:58:53 +08:00
LongYinan
d14fdca242
fix(napi): thread safe issue while creating class instance (#1561) 2023-04-15 15:37:01 +08:00