Search code examples
scala.jsscalajs-react

Scalajs-react VS Xored Scalajs-react VS SRI


What is the difference between these Scala.js React.js libraries and why should I choose one over the other ?

  1. Xored Scalajs-react - Last commit was 8 months ago. So I'm guessing the development is not active anymore.
  2. Scalajs-react - Very active and very complete and comes with a custom URL Router. But the API's seems to be stepping away from the way actual Javascript React code is written and there is no support for React-native and the addition of Scalaz and Monocle fattens up the library increases the size of Javascript that browser has to download. The document says Scalaz & Monocle are opt-in, so I'm guessing by default Scalaz & Monocle are excluded ? I personally feel that this library could just be a very simple facade to the React.js code which would have made it easier to update to newer version React.js and it not being a simple facade means more Javascript code that will get generated and more code the browser will have to download. I may be wrong here, please correct me ?
  3. SRI - Newcomer and the facades looks very much complete and has support for Web, Relay and React native but have no URL Router support and no DOM DSL. The facade APIs looks very lean and very similar as writing Javascript React.js code. But it is fairly new and may be not production ready ?

Please correct me if I am wrong as there are too many options to choose here and wish there was one way to write React.js code in Scala.js.


Solution

  • As of October 2015:

    • I also conclude that xored/scala-js-react is not actively developed at the moment. The approach used for templating is to keep an XML syntax a la JSX, which I do like in some ways, in particular because it makes the code look more like plain React. UPDATE: @MxFr pointed to a fork with a little bit of activity.
    • There is no doubt that as japgolly/scalajs-react is under active development. Support for React 0.14 is coming. The approach is to use a custom version of lihaoyi/scalatags for templating instead of an XML syntax. This has the drawback of making the code look a bit weird at first, but you get used to it and it provides a good level of type-safety.
    • chandu0101/sri is new and wants to be more of a cross-platform solution (web, Android, iOS). There is a discussion about making chandu0101/sri use japgolly/scalajs-react, and the author of sri seems particularly interested in doing so based on that conversation.

    Based on the above, the most attractive solution right now is japgolly/scalajs-react, keeping in mind that things change quickly in this space.