napi-derive
napi-derive@2.12.5
4/26/2023
What's Changed
- fix(napi-derive): increase initial ref count in async fn by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1577
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.12.4...napi-derive@2.12.5
napi-derive@2.12.4
4/25/2023
What's Changed
- feat: clean napi-derive
noop
feature code path by @forehalo (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1571
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.12.5...napi-derive@2.12.4
napi-derive@2.12.3
4/11/2023
Core features
#[napi(string_enum)]
pub enum Status {
Pristine,
Loading,
Ready,
}
⬇️⬇️⬇️⬇️⬇️
export const enum Status {
Pristine = 'Pristine',
Loading = 'Loading',
Ready = 'Ready'
}
What's Changed
- feat(napi-derive): add support for string enums by @nebarf (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1551
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.12.2...napi-derive@2.12.3
napi-derive@2.12.2
3/22/2023
What's Changed
- fix(cli,napi-derive): backward compatible with older cli with #1531 by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1536
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.12.1...napi-derive@2.12.2
napi-derive@2.12.1
3/21/2023
What's Changed
- fix(cli,napi-derive): re-export types from shared crate by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1531
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.12.0...napi-derive@2.12.1
napi-derive@2.12.0
3/21/2023
What's Changed
- feat: export registers in wasm32 target by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1529
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.11.4...napi-derive@2.12.0
napi-derive@2.11.2
3/14/2023
What's Changed
- chore(napi-derive): remove thread_local from dependenies by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1506
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.11.1...napi-derive@2.11.2
napi-derive@2.11.1
2/18/2023
Changes
- Part of https://github.com/napi-rs/napi-rs/releases/tag/%40napi-rs%2Fcli%402.14.8 by @forehalo (opens in a new tab)
Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.14.8...napi-derive@2.11.1
napi-derive@2.10.1
1/31/2023
What's Changed
- fix(napi-derive): incorrect Task output type in some cases by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1466
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.10.0...napi-derive@2.10.1
napi-derive@2.10.0
1/24/2023
Highlights
ThreadsafeFunction
as params and object fields
#[napi]
pub fn accept_callback(callback: ThreadsafeFunction<u32>) {
std::thread::spawn(move || {
callback.call(200);
});
}
⬇️⬇️⬇️⬇️⬇️
export function acceptCallback(callback: (err: Error | null, value: number) -> any)
Disable ToNapiValue
for Object
With the object_to_js = false
filed, the ThreadsafeFunction
could be set as an Object field.
#[napi(object, object_to_js = false)]
pub struct Options {
pub enable_jsx: bool,
pub on_data: ThreadsafeFunction<Vec<u8>>,
}
What's Changed
- feat(napi-derive): generate ThreadsafeFunction types by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1449
- feat(napi-derive): allow partial implement From/To Napivalue for Object by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1448
- chore(napi-derive): allow unsafe async &mut self by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1453
Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.14.4...napi-derive@2.10.0
napi-derive@2.9.5
1/14/2023
What's Changed
- fix(napi-derive): fix union type generation for ts function notation by @h-a-n-a (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1439
Full Changelog: https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@2.14.3...napi-derive@2.9.5
napi-derive@2.9.4
1/13/2023
What's Changed
- fix(napi-derive): remove ts type on field attrs for feature
noop
by @h-a-n-a (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1436
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.10.6...napi-derive@2.9.4
napi-derive@2.9.3
12/9/2022
What's Changed
- Better error message for
#[napi(catch_unwind)]
by @simonvandel (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1383
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.9.2...napi-derive@2.9.3
napi-derive@2.9.1
9/8/2022
What's Changed
- fix(napi-derive): should not generate this types for Constructor/Getter/Setter by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1291
- pin minimum usable version of dependency syn by @mat-if (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1293
New Contributors
- @mat-if (opens in a new tab) made their first contribution in https://github.com/napi-rs/napi-rs/pull/1293
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi@2.9.0...napi-derive@2.9.1
napi-derive@2.9.0
8/23/2022
What's Changed
- fix(napi-derive): fix macro expansion naming shadow by @JSerFeng (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1278
- feat(napi-derive): catch_unwind attribute by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1280
New Contributors
- @JSerFeng (opens in a new tab) made their first contribution in https://github.com/napi-rs/napi-rs/pull/1278
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.8.0...napi-derive@2.9.0
napi-derive@2.8.0
8/17/2022
What's Changed
- feat(napi-derive): implement instance_of for Class by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1272
- feat(napi-derive): support inject
This<Value>
into raw function by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1273
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.7.0...napi-derive@2.8.0
napi-derive@2.7.0
8/7/2022
What's Changed
- feat(napi-derive): support set property attribute in napi macro by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1257
- feat(napi-derive): Support
#[napi(strict)]
on&T
and&mut T
by @Hywan (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1238
napi-derive@2.6.0
7/6/2022
What's Changed
- feat(napi-derive): support return_if_invalid by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1219
- feat(napi-derive): allow injecting this in class method by @Brooooooklyn (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1221
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.5.0...napi-derive@2.6.0
napi-derive@2.5.0
6/10/2022
What's Changed
- Add
rust-version
field toCargo.toml
s by @messense (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1190 - feat(napi-derive): add ts_arg_type attribute to override individual args on functions by @jose-acevedoflores (opens in a new tab) in https://github.com/napi-rs/napi-rs/pull/1192
Full Changelog: https://github.com/napi-rs/napi-rs/compare/napi-derive@2.4.1...napi-derive@2.5.0