Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rkyv is broken on Leptos 7 #3467

Open
thestarmaker opened this issue Jan 9, 2025 · 5 comments
Open

Rkyv is broken on Leptos 7 #3467

thestarmaker opened this issue Jan 9, 2025 · 5 comments
Milestone

Comments

@thestarmaker
Copy link
Contributor

leptos 0.7 depends on rkyv 0.8
leptos 0.7 depends on codee 0.2;
codee 0.2 (and master) depends on rkyv 0.7

rkyv 0.7 is not compatible with rkyv 0.8

an attempt to use rkyv serialisation in yelds in

the trait `rkyv::Serialize<rkyv::ser::serializers::CompositeSerializer<rkyv::ser::serializers::alloc::AlignedSerializer<rkyv::util::aligned_vec::AlignedVec>, rkyv::ser::serializers::core::FallbackScratch<rkyv::ser::serializers::alloc::HeapScratch<1024>, rkyv::ser::serializers::alloc::AllocScratch>, rkyv::ser::serializers::alloc::SharedSerializeMap>>` is not implemented for `base::api::monkey::Monkey`, which is required by `codee::binary::rkyv::RkyvCodec: codee::traits::Encoder<_>`
     |
help: trait impl with same name found
    --> /Users/<redacted>.rs:6:32
     |
6    | #[derive(Archive, Deserialize, Serialize, Eq, PartialEq, Clone)]
     |                                ^^^^^^^^^
     = note: perhaps two different versions of crate `rkyv` are being used?
     = help: the following other types implement trait `rkyv::Serialize<S>`:
               `()` implements `rkyv::Serialize<S>`
               `Arc<T>` implements `rkyv::Serialize<S>`
               `AtomicBool` implements `rkyv::Serialize<S>`
               `AtomicI16` implements `rkyv::Serialize<S>`
               `AtomicI32` implements `rkyv::Serialize<S>`
               `AtomicI8` implements `rkyv::Serialize<S>`
               `AtomicIsize` implements `rkyv::Serialize<S>`
               `AtomicU16` implements `rkyv::Serialize<S>`
             and 114 others
     = note: required for `codee::binary::rkyv::RkyvCodec` to implement `codee::traits::Encoder<base::api::monkey::Monkey>`
@thestarmaker
Copy link
Contributor Author

Attempting to upgrade codee dependencies: Synphonyte/codee#3

@maccesch
Copy link
Contributor

Merged and released as codee 0.3.0

@gbj gbj added this to the 0.8 milestone Jan 11, 2025
@gbj
Copy link
Collaborator

gbj commented Jan 11, 2025

This causes a bit of a semver mess, because we reexport some types, so bumping our dependency from 0.2 to 0.3 is itself a breaking change in Leptos. That said, we're planning to do a 0.8 release later this month with no real API changes for users, but all the little semver-breaking changes/fixes we've discovered over the first month or two of 0.7.

In the meantime it should be (fairly?) straightforward to patch Leptos to use codee 0.3 so you can use rkyv properly.

@thestarmaker
Copy link
Contributor Author

thanks @gbj; yes, yesterday I've branched from https://github.com/leptos-rs/leptos/tree/dyn-safe-route-matching and upgraded codee, it seems ok, or rather not failing on anything to do with leptos but my own compilation issues for the same rkyv 8 reasons.

I was going to raise codee version bump PR, just wanted to make sure it actually works.

@thestarmaker
Copy link
Contributor Author

been sick most of the week, finally got to testing it on my fork. Rkyv serialisation now works, PR raised: #3504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants