It should be wrapped in an array, not an object. Then it's valid. The problem was that I was trying to use an enum.
I got the response wrong, here's what I'm using that isn't working:
enum NationResponse {
Nation(Nation),
People(Vec),
}
Why the heck can't I edit the original post after a comment is made?
Oh man, I didn't know debug_handler existed. Sure enough I had a missing derived attribute... not sure how but Serde serialize and deserialize were missing, so when I was trying to return Ok(Json(army)) it was failing. Thanks so much!
Also, move out special types to types.rs, error types to errors.rs to keep the area with the actual algorithms more clear.
Ok this is totally something my code base needs. Very actionable feedback.
And yeah that's one of the things I love about rust; it will tell me everywhere things are out of wack. It's such a different experience from back when I had large JavaScript code bases. Make changes and pray lol.
This is really good to hear, I don't think I'm as far off base as I thought; maybe I've been over thinking it a bit. And thanks for that refactoring resource. I'm very big into making my TS code clean and maintainable. I'm just thrown off a bit with the new paradigm.
Oh wow, default is so nice. I wasn't exactly looking for this when I asked the question, but I'm glad you tipped me off to it.
This is a great answer, thanks. I'll have to look more into conditional compilation. That's new to me.
Thanks, yeah it felt like too many tests to keep in file. I can live with that directory approach. TY!
This is cool. I'm a front-end focused dev by trade and have been 11 years now. I've been picking up Rust as a side hobbie for 6 months or so and have not even peaked at these front-end frameworks. I know Lemmy is all about Rust, but I still think it's pretty cheeky they're using Rust for the front-end.
About Leptos specifically... If there's no shadow dom / rerenders and not trying to be react, I already like it better than it's competitor.
Eh , its probably just temporary. People just had apps they've used for 10 years yanked away and it's jaring how it all went down. Of course people are going to want to talk about it.
Have you thought about wiping your comments? I had 1300 (more than I thought I would) and have no regrets.
🤣
We're a pretty darn good minor league baseball team if you ask me