Closed justinmchase closed 2 years ago
looks like this package is using https://github.com/denosaurs/plug but v0.2.9 but that package is up to v0.4.1
So I took a crack at updating the dependency, the rust components build locally just fine but the problem is that the deno api isn't just a little different but drastically different.
It appears fairly straight forward, especially if you already know how this library is working, but it was a little bigger of a change than I was able to make on a weekend project.
But here is the summary of my discoveries in case anyone else is gonna take this on:
Relevent Docs
Deno.dlopen
to load the binary#[deno_bindgen]
probablyThe bindgen repo has examples for strings and structs, etc. I think its the way to go but would require some hefty refactoring it seems.
I tried the same thing and got stuck that the "new" Deno FFI API only allows Buffers and u8/u16/u32 basically...
I tried to set up the symbols (which the Plug package wants) given the function names and all that but I agree with you, I think deno_bindgen will be needed because... oddly... by design Deno FFI doesn't support structs yet?
yeah and the numbers are easy to convert but the strings require some wrapper to convert to buffers and likely something on the native side to make sure its converting the buffer to a string properly.
Im working on deno#12828 which should enable everything that is required for webview_deno
to work once again, plug is updated and should work so now its just a matter of finishing my pr.
@eliassjogreen Happy to hear it. Thank you very much for what you are doing.
Will it look somewhat like this: https://github.com/node-ffi-napi/ref-struct-di ?
https://github.com/denoland/deno/pull/12828/files landed. Sounds like we need to wait for v1.17.0 to come out of Deno, then for Elias to update https://github.com/denosaurs/plug and then pull those changes into this repo, then also update this repo for the new FFI format.
Still blocked?
YESS
With the default example code and the latest version of Deno I get: