Commit graph

19 commits

Author SHA1 Message Date
LongYinan
120accd965
feat: add wasm runtime package (#1904) 2024-01-16 23:28:40 +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
6d62b3f714
chore: upgrade dependencies (#1657) 2023-07-17 14:56:02 +08:00
LongYinan
53cf696cf8
ci: reduce the complex of CI config (#1628) 2023-06-17 17:03:57 +08:00
forehal
a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00
Bo
e47c13f177
fix(napi): check if the tokio runtime exists when registering the module
And recreate it if it does not exist.

In windows, electron renderer process will crash if:
1. Import some NAPI module that enable `tokio-rt` flag in renderer process.
2. Reload the page.
3. Call a function imported from that NAPI module.

Because the tokio runtime will be dropped when reloading the page, and won't create again, but currently we assume that the runtime must exist in tokio-based `within_runtime_if_available`.
This will cause some panic like this:

```
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', napi-rs\crates\napi\src\tokio_runtime.rs:72:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Renderer process crashed: crashed, exitCode: -529697949
    at EventEmitter.<anonymous> (napi-rs\examples\napi\electron.js:33:9)
    at EventEmitter.emit (node:events:525:35)
```
2023-03-28 12:03:00 +08:00
LongYinan
62b16d6a89
chore: upgrade npm dependencies (#1443) 2023-01-19 00:32:52 +08:00
LongYinan
4c3fe26478
feat(cli): refactor cli build 2021-11-19 18:22:40 +08:00
forehalo
2467b7139b
Introduce #[napi] procedural macro to automation development boilerplate (#696)
* napi procedural macro for basic rust/JavaScript types
* introduce the `compat-mode` for `napi` and `napi-derive` crates for backward compatible
* remove #[inline] and let compiler to decide the inline behavior
* cli now can produce the `.d.ts` file for native binding
* many tests and example for the new procedural macro

Co-authored-by: LongYinan <lynweklm@gmail.com>
2021-09-23 01:29:09 +08:00
LongYinan
67ad0a4d4d
feat(cli): upgrade clipanion v3
Remove napi new command
2021-08-07 00:23:17 +08:00
LongYinan
72960906dc
ci: add memory leak detect job 2021-05-29 23:24:25 +08:00
LongYinan
5a49efe25e
feat: support linux aarch64 2020-10-15 09:12:43 +08:00
LongYinan
24919d72be
ci: write ava.config for ava@2 2020-10-14 11:44:37 +08:00
LongYinan
fb4d07edd4
feat: add benchmark crate and frameworks 2020-09-30 15:31:17 +08:00
LongYinan
e68778428e
feat: powerful cli 2020-09-04 17:11:23 +08:00
LongYinan
494e870226
build: fix ts file build 2020-08-24 17:06:26 +08:00
LongYinan
100ad98407
refactor(test_module): migrate tests to TypeScript 2020-08-24 16:55:54 +08:00
LongYinan
5a0b9919ea
test(napi): add class specs 2020-08-02 23:31:22 +08:00
LongYinan
2073f23a91
feat(cli): start new cli 2020-07-29 23:06:37 +08:00