Using ScalaPB with Scala.js
Scala.js compiles Scala source code to equivalent Javascript code. It is possible to use ScalaPB generated case classes and lenses in Scala.js, and even serialize and parse byte arrays.
Limitations:
- The Java protocol buffers are unavailable, and therefore Java conversions and Java descriptors do not work (though Scala descriptors in ScalaPB >= 0.6.0 would cover most use cases)
#
Getting StartedAdd to your library dependencies:
#
DemoExample project: https://github.com/thesamet/scalapbjs-test
Example with multi-project build: https://github.com/thesamet/sbt-protoc/tree/master/examples/scalajs-multiproject
Live demo: http://thesamet.github.io/scalapbjs-test/