A framework for building compiled Node.js add-ons in Rust via Node-API
OTHER License
Bot releases are hidden (Show)
Published by Brooooooklyn over 2 years ago
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.3
Published by Brooooooklyn over 2 years ago
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.3
Published by Brooooooklyn over 2 years ago
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.2
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.2
Published by Brooooooklyn over 2 years ago
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.1
Published by Brooooooklyn over 2 years ago
cannot find trait ToNapiValue
error by @U-C-S in https://github.com/napi-rs/napi-rs/pull/1136
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.3.1
Published by Brooooooklyn over 2 years ago
from_unknown
method on FromNapiValue @BrooooooklynReference
@BrooooooklynSend
& Sync
safe @BrooooooklynCARGO_BUILD_TARGET
in debian.Dockerfile @Brooooooklynuse napi::bindgen_prelude::*;
pub struct Repository {
dir: String,
}
impl Repository {
fn remote(&self) -> Remote {
Remote { inner: self }
}
}
pub struct Remote<'repo> {
inner: &'repo Repository,
}
impl<'repo> Remote<'repo> {
fn name(&self) -> String {
"origin".to_owned()
}
}
#[napi]
pub struct JsRepo {
inner: Repository,
}
#[napi]
impl JsRepo {
#[napi(constructor)]
pub fn new(dir: String) -> Self {
JsRepo {
inner: Repository { dir },
}
}
#[napi]
pub fn remote(&self, reference: Reference<JsRepo>, env: Env) -> Result<JsRemote> {
Ok(JsRemote {
inner: reference.share_with(env, |repo| Ok(repo.inner.remote()))?,
})
}
}
#[napi]
pub struct JsRemote {
inner: SharedReference<JsRepo, Remote<'static>>,
}
#[napi]
impl JsRemote {
#[napi]
pub fn name(&self) -> String {
self.inner.name()
}
}
const repo = new JsRepo('.')
t.is(repo.remote().name(), 'origin')
Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]@2.3.0
Published by Brooooooklyn over 2 years ago
Reference
API to keep class reference alive with JavaScript instance.Reference
into parameters like Env
.Reference
API.Buffer
now can be used in struct which is implemented Task
trait.use napi::bindgen_prelude::*;
pub struct Repository {
dir: String,
}
impl Repository {
fn remote(&self) -> Remote {
Remote { inner: self }
}
}
pub struct Remote<'repo> {
inner: &'repo Repository,
}
impl<'repo> Remote<'repo> {
fn name(&self) -> String {
"origin".to_owned()
}
}
#[napi]
pub struct JsRepo {
inner: Repository,
}
#[napi]
impl JsRepo {
#[napi(constructor)]
pub fn new(dir: String) -> Self {
JsRepo {
inner: Repository { dir },
}
}
#[napi]
pub fn remote(&self, reference: Reference<JsRepo>, env: Env) -> Result<JsRemote> {
Ok(JsRemote {
inner: reference.share_with(env, |repo| Ok(repo.inner.remote()))?,
})
}
}
#[napi]
pub struct JsRemote {
inner: SharedReference<JsRepo, Remote<'static>>,
}
#[napi]
impl JsRemote {
#[napi]
pub fn name(&self) -> String {
self.inner.name()
}
}
const repo = new JsRepo('.')
t.is(repo.remote().name(), 'origin')
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Date <-> chrono::DateTime<Utc>
by @simonvandel in https://github.com/napi-rs/napi-rs/pull/1069
clippy::needless_late_init
lint by @messense in https://github.com/napi-rs/napi-rs/pull/1080
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.2.0
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago
get_js_function
by @Brooooooklyn in https://github.com/napi-rs/napi-rs/pull/1048
String
roundtrip with interior nul bytes by @messense in https://github.com/napi-rs/napi-rs/pull/1056
BigInt
issue with zero value by @messense in https://github.com/napi-rs/napi-rs/pull/1058
FromNapiValue
for serde_json::Number
, fix it for Null
, throw for impossible types by @AlCalzone in https://github.com/napi-rs/napi-rs/pull/1052
with_value
method on Property
by @Brooooooklyn in https://github.com/napi-rs/napi-rs/pull/1064
JsDate
as Date
in prelude by @Brooooooklyn in https://github.com/napi-rs/napi-rs/pull/1065
Uint8ClampedArray
by @Brooooooklyn in https://github.com/napi-rs/napi-rs/pull/1066
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.1.0
Published by Brooooooklyn over 2 years ago
ts_type
attribute to override typescript type for fields in structs by @jose-acevedoflores in https://github.com/napi-rs/napi-rs/pull/1041
Option
in front of a required parameter is no … by @JoostK in https://github.com/napi-rs/napi-rs/pull/1043
get_js_function
by @Brooooooklyn in https://github.com/napi-rs/napi-rs/pull/1048
Full Changelog: https://github.com/napi-rs/napi-rs/compare/[email protected]@2.1.0
Published by Brooooooklyn over 2 years ago
Published by Brooooooklyn over 2 years ago