Re:Scala.js 1.0.0-RC1
by bad_user on Tuesday November 26, 2019 @07:51AM
(#21637793)
Scala.js is being fed to the Google Closure compiler [1] for minification via tree-shaking, after applying optimizations on its own. Output can be unreadable, but debugging works via source maps.
It's not perfect, but you should not get hundreds of KB for a Hello World. And indeed, the code cannot be as minimal as hand crafted code either.
Note that this is often a false problem, because people often use a lot of JavaScript libraries without any tree-shaking in their build process, so if you do care about tens of KB, then you don't use JQuery, React, etc. A valid use case indeed, I've been there, but not for your typical app.
It's not perfect, but you should not get hundreds of KB for a Hello World. And indeed, the code cannot be as minimal as hand crafted code either.
Note that this is often a false problem, because people often use a lot of JavaScript libraries without any tree-shaking in their build process, so if you do care about tens of KB, then you don't use JQuery, React, etc. A valid use case indeed, I've been there, but not for your typical app.
[1] https://developers.google.com/closure/