Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(crate): update to neon 0.7, closes #64 #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

refactor(crate): update to neon 0.7, closes #64 #67

wants to merge 1 commit into from

Conversation

lucasfernog
Copy link

No description provided.

@joshuef
Copy link

joshuef commented Feb 2, 2021

@lucasfernog nice one.

Hey @GabrielCastro, are there any blockers to getting this merged? I'm looking at updating some old libs to new neon, but neon-serde support is a blocker.

Happy to help if there's anything that I can help with here.

thanks both! 🙇

Comment on lines -88 to -101
#[allow(use_debug)]
impl From<Error> for neon::result::Throw {
fn from(err: Error) -> Self {
if let ErrorKind::Js(_) = *err.kind() {
return neon::result::Throw;
};
let msg = format!("{:?}", err);
unsafe {
neon_runtime::error::throw_error_from_utf8(msg.as_ptr(), msg.len() as i32);
neon::result::Throw
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuef Thanks for doing the work of upgrading. I just started using this. Not having this trait means we can't use the ? operator for handling Result types. Is there a reason we cannot have this trait?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's explained here: https://docs.rs/neon/0.7.1/neon/result/struct.Throw.html

Kinda unfortunate though, breaks the export! macro. It uses ? and should be changed to handle errors properly. Couldn't tell you exactly how though.

@oeed
Copy link

oeed commented Feb 22, 2021

I am also in need of this, except using the N-API features, specified as such:

neon = { version = "0.7.1", default-features = false, features = ["default-panic-hook", "napi-6", "try-catch-api", "event-queue-api"] }

Is there any good way of exposing the features in this crate? Currently I've forked this and am hard coding the toml change, but it'd be nice to use the proper crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants