Re:Scala.js has a new website
by jiaweihli on Monday November 23, 2015 @02:35PM
(#10616721)
While I love scala, I have 2 concerns that have stopped me from using scala.js: 1) can I use typescript definitions to avoid writing everything myself? 2) how much bloat does this add to my app? (from overhead of standard libs and core)
[ Parent
| on HN ]
There is a way to transform a typescript definition to Scala.js facade (https://github.com/sjrd/scala-js-ts-importer).
As for the bloat, it isn't much. Compiled Javascript for our full-fledged app is about 180KB (gzipped) + external libraries such as React.
Don't take this the wrong way, but I've been in the industry for a long time... and it amazes me that 180KB is considered not much...
If I told you I had a way to remove 180KB from every page load, you'd be all over it. :)
180KB is comparable to a medium-size image.
Yes you are right.
Scripting time however can be massive, take for instance this hs.fi (Finnish daily), they have 354kB of JavaScript, but scripting time with Skylake 6700K is 1.13 seconds of the page load. With Q6600 it was 3.5 seconds.
With latest chrome it's easy to measure scripting time as pie chart. Go to "Timeline" tab of developer tools and hit F5. (just few releases back one had to do it manually by starting timeline and stopping it.)
So few people seem to run a profiler on their Javascript nowadays. It's a shame, really, as the tools are very powerful!
but the 180KB is not downloaded on every page load.