News for hackers. Stuff that matters.
Re:Scala React interface: Cross-platform apps using Scalajs by sirseal on Monday October 12, 2015 @04:21PM (#10376747)
Wow! This is some fantastic stuff. To be (slightly) cynical, I wonder how much code reuse one could get out of this _in practice_. At any rate, I think it's a win to be able to do all of this kind of coding within the same language. Also, being able to bring functional programming, immutability, and types to these different environments is a sure win!
Re:Scala React interface: Cross-platform apps using Scalajs by RussianCow on Monday October 12, 2015 @04:32PM (#10376808)
At the very least, you could reuse model code and some (most?) business logic, and likely the data layer as well. Even if you don't reuse any UI code (which seems unlikely), that's still significant.

Edit: In the long run, though, this type of approach opens up the opportunity to abstract low-level differences between platforms in a way that still uses native UI/functionality under the hood. For instance, you could make your high-level components generic enough to be used on any platform, and only change the implementation details per platform. You can do the same with plenty of other APIs as well (local data storage, location, etc).

Re:Scala React interface: Cross-platform apps using Scalajs by ecesena on Monday October 12, 2015 @07:23PM (#10377460)
I've been using 2 distinct languages for FE and BE from the very beginning of my project, and I think that's one the best decisions we made.

It is true, you have to duplicate your models i.e. physically write the same code in 2 languages, but with ORMs this is pretty fast. At later stages, the amount of dup code is always less and less. On the pros-side, this intrinsically prevents you from taking shortcuts, leading to better separation of duties.

It depends on how big you think your project will become, I guess. :)

Re:Scala React interface: Cross-platform apps using Scalajs by weego on Monday October 12, 2015 @04:41PM (#10376838)
Taking a task that a JavaScript developer could do and putting a dependency on them being a Scala developer as well isn't a win imo (as a Scala/Javascript dev)
Re:Scala React interface: Cross-platform apps using Scalajs by arenaninja on Monday October 12, 2015 @07:14PM (#10377427)
I fully agree. I've done minor things in Java and I've been doing PHP for about 3 years. I've picked up React and I've been trying to get into Scala. It's only been three days, but I think it's not for the faint of heart. I can think of a number of solid front-end devs whose lives would be hell if you threw them into Scala (as an aside, I actually like what I've learned so far, though I wish their 'documentation' was not terrible, though I imagine it's probably done that way since it would be too hard to keep it up to date)
Re:Scala React interface: Cross-platform apps using Scalajs by Aqueous on Monday October 12, 2015 @03:25PM (#10376494)
Is this meant to be a replacement for/improvement over scalajs-react [1] or scala-js-react [2] (two other libraries that wrap ReactJS in ScalaJS)?

[1] https://github.com/japgolly/scalajs-react

[2] https://github.com/xored/scala-js-react

Re:Scala React interface: Cross-platform apps using Scalajs by invarinat on Monday October 12, 2015 @06:20PM (#10377259)
Re:Scala React interface: Cross-platform apps using Scalajs by warfangle on Monday October 12, 2015 @03:05PM (#10376402)
How is scalajs now? The last time I checked it out, it baked in about 100KB of overhead into the simple hello world.
Re:Scala React interface: Cross-platform apps using Scalajs by eeperson on Monday October 12, 2015 @04:45PM (#10376860)
According to this[1], as of 2 years ago, hello world was only 2.63KB. It's probably even better now as there have been several releases in the past 2 years.

[1] - https://github.com/scala-js/scala-js/issues/4#issuecomment-2...

Re:Scala React interface: Cross-platform apps using Scalajs by sjrd on Monday October 12, 2015 @05:49PM (#10377149)
20 KB is as low as it gets, these days (not gzipped). But really, that doesn't matter in the least, because you don't write Hello World's with Scala.js. You write larger apps for which the cost of these few tens of KB is completely dwarfed by the size of your application code. Remember that jQuery itself is 40 KB, and nobody complains about it.
Re:Scala React interface: Cross-platform apps using Scalajs by paulddraper on Monday October 12, 2015 @07:53PM (#10377581)
My experience too.

But that goes down to like 50k after compression. Some logos are bigger than that.

Not trivial, but for a lot of use cases, that's good enough. Especially if you cache appropriately.

Re:Scala React interface: Cross-platform apps using Scalajs by mmmeff on Monday October 12, 2015 @05:25PM (#10377039)
nope.avi