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
Describe the bug
Hello, this is borderline bug/feature request; raising as bug as behaviour is unexpected for the end user.
Currently leptos crate supports rkyv feature for serealisation/deserelisation, this enables Suspense to work with rkyv serialisation (or at least that used to be the case). The leptos_macro crate on the other hand does not support rkyv serialisation on server-side functions (only serde).
Since leptos_macro is not explicitly added to project dependencies, it is natural for user to assume that the feature changing the serialisation method on leptos crate would get propagated to all transient logic. This is not the case as server-side functions only support serde.
Leptos Dependencies
leptos = { version = "0.5.1", features = ["nightly", "rkyv"] }
leptos_meta = { version = "0.5.1", features = ["nightly"] }
leptos_router = { version = "0.5.1", features = ["nightly"] }
leptos_axum = { version = "0.5.1" }
rkyv = "0.7.42"
To Reproduce
Setup a new project, set rkyv feature on leptos, attemopt creating a server-side function that would use rkyv serialised struct.
Expected behavior
It should compile and when invoked should use rkyv serialisation.
The text was updated successfully, but these errors were encountered:
In spirit this is a duplicate of #1501, asking about serde-lite support for server functions, and so I'll link to my answer there, which holds true but replacing one crate for the other.
This is not something I'll have the capacity to work on but I'd be happy to look at a PR adding it.
Oh, for what it's worth these features have always, only referred to how resources are serialized during server rendering. I would think that a server function called during server rendering with rkyv enabled would be serialized during server rendering with rkyv, even though that isn't supported in server functions (see docs for #[server].
If this isn't the case I'm happy to look at a reproduction. (I mean a code sample I can copy and paste, ie more detailed than what you wrote above.)
Describe the bug
Hello, this is borderline bug/feature request; raising as bug as behaviour is unexpected for the end user.
Currently
leptos
crate supportsrkyv
feature for serealisation/deserelisation, this enablesSuspense
to work withrkyv
serialisation (or at least that used to be the case). Theleptos_macro
crate on the other hand does not supportrkyv
serialisation on server-side functions (only serde).Since
leptos_macro
is not explicitly added to project dependencies, it is natural for user to assume that the feature changing the serialisation method onleptos
crate would get propagated to all transient logic. This is not the case as server-side functions only support serde.Leptos Dependencies
To Reproduce
Setup a new project, set
rkyv
feature onleptos
, attemopt creating a server-side function that would userkyv
serialised struct.Expected behavior
It should compile and when invoked should use
rkyv
serialisation.The text was updated successfully, but these errors were encountered: