lihaoyi / workbench

Tooling around scala-js
234 stars 56 forks source link

Added more settings keys in order to integrate with Play Framework #5

Closed hadesgames closed 10 years ago

hadesgames commented 10 years ago

I am currently trying to make a project that integrates the Play framework, ScalaJs and the ScalaJs Workbench. I have added a few more settings key to the workbench in order to make it more configurable:

I have added reloadPrefix in order to specify the location from which the javascript are reloaded. Eg: instead of reloading from localhost:12345 reload from localhost:9000 where the play server is running.

I have also added javascriptUrlGenerator that lets you specify how javascript file paths are converted into urls. For example I need to convert stuff like scalajvm/target/scala-2.10/classes/public/javascripts/scalajs.js into assets/javascripts/scala.js.

hadesgames commented 10 years ago

I have refactored the two settings into a task key named updatedJS that returns a list of changed JS files.

The only problem is that I get this list in hackish way, using a mutable variable, from FileFunction.cached. I have looked through the source code of FileFunction.cached and I couldn't find a better way to do this . Do you have any suggestions ?

lihaoyi commented 10 years ago

I'm totally fine with using a mutable var.

hadesgames commented 10 years ago

Any updates on this pull request ?

lihaoyi commented 10 years ago

Sorry, didn't notice you updated it. Will take a look tonight

lihaoyi commented 10 years ago

Looks good to me. I'm probably going to publish an updated version of workbench when ScalaJS 0.5.0-FINAL comes out, but that's going to be a few more weeks