summaryrefslogtreecommitdiff
path: root/book/src/main/scalatex/book/handson/ClientServer.scalatex
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2015-02-04 04:43:41 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2015-02-04 04:43:41 -0800
commit49cf861b0a4e351e56ba797541d43cb1da345741 (patch)
tree5b84193ecd9eefc05bd9f27b1766e833064182ae /book/src/main/scalatex/book/handson/ClientServer.scalatex
parent2e9a726bfbea4a25183a2649e4e0b85519fe8e8a (diff)
parent33129113b3ebf3dd656bd58c34af476fb852e2f6 (diff)
downloadhands-on-scala-js-49cf861b0a4e351e56ba797541d43cb1da345741.tar.gz
hands-on-scala-js-49cf861b0a4e351e56ba797541d43cb1da345741.tar.bz2
hands-on-scala-js-49cf861b0a4e351e56ba797541d43cb1da345741.zip
Merge pull request #19 from sjrd/scalajs-0.6
Upgrade and update the whole thing for Scala.js 0.6.0-RC2.
Diffstat (limited to 'book/src/main/scalatex/book/handson/ClientServer.scalatex')
-rw-r--r--book/src/main/scalatex/book/handson/ClientServer.scalatex4
1 files changed, 2 insertions, 2 deletions
diff --git a/book/src/main/scalatex/book/handson/ClientServer.scalatex b/book/src/main/scalatex/book/handson/ClientServer.scalatex
index 87c959d..0d60192 100644
--- a/book/src/main/scalatex/book/handson/ClientServer.scalatex
+++ b/book/src/main/scalatex/book/handson/ClientServer.scalatex
@@ -12,7 +12,7 @@
@ul
@li
- Javascript on the client v.s. PHP/Perl/Python/Ruby/Java on the client
+ Javascript on the client v.s. PHP/Perl/Python/Ruby/Java on the server
@li
Most back-ends make heavy use of C extensions, and front-end code was tightly coupled to the DOM. Even if you manage to port the main language
@p
@@ -49,7 +49,7 @@
@hl.ref(wd/'examples/'crossBuilds/'clientserver/"build.sbt")
@p
- We have two projects: @code{client} and @code{server}, one of which is a Scala.js project (indicated by the presence of @hl.scala{scalaJSSettings}). Both projects share a number of settings: the presence of the @code{shared/} folder, which shared code can live in (similar to what we saw in @sect.ref{Cross Publishing Libraries}) and the settings to add @lnk.github.Scalatags and @lnk.github.uPickle to the build. Note that those two dependencies use the triple @code{%%%} instead of the double @code{%%} to declare: this means that for each dependency, we will pull in the Scala-JVM or Scala.js version depending on whether it's being used in a Scala.js project. Note also the @hl.scala{packageArchetype.java_application} setting, which isn't strictly necessary depending on what you want to do with the application, but this example needs it as part of the deployment to Heroku.
+ We have two projects: @code{client} and @code{server}, one of which is a Scala.js project (indicated by the presence of @hl.scala{enablePlugins(ScalaJSPlugin)}). Both projects share a number of settings: the presence of the @code{shared/} folder, which shared code can live in (similar to what we saw in @sect.ref{Cross Publishing Libraries}) and the settings to add @lnk.github.Scalatags and @lnk.github.uPickle to the build. Note that those two dependencies use the triple @code{%%%} instead of the double @code{%%} to declare: this means that for each dependency, we will pull in the Scala-JVM or Scala.js version depending on whether it's being used in a Scala.js project. Note also the @hl.scala{packageArchetype.java_application} setting, which isn't strictly necessary depending on what you want to do with the application, but this example needs it as part of the deployment to Heroku.
@p
The @code{client} subproject is uneventful, with a dependency on the by-now-familiar @code{scalajs-dom} library. The @code{server} project, on the other hand, is interesting: it contains the dependencies required for us to set up out Spray server, and one additional thing: we add the output of @code{fastOptJS} from the client to the @code{resources} on the server. This will allow the @code{server} to serve the compiled-javascript from our @code{client} project from its resources.