Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does rust have good deserializers for json and xml? Can you work well with a rust application that interacts with react? Just asking.


> Does rust have good deserializers for json and xml?

yes. https://github.com/serde-rs/json

> Can you work well with a rust application that interacts with react?

can you write an API-server in Rust? sure. or what do you mean?


To add to this, this should give you an idea of what this looks like to use: https://serde.rs/derive.html


Serde is lovely, in my opinion. Not sure about React interop, though.


Yes to both, this is what I do for my day job.


Nice, it would be great to hear about some of the stack you are using then. What interests me is:

dezerializers

rest API exposing. Annotations or sorts ?

openapi support

I guess these are some of the most criticial


We have written our own http server framework focused on openapi support: https://docs.rs/dropshot/latest/dropshot/

https://serde.rs/ is the serialization/deserialization framework in Rust, and is well supported in the ecosystem.

We also wrote https://github.com/oxidecomputer/oxide.ts to generate TypeScript clients from the OpenAPI.

We mostly use react-router (or remix for older things that haven't been upgraded yet).

So the way that it works is, you define your api in dropshot. You ask it to generate an openapi document. You run this on that document to get a typescript client. And then you use that client in your react-router application.

I'm personally using it in the "framework" mode, so I have a "backend for frontend" going on, but the main appliccation is using it purely on the client, served from the same server as that API. Both have pros and cons.


Oh and how good is the jetbrains integration with rust ? Debugging works similar to with java does it ?

What build environment is used ?


I use VS: Code, not Jetbrains. I've heard good things but I've never used it.

Cargo builds the Rust and npm builds the typescript, with vite.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: