Releases: neon-bindings/neon
v1.0.0
Commitment to Compatibility
The release of Neon 1.0 marks our commitment to backwards-compatibility: starting with 1.0.0, Neon users can be confident that future upgrades to Neon 1.x versions should never require code changes (with the possible exception of safety bugfixes, which we expect to be rare). We also do not anticipate releasing new major versions often and do not have any plans to do so for now.
Breaking Changes
- Remove the generic parameter from
JsFunction
(#989) JsArray::new
takes ausize
instead of au32
(#988)- Made
Context::global
read a key and addedContext::global_object
(#987) - Deprecated feature flags were removed
Bug fixes
- Fix
unhandledRejection
withJsPromise::to_future
(#1008) - Typo in
cargo-cp-artifact
help (#998) - Typo in README (#1012)
Other
- Relaxed error behavior on missing Node-API symbols. Neon will panic on first use instead of aborting the process at module load time.
- Bumped dependency versions
- Changed to edition 2021
- Updated support matrix to Node 18, 20, and 21
v1.0.0-alpha.4
Patch to enable new feature flags in docs.rs.
v1.0.0-alpha.3
Breaking Changes
- Removed
Managed
trait
Improvements
- Added
JsBigInt
(#963). - Added UTF-16 functions to
JsString
(#944). - Relaxed
Send
constraints (#979) - Lifecycle support for 32-bit (#977)
- Added
sys
feature (#970)
Bug Fixes
- Fix a scope leak in release builds (#952).
Docs
- Examples added for many types ((#942)).
cargo-cp-artifact
0.1.8
fixes sending additional arguments on Windows (#972).
v1.0.0-alpha.2
Breaking Changes
neon::object::This
Trait neon::object::This
has been removed. This
was primarily added for use with the declare_types!
macro to generate classes. The macro was removed and This
is no longer needed. Additionally, the This
argument on JsFunction
was found to be invalid because it asserted at compile time a type for this
that could change at runtime. (Note that this was not unsound because the type would be checked by Node-API and result in a panic
.)
JsFunction::this
JsFunction::this
was changed to perform a downcast and be fallible. This is in line with similar APIs (e.g., Object::get
). Additionally, an infallible version, JsValue::this_value
was added that does not perform a downcast.
Added Feature flag for external buffers
Electron began using pointer compression on JavaScript values that is incompatible with external buffers. As a preventative measure, JsArrayBuffer::external
and JsBuffer::external
have been placed behind a feature flag that warns of Electron incompatibility.
Improvements
- Lifetimes were relaxed on
execute_scoped
to allow valid code to compile. (#919) - Added a
from_slice
helper onTypedArray
(#925) JsTypedArray
construction and type aliases (#909)
Bug Fixes
- Fixed a panic on VM shutdown when using
Channel
(#934) - Type tags were added to
JsBox
to prevent undefined behavior when multiple native add-ons are used (#907)
Docs
- Significantly improved documentation of
TypedArray
(#909) - Removed unused values in
Channel
docs (#925)
cargo-cp-artifact
0.1.7
includes a fix to unlink .node
files before copying to address common code signing errors on macOS (#921).
v1.0.0-alpha.1
Pre-release of a major milestone for Neon. 1.0.
Breaking Changes
Major
- Removed the legacy backend; only Node-API is supported going forward (#881)
- Removed
neon::result::JsResultExt
in favor of more generalneon::result::ResultExt
(#904)
Minor
- Length APIs (
argument
,argument_ops
,len
) useusize
instead ofi32
(#889) - Deprecate feature flags for accepted RFCs (#872)
neon::meta::version
returnssemver@1
version instead of0.9
(#912)
Features
- Add
Object.freeze
andObject.seal
(#891) - Futures RFC (#872) Implementation (#874)
- Await
JoinHandle
from sending an event on aChannel
- Adapt
JsPromise
toJsFuture
- Await
- API for thread-local data (i.e., instance data) (#902)
- Add Object::call_with() convenience method to call a method on an object (#879)
Bug Fixes
- Relax the lifetime constraints on
TypedArray
borrows (#877) - Allowing missing symbols at load time to support bun (#914)
- Prevent a panic when an async event is called after the JavaScript runtime has stopped (#913)
- Fix a soundness hole in
JsArrayBuffer::external
andJsBuffer::external
(#897)
Docs
Internal
v0.10.1
Fix a soundness hole in JsArrayBuffer::external
and JsBuffer::external
(#897).
Thanks to @Cassy343 for finding the issue!
In previous versions of Neon, it was possible to create a JsArrayBuffer
or JsBuffer
that references data without the 'static
lifetime.
pub fn soundness_hole(mut cx: FunctionContext) -> JsResult<JsArrayBuffer> {
let mut data = vec![0u8, 1, 2, 3];
// Creating an external from `&mut [u8]` instead of `Vec<u8>` since there is a blanket impl
// of `AsMut<T> for &mut T`
let buf = JsArrayBuffer::external(&mut cx, data.as_mut_slice());
// `buf` is still holding a reference to `data`!
drop(data);
Ok(buf)
}
v0.10.0
See the Neon 0.10 Migration Guide for more details about new features and breaking changes.
Features
- New buffer borrowing API
- Added JoinHandle for
Channel::send
JsPromise
andTaskBuilder
- Handle panics and exceptions in Channels and Tasks
- Function call / construct builders
and simplify low level call - Create functions from closures
Minor Improvements
- Performance improvements
- Rename N-API to Node-API in docs to match Node changes
- Remove unused cslice dependency
- Switch to
syn-mid
for faster compile times - Downcast in
Object::get
- Added migration guide
- Added
Object::get_opt
andObject::get_value
Fixes
- [Safety] Make it harder to store and forge Throw
- [Soundness] Make
JsValue
types!Copy
- [Soundness] Tag
Root
with instance id create-neon
no longer leaves partial project on disk- Fix legacy backend on Electron and Windows
- FreeBSD support on legacy backend
Internal Improvements
- Replace Electron tests with Playwright
- Re-organize Neon into an npm workspace
- Fix crates.io badge
- Doc test fixes
- Fix broken link in the README
v0.10.0-alpha.2
- Implements
JsPromise
andTaskBuilder
RFC - Adds
JoinHandle
return type toChannel::send
v0.10.0-alpha.1
Implements the Borrow RFC.