Thanks to visit codestin.com
Credit goes to github.com

Skip to content

js-scala/js-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js.scala: JavaScript as an embedded DSL in Scala

Documentation

Setup

  1. Setup virtualization-lms-core:
  • $ git clone [email protected]:TiarkRompf/virtualization-lms-core.git
  • $ cd virtualization-lms-core
  • $ sbt publish-local
  1. Clone the project and manage it using sbt:
  1. Run the tests:
  • > test
  1. Publish it (if you want to use it in your project):
  • > publish-local
  1. Run the examples:
  • > project examples
  • > run

Use it in your project

  1. Add a dependency on js-scala 0.4-SNAPSHOT
  • libraryDependencies += "EPFL" %% "js-scala" % "0.4-SNAPSHOT"
  1. Use Scala 2.10.2-RC1 and set the Scala organization to org.scala-lang.virtualized
  • scalaVersion := "2.10.2-RC1"
  • scalaOrganization := "org.scala-lang.virtualized"
  1. Set the -Yvirtualize compiler option
  • scalacOptions += "-Yvirtualize"

Use it in Play! 2.1

Tweak your project/Build.scala file to look like the following:

object ApplicationBuild extends Build {

    val appName         = "foo"
    val appVersion      = "1.0-SNAPSHOT"

    val appDependencies = Seq(
      "EPFL" %% "js-scala" % "0.3-SNAPSHOT"
    )

    val main = play.Project(appName, appVersion, appDependencies).settings(
      scalaOrganization := "org.scala-lang.virtualized",
      scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xexperimental", "-Yvirtualize")
    )

}

Use it in Play! 2.0.2

  • build-play20 builds Play 2! and all its transitive Scala dependencies with Scala-Virtualized, for compatibility with this DSL. Deployment on dotcloud is an option.

Further projects

  • play-js-validation uses this DSL to enable form validation code in Play 2.0 to be written once and checked on both client and server sides.

  • forest uses this DSL to enable HTML templates to be written once and shared between client and server sides, both for initial rendering and automatic updating.

About

js.scala: JavaScript as an embedded DSL in Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9