Built in npm support is huge for me. I use Scalajs full time and one of my biggest issues is having to use SBT and webjars. I also end up using some mashup of npm modules as well later on in the build which complicates it even more. Plus the speed of the compiler becomes a massive issue, especially during unit tests.
By turning it into a more readable Js, I wonder if the debugger would play more nicely too. I've noticed in Scalajs the debugger randomly misses breakpoints or moves to the wrong line sometimes. Anyway not a rant on Scalajs, I do like it but there's definitely some bottlenecks for me.
I use Scala.js too. I haven't been able to set up a working sourcemap with our workflow of Scala.js -> Webpack -> JS. It's difficult to debug the mangled JS output but I can just about do it--barely.
By contrast, reading BuckleScript's output JS is a breeze. No name mangling, idiomatic style, sensible code flow.
I agree with your analysis on breakpoints and step-by-step in Scala.js. Usually it's a good idea to disable the Scala.js optimizer if you're doing that, using:
But it's still not 100% perfect. I am toying with the idea that we should have a mode of the optimizer that tries to optimize for debuggability with step-by-step and breakpoints. This would try to arrange the generated source in closer relation with the source code (like, 1 line = 1 line). All of this is trying to work around limitations of source maps, and also of browsers' support for source maps. It would be so much easier if source maps were a little bit more powerful in what they can express (e.g., indicating what a "step" should be in the code).
This bundler looks awesome sjrd, will give it a try soon. My other option I was going to suggest to other is to take a look at the sbt-web project. But keeping things compatible and seamless with npm I think is important since it's ubiquitous with front end devs
By turning it into a more readable Js, I wonder if the debugger would play more nicely too. I've noticed in Scalajs the debugger randomly misses breakpoints or moves to the wrong line sometimes. Anyway not a rant on Scalajs, I do like it but there's definitely some bottlenecks for me.