Skip to content

Commit d493faf

Browse files
authored
Merge pull request #1106 from neon-bindings/hotfix-1-1
Fix pre-napi-5 build
2 parents f829efe + 84265e0 commit d493faf

File tree

13 files changed

+38
-26
lines changed

13 files changed

+38
-26
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Our strong commitment to compatibility since the 1.0 release remains unchanged.
1010
that has not yet stabilized is published under feature flags, so the only breaking changes that we
1111
expect to publish are those that affect the unstable features, or, as always, safety bugfixes.
1212

13+
## Version 1.1.1
14+
15+
Hotfix for Node-API versions lower than 5 (https://github.com/neon-bindings/neon/pull/1106).
16+
1317
## Version 1.1.0
1418

1519
### New Features

codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
ignore:
22
- "bench"
33
- "test"
4+
coverage:
5+
status:
6+
project: off
7+
patch: off

crates/neon-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neon-macros"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
authors = ["Dave Herman <[email protected]>"]
55
description = "Procedural macros supporting Neon"
66
repository = "https://github.com/neon-bindings/neon"

crates/neon/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neon"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
authors = ["Dave Herman <[email protected]>"]
55
description = "A safe abstraction layer for Node.js."
66
readme = "../../README.md"
@@ -31,7 +31,7 @@ linkme = "0.3.33"
3131
semver = "1.0.20"
3232
smallvec = "1.11.2"
3333
once_cell = "1.18.0"
34-
neon-macros = { version = "=1.1.0", path = "../neon-macros" }
34+
neon-macros = { version = "=1.1.1", path = "../neon-macros" }
3535
aquamarine = { version = "0.3.2", optional = true }
3636
easy-cast = { version = "0.5.2", optional = true }
3737
doc-comment = { version = "0.3.3", optional = true }

crates/neon/src/context/internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub trait ContextInternal<'cx>: Sized {
5555
}
5656

5757
fn default_main(mut cx: ModuleContext) -> NeonResult<()> {
58-
#[cfg(feature = "tokio-rt-multi-thread")]
58+
#[cfg(all(feature = "napi-6", feature = "tokio-rt-multi-thread"))]
5959
crate::executor::tokio::init(&mut cx)?;
6060
crate::registered().export(&mut cx)
6161
}

crates/neon/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ pub fn registered() -> Exports {
209209
fn feature_matrix() {
210210
use std::{env, process::Command};
211211

212-
const NODE_API_VERSIONS: &[&str] = &[
213-
"napi-1", "napi-2", "napi-3", "napi-4", "napi-5", "napi-6", "napi-7", "napi-8",
214-
];
212+
// N.B.: Only versions that are used are included in order to keep the set
213+
// of permutations as small as possible.
214+
const NODE_API_VERSIONS: &[&str] = &["napi-1", "napi-4", "napi-5", "napi-6", "napi-8"];
215215

216216
const FEATURES: &[&str] = &["external-buffers", "futures", "serde", "tokio", "tokio-rt"];
217217

@@ -221,7 +221,7 @@ fn feature_matrix() {
221221
for version in NODE_API_VERSIONS.iter().map(|f| f.to_string()) {
222222
let features = features.iter().fold(version, |f, s| f + "," + s);
223223
let status = Command::new(&cargo)
224-
.args(["check", "-p", "neon", "--features"])
224+
.args(["check", "-p", "neon", "--no-default-features", "--features"])
225225
.arg(features)
226226
.spawn()
227227
.unwrap()

crates/neon/src/types_impl/extract/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn global_json_stringify<'cx>(cx: &mut Cx<'cx>) -> JsResult<'cx, JsFunction> {
3939
// method could cause differences between calls. However, threading a `Root` through
4040
// would require a significant refactor and "don't do this or things will break" is
4141
// fairly common in JS.
42-
fn json_stringify<'cx, C>(cx: &mut Cx<'cx>) -> JsResult<'cx, JsFunction> {
42+
fn json_stringify<'cx>(cx: &mut Cx<'cx>) -> JsResult<'cx, JsFunction> {
4343
global_json_stringify(cx)
4444
}
4545

crates/neon/src/types_impl/extract/private.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010
object::Object,
1111
result::{NeonResult, Throw},
1212
types::{
13-
extract::{Date, Error, TryIntoJs},
13+
extract::{Error, TryIntoJs},
1414
Value,
1515
},
1616
};
@@ -63,4 +63,7 @@ impl<T> Sealed for Ref<'_, T> {}
6363

6464
impl<T> Sealed for RefMut<'_, T> {}
6565

66-
impl_sealed!(u8, u16, u32, i8, i16, i32, f32, f64, bool, String, Date, Throw, Error,);
66+
#[cfg(feature = "napi-5")]
67+
impl Sealed for super::Date {}
68+
69+
impl_sealed!(u8, u16, u32, i8, i16, i32, f32, f64, bool, String, Throw, Error,);

crates/neon/src/types_impl/extract/try_from_js.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use crate::{
1212
result::{NeonResult, Throw},
1313
sys,
1414
types::{
15-
extract::{Date, TryFromJs, TypeExpected},
15+
extract::{TryFromJs, TypeExpected},
1616
private::ValueInternal,
1717
JsBoolean, JsNumber, JsString, JsValue, Value,
1818
},
1919
};
2020

2121
#[cfg(feature = "napi-5")]
22-
use crate::types::JsDate;
22+
use crate::types::{extract::Date, JsDate};
2323

2424
impl<'cx, V> TryFromJs<'cx> for Handle<'cx, V>
2525
where

0 commit comments

Comments
 (0)