Look ma no json!

eriktimmers announced a new Protocol Buffers library for Elm a while ago and I found it very interesting. Thank you Erik for your work!

The library enables sharing DTO (data transfer object) definitions between client and server sides and passing DTOs in a non-json format across wires.

Getting started was not very clear at least for me (despite of the example app) especially regarding using the protoc compiler so I wanted to document my steps while I was creating a sample project. Perhaps somebody will find it helpful. The source code of my POC project with an F# .NET Core server is available here and a working demo app here.

Roughly speaking the following steps were needed to make it work:

  1. Create a proto file defining the DTOs
  2. Run the protoc compiler to generate the actual DTOs for client and server sides
  3. Use DTOs on the client side
  4. Use DTOs on the server side

That’s pretty much it. Looking forward to taking this into more serious use…

7 Likes

This is really amazing stuff!

2 Likes

Great to see some working example using my library. Thanks for that @nk123!
I still haven’t had (made) time to do so myself so some help on that is highly appreciated.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.