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:
- Create a proto file defining the DTOs
- Run the protoc compiler to generate the actual DTOs for client and server sides
- Use DTOs on the client side
- Use DTOs on the server side
That’s pretty much it. Looking forward to taking this into more serious use…