TodoMVC example with scala.js+react (via Slinky)

Hi all,

I rewrote todomvc/examples/react at 1.3.1 · tastejs/todomvc · GitHub in scala.js, as an exercise and in the hope of enticing non-scala people to adopt scala.js for web development. This is the resulting repo: GitHub - anthony-cros/todomvc-scalajs-react-slinky

Note that I opted for Slinky as react facade as it seems to hit the sweet spot between an improved user experience (over ScalablyTyped’s) and the introduction of new concepts (over scalajs-react and react4s). This is mostly because I imagine people arriving from JS would look for such a sweet spot at first.

It should be noted that I have relatively little experience in webdev, as the last time I seriously touched front-end code was 2007 (JSPs…). This made for an interesting challenge: could I wrap my head around something like react via scala.js without using it in javascript first? The answer is yes, but with some caveats which I captured in this google doc. Overall the experience was very positive, but I think many aspects of the scala ecosystem would feel really overwhelming to someone used to this kind of programming experience…

I welcome any feedback on the code before I try to upstream it on the main todomvc repo!

1 Like

Hi Anthony,

just to add to the discussion, I want to mention my past take at the same exact issue (plus using Diode for managing immutable application state), see GitHub - mcallisto/slinky-diode-todomvc: TodoMVC example coded in Scala through Scala.js, Slinky and Diode

By the way, ScalablyTyped comes with a Slinky “flavour” see Flavour · ScalablyTyped.

So the two usually work together (and personally I tend to use them together), see GitHub - ScalablyTyped/SlinkyDemos for a good bunch of demos.



1 Like

Nice, actually I was thinking I would soon create a second version that uses either Redux or Mobx. Again trying to emulate someone coming straight from JS/typescript land. With that said I had taken notice of Diode which looks like a very clean state management solution, and I imagine feels less contrived than Redux-in-scalajs.

More generally I think the ScalablyTyped’s approach is brilliant, as the no type → typed leap feels like the biggest challenge to me (however flawed said types may be). And it seems Typescript has enough traction now that DefinitelyTyped can be leveraged successfully.