bwbecker
bwbecker

Reputation: 1285

Speeding up the scala.js/sbt Edit-Compile-Run/Debug cycle

The Edit-Compile-Run cycle for my Play+Scala.JS application is painfully slow. I'm wondering if you have tips for speeding it up.

For example, is there a way to avoid restarting the server every time the client (scala.js) code changes? We don't need to close and re-open database connections and all just to serve a new javascript file! @aholland makes partial progress on this at https://github.com/aholland/play-scalajs-workbench-example but his technique involves manually splitting the project into the server part and the client part and then (manually) merging them again. Ugh!

@OlivierBanvillain's sample project at https://github.com/OlivierBlanvillain/full-stack-scala says it has "proper sbt configuration for development/deployment". The build.sbt file does some interesting things with which files are watched for changes, etc. But I don't see a difference in actual use: the play server still restarts every time scala.js source is changed. Perhaps I misunderstand his intent (the explanation is pretty sparse!).

I've also seen the sbt-revolver plugin (https://github.com/spray/sbt-revolver) -- in fact the above project uses it. It advertises "dangerously fast development turnaround in Scala" but again, I don't understand what its advantage is. It talks about starting/stopping the application in the background, but how is that different than normal sbt?

Upvotes: 1

Views: 164

Answers (1)

bwbecker
bwbecker

Reputation: 1285

I rewrote my build.sbt file using the example from https://github.com/vmunier/play-with-scalajs-example, including the plugins. That's helped a lot.

Upvotes: 1

Related Questions