napi-rs

A framework for building compiled Node.js add-ons in Rust via Node-API

OTHER License

Downloads
6.9M
Stars
5.4K
Committers
119

Bot releases are hidden (Show)

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Feature

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Feature

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Bugfix

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Bugfix

  • fix(napi): finalizer maybe_ref pointer value f45f1ae
  • Add a way to convert stateful (Rust) closures into JsFunction 4aba159

Docs

  • Remove deprecated register_module from example in README.md 5527451
napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Bugfix

  • fix(napi): napi_adjust_external_memory issue on wini686. 1e3290c
napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Bugfix

  • fix(napi): InvalidArg error when create_external with size hint. 50f207f
napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Breaking changes

Module register

The old way:

register_module!(test_module, init);

fn init(module: &mut Module) -> Result<()> {
  // ....
  Ok(())
}

The new way:

#[module_exports]
fn init(mut exports: JsObject) -> Result<()> {
  // ...
  Ok(())
}

or

#[module_exports]
fn init(mut exports: JsObject, env: Env) -> Result<()> {
  // ...
  Ok(())
}

Task

- pub trait Task: Send {
+ pub trait Task: Send + Sized {
    type Output: Send + Sized + 'static;
    type JsValue: NapiValue;


-   fn compute(&self) -> Result<Self::Output>;
+   fn compute(&mut self) -> Result<Self::Output>;


-   fn resolve(&self, env: &mut Env, output: Self::Output) -> Result<Self::JsValue>;
+   fn resolve(self, env: Env, output: Self::Output) -> Result<Self::JsValue>;


+   fn reject(self, _env: Env, err: Error) -> Result<Self::JsValue> {
+     Err(err)
+   }
}

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Feature

napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Feature

  • feat(napi): unwrap &'static value from Ref object e622d96
  • feat(napi): add back clone trait to ThreadsafeFunction 071dcff
napi-rs - @napi-rs/[email protected]

Published by Brooooooklyn over 3 years ago

Bug Fixes

  • cli: new command without npm scope (5ef1887)
napi-rs - @napi-rs/[email protected]

Published by Brooooooklyn over 3 years ago

Bug Fixes

  • cli: mkdir -p is not valid command in powershell (84a6ea9)
napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

  • chore: upgrade tokio to v1.1
napi-rs - [email protected]

Published by Brooooooklyn over 3 years ago

Bugfix

  • fix(napi): throw JavaScript error in tsfn rather than rust thread panic f46aa1f
napi-rs - [email protected]

Published by Brooooooklyn almost 4 years ago

Feature

  • Implement Copy and Clone trait for JavaScript Primitive types. c121537

Bugfix

  • Remove unexpected into_*_ref from JsString. e24738a
napi-rs - @napi-rs/[email protected]

Published by Brooooooklyn almost 4 years ago

Bug Fixes

  • cli: fix random node process got killed issue (58d4634)
napi-rs - [email protected]

Published by Brooooooklyn almost 4 years ago

  • Implement Env::create_arraybuffer_with_borrowed_data for FFI scenario.
napi-rs - [email protected]

Published by Brooooooklyn almost 4 years ago

Fix

napi-rs - [email protected]

Published by Brooooooklyn almost 4 years ago

Chore

  • Upgrade ureq to 2.0