Skip to content

Commit

Permalink
Update rusty v8 to v0.100.0 (#43)
Browse files Browse the repository at this point in the history
* feat: update rusty_v8 version to v0.100.0

* feat: update version to v0.5.7

* feat: update function casting since v8 breaking change

* fix: documentation
  • Loading branch information
Valerioageno authored Jul 26, 2024
1 parent 4202394 commit e284727
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ssr_rs"
version = "0.5.6"
version = "0.5.7"
authors = ["Valerio <valerioageno@yahoo.it>"]
edition = "2021"
description = "Server side rendering with the v8 engine for parse and evaluate the javascript code"
Expand All @@ -22,7 +22,7 @@ name = "ssr_rs"
path = "src/lib.rs"

[dependencies]
v8= "0.96.0"
v8= "0.100.0"

[dev-dependencies]

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 4](https://svelte.dev/) - Check the <a href="https://github.com/Valerioageno/ssr-rs/blob/main/examples" target="_blank">examples</a> folder.
//!
//! > Check <a href="https://github.com/Valerioageno/ssr-rs/blob/main/benches">here</a> the
//! benchmarks results.
//! > benchmarks results.
//!
//! # Getting started
//! ```bash
Expand Down
4 changes: 1 addition & 3 deletions src/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,12 @@ where
None => return Err("Failed to get function from obj"),
};

let func = unsafe { v8::Local::<v8::Function>::cast(func) };

let fn_name = match name.to_string(&mut scope) {
Some(val) => val.to_rust_string_lossy(&mut scope),
None => return Err("Failed to find function name"),
};

Ok((fn_name, scope.escape(func)))
Ok((fn_name, scope.escape(func.cast())))
},
)
// TODO: collect directly the values into a map
Expand Down

0 comments on commit e284727

Please sign in to comment.