You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've know spent a couple of months looking into using web assembly to solve this problem.
I had it working four months ago, just not as a macro. I now have finally figured out how this would work for sailfish.
My goal was to make it completely in-transparent when calling a render function. Prototype
cfg attributes are used to switch between different implementations for host and guest.
When not compiling for wasm, the sailfish Template trait implementation calls a function in the web assembly vm.
This function is only compiled for wasm, because it uses a bindgen macro.
When compiling for wasm the sailfish Template trait is implemented normally.
The bind function then calls this render implementation. Then the render result is returned to the host.
The only problem with this is, that it will not work with generic struct Templates. @Kogia-sima seems to have also not solved this problem with the "Dynamic template loading" rfc.
This means that any kind of layouting will be impossible, so Layouts can't be hot reloaded.
For me, loosing generics is a big issue. I can still finish this if there is interest, but I can't and won't use it myself. Sadly.
Compile and load templates at runtime.
Rendered
The text was updated successfully, but these errors were encountered: