Velopack client libraries written in Fusion #153
caesay
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In case you're curious, https://github.com/velopack/velopack.fusion is where I'm working to write client libraries in Fusion for Velopack.
As you can see from the
src/include
folder, there's still a fair bit of code I need to write in the native languages instead of Fusion. For example, the glue that makes the JS API possible can be seen in the prepend.ts and append.ts files.I went through several iterations on the implementation of the async functions, but in the end I decided to only write the synchronous functions in Fusion and write a derived class supporting async in the native language, and leveraging as much Fusion code in those functions as possible.
I also ended up writing my own build system so I could splice in my include files, and substitute function bodies like:
With this, I have it checked at compile time across all the native includes, so if a native function is missing from the
src/include
folder it will error in my scripts right at the beginning.My general approach is that the "meat" of the library is actually written in Rust, and the Fusion code is just a light weight wrapper to call the rust binary and proxy data back/forth.
Beta Was this translation helpful? Give feedback.
All reactions