yew
yew copied to clipboard
Allow different serialisation implementation to be used with prepared states
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.
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