yew icon indicating copy to clipboard operation
yew copied to clipboard

Allow different serialisation implementation to be used with prepared states

Open futursolo opened this issue 3 years ago • 1 comments

Currently, prepared states are implemented with bincode + base64. This implementation is selected as it results in the smallest artifact of both hydration enabled wasm file and html file.

However, sometimes it may make sense to swap this for another serde implementation such as when serde_json is already included. We should provide a way to replace the implementation.

futursolo avatar May 24 '22 12:05 futursolo

One way to provide this implementation is similar to how global allocator works:

// pseudocode~ish
#[yew::serializor]
static SERIALIZOR: Serializor = Serializor::INIT;

I'm not entirely sure if that's possible though

ranile avatar Jun 19 '22 17:06 ranile