Bromeon / js-sandbox

Securely embed JavaScript code into a Rust application
zlib License
274 stars 17 forks source link

Update Deno #29

Open flixx opened 6 months ago

flixx commented 6 months ago

Hi @Bromeon

currently, the package is dependent on Deno 0.209.0. Do you have a plan to upgrade to that? I've read in one of your other comments somewhere, that it's difficult. Can you elaborate? What would need to get done? What could be done to help you?

Background:

We are currently stuck with an old version of js-sandbox, because we're getting some weird SEGFAULTs in some environments in v0.2.0-rc.2. We tried already hard to debug - we suspect the problem to be somewhere in the currently used Deno version.

Best, Felix

Bromeon commented 6 months ago

Last time I tried, the "op" API changed completely (which is needed to transport values back from JS to Rust). It would take some time to research how the equivalent would look in newer deno_core versions.

Some help in that regard would be appreciated, in case you want to try upgrading the version (only if you have the time, of course). It's possible that I overlooked something simple as well... 🤔

rscarson commented 5 months ago

I hope this isn't out of order but I maintain rustyscript, a similar crate that currently uses the latest version of the deno core.

It might be an option for you in the interim - migration should be fairly straightforward

Bromeon commented 5 months ago

@rscarson How did you get the ops working in latest deno_core? (Assuming you use the same mechanism as js-sandbox) 🙂

rscarson commented 5 months ago

@rscarson How did you get the ops working in latest deno_core? (Assuming you use the same mechanism as js-sandbox) 🙂

Have you tried the op2 macro?

You can see a macro in one of my examples here: [https://github.com/rscarson/rustyscript/blob/master/examples/ext/example_extension.rs]

And how to actually use it here: [https://github.com/rscarson/rustyscript/blob/master/examples/runtime_extensions.rs]

Bromeon commented 5 months ago

What happened to your request to mention your crate? Did you delete the message? :slightly_smiling_face: I could do that; would probably batch it with the next changes (currently busy with godot-rust).

Do you know other projects that do a lightweight Rust-JS binding? I remember there was at least another crate with a similar idea.

rscarson commented 4 months ago

What happened to your request to mention your crate? Did you delete the message? 🙂 I could do that; would probably batch it with the next changes (currently busy with godot-rust).

Do you know other projects that do a lightweight Rust-JS binding? I remember there was at least another crate with a similar idea.

Sure! I'd appreciate it Sorry for the deleted message - I thought this may not have been the place to ask that

As for the 2nd question, to my knowledge Rustyscript and Js-sandbox are the only two

pepoviola commented 4 months ago

Hi 👋, First let me say cool projects to both 🙌! I'm also working on an small runtime (with some libs embedded) but I'm having hard time updating the version of deno_core. In my case compile ok but just hung when reach an await in the js code. Did you get something similar?

Thanks!!!

pepoviola commented 4 months ago

Just and small update, I managed to update the deno_core version (and the ext. versions). There was some changes by I'm happy to help here to update the version also.

Thx!!