Ingvar Stepanyan
Ingvar Stepanyan
I think instead of using Serde in this case you'd just have to implement conversion via manual methods, where you take a JsValue and step-by-step extract the properties you're interested...
If you mean the 2nd one, then yeah, as I said, it works only for primitive JSON-like values. For anything else you need to implement custom conversion methods.
Hmm actually, while very hacky, it could be possible for serde-wasm-bindgen to provide some sort of `serde_wasm_bindgen::PreservedValue(JsValue)` method (and, correspondingly, helper `{de}serialize_with` functions). `PreservedValue` would need to ask the deserializer...
> While at a high level I follow what you are saying, I don't think I have quite enough experience with serde or wasm-bindgen at this stage to be able...
> So `JsTyped` has 3 attributes: > > `Serialize` is implemented with `.as_ref()`. `Deserialize` is implemented with `JsCast::dyn_into()`. Problem is, you can't implement `Serialize`/`Deserialize` using those methods because they're generic...
> There cannot be 2 serializers / deserializers running at the same time in the same thread. Why not? You can have nested serializers or deserializers. Personally, I'd prefer to...
@brandonros That's very much irrelevant to this issue, yes. As your error says, the problem is that `heapless::Vec` is not compatible with wasm-bindgen crates; but if you're using Serde Serialize/Deserialize,...
Hmm, yeah, I don't think this is possible right now without custom deserializer for that struct. I'll look into simplifying this use-case if possible.
@mathstuf Unfortunately, attributes are handled by serde_derive, not something specific deserializers can add or control (easily at least).
> This would require one to annotate all attributes, but would work quite nicely I think and remove all confusion we have currently in the deserializer. I agree, also was...