Giter VIP home page Giter VIP logo

scalajs-spa-tutorial's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalajs-spa-tutorial's Issues

Error while setting up

Hi @ochrons ,

This is an awesome tutorial!!

I tried to learn Scala and Play through this a couple months ago and the app was working fine but today when I download the master , cd into it and do sbt run, I get a huge error trace. Could you kindly help me find a solution?

It compiles fine on the backend but when I open the localhost 9000 and scalars begins compilation - it breaks. The only change that's I've had since last time is the installation of ammonite shell.



--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[info] Updating {file:/Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/}sharedJS...
[info] Resolving org.scala-js#scalajs-test-interface_2.11;0.6.13[info] Resolving org.scala-lang.modules#scala-parser-combinators[info] Resolving org.eclipse.jetty#jetty-websocket;8.1.16.v20140[info] Resolving org.eclipse.jetty#jetty-util;8.1.16.v20140903 .[info] Resolving org.eclipse.jetty#jetty-http;8.1.16.v20140903 .[info] Resolving org.eclipse.jetty#jetty-server;8.1.16.v20140903[info] Resolving org.eclipse.jetty.orbit#javax.servlet;3.0.0.v20[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.16.v20140903 ...
[info] Done updating.
[info] Updating {file:/Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/}client...
[info] Resolving com.github.japgolly.scalajs-react#core_sjs0.6_2[info] Resolving com.github.japgolly.scalajs-react#extra_sjs0.6_[info] Resolving com.github.japgolly.scalacss#ext-react_sjs0.6_2[info] Resolving com.github.japgolly.scalacss#core_sjs0.6_2.11;0[info] Resolving com.github.japgolly.univeq#univeq_sjs0.6_2.11;1[info] Resolving org.scala-js#scalajs-test-interface_2.11;0.6.13[info] Resolving org.scala-lang.modules#scala-parser-combinators[info] Resolving org.eclipse.jetty#jetty-websocket;8.1.16.v20140[info] Resolving org.eclipse.jetty#jetty-util;8.1.16.v20140903 .[info] Resolving org.eclipse.jetty#jetty-http;8.1.16.v20140903 .[info] Resolving org.eclipse.jetty#jetty-server;8.1.16.v20140903[info] Resolving org.eclipse.jetty.orbit#javax.servlet;3.0.0.v20[info] Resolving org.eclipse.jetty#jetty-continuation;8.1.16.v20140903 ...
[info] Done updating.
[info] Compiling 2 Scala sources to /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/shared/.js/target/scala-2.11/classes...
[info] Compiling 18 Scala sources to /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/client/target/scala-2.11/classes...
[info] Fast optimizing /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/client/target/scala-2.11/client-fastopt.js
[info] Compiling 8 Scala sources and 1 Java source to /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/scala-2.11/classes...
[info] LESS compiling on 1 source(s)
[error] /usr/bin/less:1
[error] (function (exports, require, module, __filename, __dirname) { ����
[error]                                                               ^
[error] SyntaxError: Invalid or unexpected token
[error]     at createScript (vm.js:56:10)
[error]     at Object.runInThisContext (vm.js:97:10)
[error]     at Module._compile (module.js:542:28)
[error]     at Object.Module._extensions..js (module.js:579:10)
[error]     at Module.load (module.js:487:32)
[error]     at tryModuleLoad (module.js:446:12)
[error]     at Function.Module._load (module.js:438:3)
[error]     at Module.require (module.js:497:17)
[error]     at require (internal/module.js:20:19)
[error]     at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16
[info]
com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: /usr/bin/less:1
(function (exports, require, module, __filename, __dirname) { ����
                                                              ^
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16

	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:195)
	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:167)
	at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
	at scala.util.Try$.apply(Try.scala:161)
	at scala.util.Success.map(Try.scala:206)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[error] (server/web-assets:less) com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: /usr/bin/less:1
[error] (function (exports, require, module, __filename, __dirname) { ����
[error]                                                               ^
[error] SyntaxError: Invalid or unexpected token
[error]     at createScript (vm.js:56:10)
[error]     at Object.runInThisContext (vm.js:97:10)
[error]     at Module._compile (module.js:542:28)
[error]     at Object.Module._extensions..js (module.js:579:10)
[error]     at Module.load (module.js:487:32)
[error]     at tryModuleLoad (module.js:446:12)
[error]     at Function.Module._load (module.js:438:3)
[error]     at Module.require (module.js:497:17)
[error]     at require (internal/module.js:20:19)
[error]     at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16
[info] LESS compiling on 1 source(s)
[error] /usr/bin/less:1
[error] (function (exports, require, module, __filename, __dirname) { ����
[error]                                                               ^
[error] SyntaxError: Invalid or unexpected token
[error]     at createScript (vm.js:56:10)
[error]     at Object.runInThisContext (vm.js:97:10)
[error]     at Module._compile (module.js:542:28)
[error]     at Object.Module._extensions..js (module.js:579:10)
[error]     at Module.load (module.js:487:32)
[error]     at tryModuleLoad (module.js:446:12)
[error]     at Function.Module._load (module.js:438:3)
[error]     at Module.require (module.js:497:17)
[error]     at require (internal/module.js:20:19)
[error]     at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16
[info]
com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: /usr/bin/less:1
(function (exports, require, module, __filename, __dirname) { ����
                                                              ^
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16

	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:195)
	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:167)
	at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
	at scala.util.Try$.apply(Try.scala:161)
	at scala.util.Success.map(Try.scala:206)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[error] (server/web-assets:less) com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: /usr/bin/less:1
[error] (function (exports, require, module, __filename, __dirname) { ����
[error]                                                               ^
[error] SyntaxError: Invalid or unexpected token
[error]     at createScript (vm.js:56:10)
[error]     at Object.runInThisContext (vm.js:97:10)
[error]     at Module._compile (module.js:542:28)
[error]     at Object.Module._extensions..js (module.js:579:10)
[error]     at Module.load (module.js:487:32)
[error]     at tryModuleLoad (module.js:446:12)
[error]     at Function.Module._load (module.js:438:3)
[error]     at Module.require (module.js:497:17)
[error]     at require (internal/module.js:20:19)
[error]     at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16
[error] application -

! @74a9jl1fo - Internal server error, for (GET) [/] ->

play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[JsTaskFailure: /usr/bin/less:1
(function (exports, require, module, __filename, __dirname) { ����
                                                              ^
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16
]
	at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:51)
	at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
	at scala.Option.map(Option.scala:145)
	at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44)
	at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40)
	at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
	at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
	at scala.util.Either$LeftProjection.map(Either.scala:377)
	at play.sbt.run.PlayReload$.compile(PlayReload.scala:17)
	at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$2.apply(PlayRun.scala:61)
Caused by: com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: /usr/bin/less:1
(function (exports, require, module, __filename, __dirname) { ����
                                                              ^
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /Users/eklavya/Projects/Polyglot/ScalaFlow/scalajs-spa-tutorial-master/server/target/less/lessc.js:9:16

	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:195)
	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:167)
	at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
	at scala.util.Try$.apply(Try.scala:161)
	at scala.util.Success.map(Try.scala:206)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)


SBT launch fails with error: "Unsupported Major.minor version 52.0"

Full error text:

java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0

Forgive me if this is an obvious fix, I'm a newcomer to scala.js. Various searches indicate that I need to specify a target version of the JVM in build.sbt, but none of the solutions found elsewhere have worked in this case.

I am working from an unmodified clone of this project.

recompile frontend only?

First, thanks so much for this tutorial, I don't know what I would have done without it.

I was wondering if it is possible (or if I missed something) to recompile/re-start the front-end only. My server-side has a relatively long start up time, so it becomes very time consuming when I'm just modifying the layout/css stuff.

It took too long time to release

run sbt release ,but it's still running after an hour.

tian              810 335.0 27.0  5105680 1130920 s000  R+    3:47pm 148:58.62 /usr/bin/java -Xms1024m -Xmx1024m -XX:ReservedCodeCacheSize=128m -XX:MaxMetaspaceSize=256m -jar /usr/local/Cellar/sbt/0.13.9/libexec/sbt-launch.jar release

Check scalajs-react compatibility

@japgolly, could you go over the React code in the "diode-integration" branch and check that it uses scalajs-react TheWayItWasMeantToBeUsed :)

Wouldn't want to set a bad example for the upcoming generations of Scala.js developers!

Issue with char encoding

Define the definition of a todo item as "é" it will appear as "é".
Check or uncheck the item it will become "�©".
Do it once more and it will be "���©" and so on.

Thanks for this nice tutorial !

"Zoom" vs "reader" function

Thanks a ton for your great tutorial!

I spotted a little inconsistency regarding the name of the function used to specify what to read from the model.
In the tutorial it's called reader function, for example here:

Both methods take a reader function that extracts the part of the model we are interested in.

But in ReactConnector#wrap it's called zoomFunc.

Thanks again for your immensely useful tutorial!

Best,
Matthias

Cant even run sbt on cloned repo

I really would like to learn from the repo, but how can I when the first instruction in the tutorial doesnt even work...

/home/kalin/.jdks/openjdk-15.0.1/bin/java -Djline.terminal=jline.UnsupportedTerminal -Dsbt.log.noformat=true -Dfile.encoding=UTF-8 -Didea.managed=true -Dfile.encoding=UTF-8 -jar /home/kalin/.local/share/JetBrains/IntelliJIdea2020.3/Scala/launcher/sbt-launch.jar
[info] Loading project definition from /home/kalin/dev/experiments/scalajs-spa-tutorial/project
[info] Updating {file:/home/kalin/dev/experiments/scalajs-spa-tutorial/project/}scalajs-spa-tutorial-build...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by sbt.ivyint.ErrorMessageAuthenticator$ (file:/home/kalin/.sbt/boot/scala-2.10.6/org.scala-sbt/sbt/0.13.15/ivy-0.13.15.jar) to field java.net.Authenticator.theAuthenticator
WARNING: Please consider reporting this to the maintainers of sbt.ivyint.ErrorMessageAuthenticator$
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] Resolving org.scala-js#sbt-scalajs;0.6.18 ...
[info] Resolving org.scala-js#scalajs-tools_2.10;0.6.18 ...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scala-js#scalajs-ir_2.10;0.6.18 ...
[info] Resolving org.scala-js#closure-compiler-java-6;v20160517 ...
[info] Resolving org.scala-js#closure-compiler-externs-java-6;v20160517 ...
[info] Resolving args4j#args4j;2.0.26 ...
[info] Resolving com.google.guava#guava;19.0 ...
[info] Resolving com.google.protobuf#protobuf-java;2.5.0 ...
[info] Resolving com.google.code.gson#gson;2.2.4 ...
[info] Resolving com.google.code.findbugs#jsr305;1.3.9 ...
[info] Resolving com.googlecode.json-simple#json-simple;1.1.1 ...
[info] Resolving org.scala-js#scalajs-js-envs_2.10;0.6.18 ...
[info] Resolving io.apigee#rhino;1.7R5pre4 ...
[info] Resolving org.webjars#envjs;1.2 ...
[info] Resolving org.scala-js#scalajs-sbt-test-adapter_2.10;0.6.18 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving com.typesafe.sbt#sbt-less;1.0.6 ...
[info] Resolving org.webjars#less-node;1.7.5 ...
[info] Resolving org.webjars#source-map;0.1.31-2 ...
[info] Resolving org.webjars#amdefine;0.1.0-1 ...
[info] Resolving org.webjars#mkdirp;0.3.5 ...
[info] Resolving org.webjars#clean-css;2.2.7 ...
[info] Resolving com.typesafe.sbt#sbt-js-engine;1.0.1 ...
[info] Resolving com.typesafe#jse_2.10;1.0.0 ...
[info] Resolving com.typesafe#jse_2.10;1.0.0 ...
[error] Server access Error: Connection refused url=http://repo.typesafe.com/typesafe/releases/com/typesafe/jse_2.10/1.0.0/jse_2.10-1.0.0.pom
[warn] 	module not found: com.typesafe#jse_2.10;1.0.0
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe/jse_2.10/1.0.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe/jse_2.10/1.0.0/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /home/kalin/.ivy2/local/com.typesafe/jse_2.10/1.0.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/typesafe/jse_2.10/1.0.0/jse_2.10-1.0.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /home/kalin/.sbt/preloaded/com.typesafe/jse_2.10/1.0.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////home/kalin/.sbt/preloaded/com/typesafe/jse_2.10/1.0.0/jse_2.10-1.0.0.pom
[warn] ==== Typesafe Releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/jse_2.10/1.0.0/jse_2.10-1.0.0.pom
[info] Resolving com.typesafe#npm_2.10;1.0.0 ...
[info] Resolving com.typesafe#npm_2.10;1.0.0 ...
[error] Server access Error: Connection refused url=http://repo.typesafe.com/typesafe/releases/com/typesafe/npm_2.10/1.0.0/npm_2.10-1.0.0.pom
[warn] 	module not found: com.typesafe#npm_2.10;1.0.0
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe/npm_2.10/1.0.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe/npm_2.10/1.0.0/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /home/kalin/.ivy2/local/com.typesafe/npm_2.10/1.0.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/typesafe/npm_2.10/1.0.0/npm_2.10-1.0.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /home/kalin/.sbt/preloaded/com.typesafe/npm_2.10/1.0.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////home/kalin/.sbt/preloaded/com/typesafe/npm_2.10/1.0.0/npm_2.10-1.0.0.pom
[warn] ==== Typesafe Releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/npm_2.10/1.0.0/npm_2.10-1.0.0.pom
[info] Resolving com.typesafe.sbt#sbt-web;1.0.2 ...
[info] Resolving com.typesafe.akka#akka-actor_2.10;2.3.2 ...
[info] Resolving com.typesafe#config;1.2.0 ...
[info] Resolving org.webjars#webjars-locator;0.14 ...
[info] Resolving org.slf4j#slf4j-api;1.7.5 ...
[info] Resolving com.fasterxml.jackson.core#jackson-databind;2.3.3 ...
[info] Resolving com.fasterxml.jackson.core#jackson-annotations;2.3.0 ...
[info] Resolving com.fasterxml.jackson.core#jackson-core;2.3.3 ...
[info] Resolving com.typesafe.sbt#sbt-native-packager;1.0.0 ...
[info] Resolving org.apache.commons#commons-compress;1.4.1 ...
[info] Resolving org.tukaani#xz;1.0 ...
[info] Resolving org.vafer#jdeb;1.3 ...
[info] Resolving commons-io#commons-io;2.4 ...
[info] Resolving org.apache.commons#commons-compress;1.7 ...
[info] Resolving org.tukaani#xz;1.4 ...
[info] Resolving org.apache.maven#maven-core;3.2.2 ...
[info] Resolving org.apache.maven#maven-model;3.2.2 ...
[info] Resolving org.codehaus.plexus#plexus-utils;3.0.17 ...
[info] Resolving org.apache.maven#maven-settings;3.2.2 ...
[info] Resolving org.apache.maven#maven-settings-builder;3.2.2 ...
[info] Resolving org.codehaus.plexus#plexus-interpolation;1.19 ...
[info] Resolving org.codehaus.plexus#plexus-component-annotations;1.5.5 ...
[info] Resolving org.sonatype.plexus#plexus-sec-dispatcher;1.3 ...
[info] Resolving org.sonatype.plexus#plexus-cipher;1.4 ...
[info] Resolving org.apache.maven#maven-repository-metadata;3.2.2 ...
[info] Resolving org.apache.maven#maven-artifact;3.2.2 ...
[info] Resolving org.apache.maven#maven-plugin-api;3.2.2 ...
[info] Resolving org.eclipse.sisu#org.eclipse.sisu.plexus;0.0.0.M5 ...
[info] Resolving javax.enterprise#cdi-api;1.0 ...
[info] Resolving javax.annotation#jsr250-api;1.0 ...
[info] Resolving javax.inject#javax.inject;1 ...
[info] Resolving org.sonatype.sisu#sisu-guice;3.1.0 ...
[info] Resolving aopalliance#aopalliance;1.0 ...
[info] Resolving org.eclipse.sisu#org.eclipse.sisu.inject;0.0.0.M5 ...
[info] Resolving org.apache.maven#maven-model-builder;3.2.2 ...
[info] Resolving org.apache.maven#maven-aether-provider;3.2.2 ...
[info] Resolving org.eclipse.aether#aether-api;0.9.0.M2 ...
[info] Resolving org.eclipse.aether#aether-spi;0.9.0.M2 ...
[info] Resolving org.eclipse.aether#aether-util;0.9.0.M2 ...
[info] Resolving org.eclipse.aether#aether-impl;0.9.0.M2 ...
[info] Resolving org.codehaus.plexus#plexus-classworlds;2.5.1 ...
[info] Resolving org.apache.ant#ant;1.9.3 ...
[info] Resolving org.apache.ant#ant-launcher;1.9.3 ...
[info] Resolving org.bouncycastle#bcpg-jdk15on;1.51 ...
[info] Resolving org.bouncycastle#bcprov-jdk15on;1.51 ...
[info] Resolving com.typesafe.play#sbt-plugin;2.5.15 ...
[info] Resolving com.typesafe.play#sbt-routes-compiler_2.10;2.5.15 ...
[info] Resolving com.typesafe.play#twirl-api_2.10;1.1.1 ...
[info] Resolving org.apache.commons#commons-lang3;3.4 ...
[info] Resolving com.typesafe.play#sbt-run-support_2.10;2.5.15 ...
[info] Resolving com.typesafe.play#build-link;2.5.15 ...
[info] Resolving com.typesafe.play#play-exceptions;2.5.15 ...
[info] Resolving com.typesafe.play#twirl-compiler_2.10;1.1.1 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.6 ...
[info] Resolving com.typesafe.play#twirl-parser_2.10;1.1.1 ...
[info] Resolving com.typesafe#config;1.3.1 ...
[info] Resolving net.contentobjects.jnotify#jnotify;0.94-play-1 ...
[info] Resolving com.typesafe.sbt#sbt-twirl;1.1.1 ...
[info] Resolving com.typesafe.sbt#sbt-native-packager;1.1.5 ...
[info] Resolving org.apache.ant#ant;1.9.6 ...
[info] Resolving org.apache.ant#ant-launcher;1.9.6 ...
[info] Resolving com.typesafe.sbt#sbt-web;1.3.0 ...
[info] Resolving com.typesafe.akka#akka-actor_2.10;2.3.9 ...
[info] Resolving org.webjars#webjars-locator;0.26 ...
[info] Resolving org.webjars#webjars-locator-core;0.26 ...
[info] Resolving org.slf4j#slf4j-api;1.7.7 ...
[info] Resolving org.apache.commons#commons-compress;1.9 ...
[info] Resolving com.typesafe.sbt#sbt-js-engine;1.1.3 ...
[info] Resolving com.typesafe#jse_2.10;1.1.2 ...
[info] Resolving com.typesafe.akka#akka-actor_2.10;2.3.11 ...
[info] Resolving com.typesafe.akka#akka-contrib_2.10;2.3.11 ...
[info] Resolving com.typesafe.akka#akka-remote_2.10;2.3.11 ...
[info] Resolving io.netty#netty;3.8.0.Final ...
[info] Resolving org.uncommons.maths#uncommons-maths;1.2.2a ...
[info] Resolving com.typesafe.akka#akka-cluster_2.10;2.3.11 ...
[info] Resolving com.typesafe.akka#akka-persistence-experimental_2.10;2.3.11 ...
[info] Resolving org.iq80.leveldb#leveldb;0.5 ...
[info] Resolving org.iq80.leveldb#leveldb-api;0.5 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-all;1.7 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni;1.7 ...
[info] Resolving org.fusesource.hawtjni#hawtjni-runtime;1.8 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-osx;1.5 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-linux32;1.5 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-linux64;1.5 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-win32;1.5 ...
[info] Resolving org.fusesource.leveldbjni#leveldbjni-win64;1.5 ...
[info] Resolving io.apigee.trireme#trireme-core;0.8.5 ...
[info] Resolving io.apigee.trireme#trireme-node10src;0.8.5 ...
[info] Resolving io.spray#spray-json_2.10;1.3.2 ...
[info] Resolving org.slf4j#slf4j-simple;1.7.12 ...
[info] Resolving org.slf4j#slf4j-api;1.7.12 ...
[info] Resolving com.typesafe#npm_2.10;1.1.1 ...
[info] Resolving org.webjars#npm;2.11.2 ...
[info] Resolving com.vmunier#sbt-web-scalajs;1.0.5 ...
[info] Resolving com.typesafe.sbt#sbt-digest;1.1.0 ...
[info] Resolving com.typesafe.sbt#sbt-gzip;1.0.0 ...
[info] Resolving org.scala-sbt#sbt;0.13.15 ...
[info] Resolving org.scala-sbt#main;0.13.15 ...
[info] Resolving org.scala-sbt#actions;0.13.15 ...
[info] Resolving org.scala-sbt#classpath;0.13.15 ...
[info] Resolving org.scala-sbt#interface;0.13.15 ...
[info] Resolving org.scala-sbt#io;0.13.15 ...
[info] Resolving org.scala-sbt#control;0.13.15 ...
[info] Resolving org.scala-sbt#launcher-interface;1.0.1 ...
[info] Resolving org.scala-sbt#completion;0.13.15 ...
[info] Resolving org.scala-sbt#collections;0.13.15 ...
[info] Resolving jline#jline;2.14.3 ...
[info] Resolving org.scala-sbt#api;0.13.15 ...
[info] Resolving org.scala-sbt#classfile;0.13.15 ...
[info] Resolving org.scala-sbt#logging;0.13.15 ...
[info] Resolving org.scala-sbt#process;0.13.15 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.15 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.15 ...
[info] Resolving org.scala-sbt#relation;0.13.15 ...
[info] Resolving org.scala-sbt#compile;0.13.15 ...
[info] Resolving org.scala-sbt#persist;0.13.15 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.15 ...
[info] Resolving org.scala-sbt#ivy;0.13.15 ...
[info] Resolving org.scala-sbt#cross;0.13.15 ...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-48dd0744422128446aee9ac31aa356ee203cc9f4 ...
[info] Resolving com.jcraft#jsch;0.1.50 ...
[info] Resolving org.scala-sbt#serialization_2.10;0.1.2 ...
[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.1 ...
[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...
[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...
[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...
[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...
[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...
[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.15 ...
[info] Resolving org.scala-sbt#task-system;0.13.15 ...
[info] Resolving org.scala-sbt#tasks;0.13.15 ...
[info] Resolving org.scala-sbt#tracking;0.13.15 ...
[info] Resolving org.scala-sbt#cache;0.13.15 ...
[info] Resolving org.scala-sbt#testing;0.13.15 ...
[info] Resolving org.scala-sbt#test-agent;0.13.15 ...
[info] Resolving org.scala-sbt#main-settings;0.13.15 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.15 ...
[info] Resolving org.scala-sbt#command;0.13.15 ...
[info] Resolving org.scala-sbt#template-resolver;0.1 ...
[info] Resolving org.scala-sbt#logic;0.13.15 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.15 ...
[info] Resolving org.scala-lang#jline;2.10.6 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: com.typesafe#jse_2.10;1.0.0: not found
[warn] 	:: com.typesafe#npm_2.10;1.0.0: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] 	Note: Unresolved dependencies path:
sbt.ResolveException: unresolved dependency: com.typesafe#jse_2.10;1.0.0: not found
unresolved dependency: com.typesafe#npm_2.10;1.0.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
at sbt.IvySbt.withIvy(Ivy.scala:128)
at sbt.IvySbt.withIvy(Ivy.scala:125)
at sbt.IvySbt$Module.withModule(Ivy.scala:156)
at sbt.IvyActions$.updateEither(IvyActions.scala:168)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1488)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1484)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1519)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1517)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1522)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1516)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1539)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1466)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1418)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe#jse_2.10;1.0.0: not found
[error] unresolved dependency: com.typesafe#npm_2.10;1.0.0: not found
Invalid response.

how to use an Observer pattern for query Server

Aim's to querying the mongodb, how can i not use Blocking way for it.

 override def getPost(postId: String): Option[PostItem] ={
    ApiService.observableToRxObservable(postCollection.find(Filters.equal("_id",BsonObjectId(postId))))
      .map(doc => PostFormat.reads(doc)).toBlocking.headOption
  }

I will be grateful for any comment!

Charts rendering are different than chartjs

Hi,
this is different with the documents:

private val MainMenu = ReactComponentB[Props]("MainMenu")
    .stateless
    .backend(new Backend(_))
    .render((P, _, B) => {
    <.ul(bss.navbar)(
      // build a list of menu items
      for (item <- menuItems) yield {
        <.li((P.activeLocation == item.location) ?= (^.className := "active"),
          MainRouter.routerLink(item.location)(item.icon, " ", item.label(P))
        )
      }
    )
  })
    .componentDidMount(_.backend.mounted())
    .build

would be nice if you update the book.

Don't mix RoutingRules and Router

As discussed in scalajs-react gitter

  1. Rename MainRouter to MainRoutes.
  2. Remove {baseUrl, router, routerComponent} from MainRouter.
  3. Best to create router at the JS entry point / init fn and pass it around as a dependency instead of accessing as a singleton.

Render on server

It would be great if the tutorial could explain how to render the initial page with all its react components on the server so that the client doesn't have to.

Latest release crashes on win7 - GC overhead limit exceeded

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\XPS3D>d:

D:>cd cyberthinkers-dev

D:\cyberthinkers-dev>cd scalajs-spa-tutorial

D:\cyberthinkers-dev\scalajs-spa-tutorial>git pull
Already up-to-date.

D:\cyberthinkers-dev\scalajs-spa-tutorial>sbt
[info] Loading global plugins from C:\Users\XPS3D.sbt\0.13\plugins
[info] Loading project definition from D:\cyberthinkers-dev\scalajs-spa-tutorial\project
[info] Set current project to SPAtutorial (in build file:/D:/cyberthinkers-dev/scalajs-spa-tutorial/)
[INFO] [04/10/2015 07:44:26.290] [Workbench-System-akka.actor.default-dispatcher-4] [akka://Workbench-System/user/IO-HTTP/listener-0] Bound to localhost/127.0.0.1:13131

re-start
[info] Fast optimizing D:\cyberthinkers-dev\scalajs-spa-tutorial\jvm\target\scala-2.11\classes\web\js\scalajs-spa-fastopt.js
[info] workbench: Reloading Pages...
[info] Compiling 4 Scala sources to D:\cyberthinkers-dev\scalajs-spa-tutorial\jvm\target\scala-2.11\classes...
[info] LESS compiling on 1 source(s)
Uncaught error from thread [sbt-web-scheduler-1] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[sbt-web]
[ERROR] [04/10/2015 09:10:32.028] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] exception on LARSÆ timer thread
java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.OutOfMemoryError: GC overhead limit exceeded
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:409)
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:409)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
at java.lang.Thread.run(Thread.java:744)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)

    at java.lang.Thread.run(Thread.java:744)

[INFO] [04/10/2015 09:10:32.029] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] starting new LARS thread

D:\cyberthinkers-dev\scalajs-spa-tutorial>

isomorphic scala.js web apo

This tutorial is awesome, thanks!

Now, with all the effort put into having the MVC written in scala, I wonder, would we not be able to execute the web app server-side too: pre-rendering the view as well as pre-loading the model?
Surely we could have classes in scala that implement React rendering?
We do not need the full app, just the rendering and service URI mapping to pre-execute the first Ajax request (piggybacked at the bottom of the html body).
That way we could use real URLs instead of fragments, speed up the first page (happy mobiles) and support web bot crawlers.

What do you think?

build optmized version

I saw this is a part of the next steps but I'd like to push it forward by filing a ticket here. I can help a bit if you can share with me your idea of moving it forward.

checking a todo item creates a duplicate

I added some Todos and whenever I check them as done, I get a duplicate.

screen shot 2015-05-10 at 19 30 19

My IntelliJ EAP is not able to load the project, so it's not easy to find the bug for me. Will continue reading...

The documentation should specify the required jsdom version

I did as a documentation said and installed the latest jsdom npm package(v11.0.0) but I've got an error when running the tests: TypeError: jsdom.createVirtualConsole is not a function. I had to downgrade to v9.0.0 to make the tests run.

The documentation should specify the version of jsdom that the app relies on(and it probably should be updated I guess). If you are ok with adding @9.0.0 to the documentation I can do a quick PR.

Importing bootstrap themes and overriding bootstrap css styles

First of all, thanks for the fantastic contribution!

Anyway, I have been reading both your great doc and intro, as well as the doc here:

https://japgolly.github.io/scalacss/book/quickstart/index.html

However, it isn't clear how to "insert" a bootstrap theme file, or override styles for default bootstrap components (like the nav bar).

If I have a file (e.g. "fooBootStrapTheme.css"), how can I inject that, and then, further, override values it provides?

For example, if I want to change the color of the Nav bar, e.g.:

http://work.smarchal.com/twbscolor/

I can clearly go into GlobalStyles.scala and add my own components with their own styles, e.g.:

  val myNavbar = style(
    addClassName("nav navbar-nav navbar-border"),
    backgroundColor(c"#5432AB")
  )

...but I'd rather pull all this from a main CSS file, and then override the styles surgically as needed. Also, I'd rather not have to specify custom components, but rather have the styles apply to the standard bootstrap components (cascading style sheets, FTW) :)

I apologize in advance if I am completely missing something here...

Thanks!

Bug in selecting todo item

if you delete all items and then add another one, and then click on checkbox of that item, it will add another one with same name.

Modal breaks on scalajs-react 1.4

This tutorial is one of the few and better resources to pick up some scalajs. The modal, however, doesn't work when upgrading to scalajs-react 1.4.

Perhaps the whole project can be updated to latest versions of everything.

Very nice

Thank you for this demo. It is very full-featured, and incorporates several optimal design decisions (eg, using a Flux architecture).

In particular, I'm impressed to see someone using ScalaJS on the front end. I've seen ClojureScript used like this (as a wrapper for React/Flux architectures), but I wasn't expecting to see ScalaJS.

I'm very new to Scala / Spray (perused the manuals a few years ago, and only came back to it today), but the installation went smoothly today - downloaded Scala and sbt and installed this demo, and it was up and running with no errors.

Other possibly related Scala/Spray projects I also installed today were:

https://github.com/jacobus/s4 (provides a RESTful API to a Postgres backend)

https://github.com/onurzdg/spray-app (implements a simple chat app, including authorization / authentication)

It would be great if you later have time to add a RESTful Postgres back-end and authentication / authorization to this project!

How to simulate lag

Hi,

I was wondering how to simulate server-side delays to test "Loading..." messages on the client side.
In the tutorial I've seen that the server does Thread.sleep(300) a couple of times and that the client uses proxy().renderPending(_ > 500, _ => <.p("Loading...")),.

Somehow I expected that if I increased the time the server sleeps to, say, three seconds, that I would then see a "Loading..." message at the client but this is not the case.

Is there a way to simulate a slow or flaky internet connection between server and client while doing localhost development?

Thanks a lot in advance,
Matthias

Nested Components, ModelProxies -- how to nest components with different model objects?

Hi, I am new to ScalaJS React, Diode, etc. and trying out this project, and am building a search dialog that I want to contain a table of results. All is fine -- I can capture the Keyword (represented as a first class model object), do the search, and map the results to a Results object in the model, but I am having trouble nesting the result table in the search dialog, as the result table is currently tied to the Results object and I can't initialize the results child table component from the parent search dialog, as it looks as if the framework only supports a single model proxy inside a render method:

https://gitter.im/ochrons/scalajs-spa-tutorial/archives/2016/06/23

def render(p: Props) = {
  Panel(Panel.Props("Search"), <.div(
    bss.formGroup, ^.marginTop := 20,
    <.label(^.`for` := "lookupField", "Keyword"),
    <.input.text(bss.formControl, ^.width := 200, ^.id := "keyword",
      ^.placeholder := "type keyword search term(s) here",
      ^.onBlur ==> findNearby(p.proxy)),
    <.br,
    <.p(p.proxy.value.getOrElse(Keyword("","")).id)
    // HOW DO I DO THIS? SearchResultsTable()
  ))
}

Do I need to artificially create a new aggregate model object that captures both the query Keyword from the search dialog and the Results from the dialog's table, or is there another way that I am completely missing?

Thanks in advance....

Akka HTTP

Since Spray is in maintenance mode, maybe switch to Akka HTTP? I can provide a commit if you are interested

SBT is broken on Mac OSX Yosemite with sbtenv

When I run the sbt I get the following Error
``is not installedbt-0.13.9I have sbt-0.13.9 installed and functioning. I use it with other projects. But it seems that its broken for this one. What am I missing here ? I'm usingmaster` branch

Thanks in advance

Feature request: running with npm & bower instead/with Webjar

It will be great to see this tutorial work with NPM and Bower instead/with Webjar. Seems like a lot of dependencies are missing from webjar.org and NPM's package.json file seems to be a lot easier to configure to download JS dependencies into a project.

Example using npm-packages with scalajs-bundler

@ochrons First of all, what a great tutorial. Thumbs up 👍
I think it could be interesting to explore the npm dependency problem. AFAIK the tutorial covers only the webjars part.
I've tried myself to add the plugin in the tutorial but it was a fail :( I'm still too newbie in scala-js and in frontend in general 👎

Blog link: http://www.scala-lang.org/blog/2016/10/19/scalajs-bundler.html

Documentation: https://scalacenter.github.io/scalajs-bundler/motivation.html

Feel free to remove this issue if it does not fit this tutorial.

Using jQuery plugin libraries

Hi,
I'm new to scala, scalajs and react, although I'm an experienced dev. I have followed this great tutorial and am now trying to adapt/extend it. Specifically I am trying to display data using a 3rd party plugin (pivottable) which uses standard jQuery syntax:

$("#somediv").pivotUI([{color: "blue", shape: "circle"},{etc}], options)

I have created traits/implicits as per [http://www.scala-js.org/doc/interoperability], however, when the page renders the pivot is empty. But if I view the page a second time (by clicking withi the app - not a full refresh) the data appears. So the async data call must be succeeding but when it completes it is not updating the component that draws the pivot table. (If I render the data in an html table it works fine.)

I am rendering the target div in Backend.render and then executing the js from componentDidMount. I am not sure this is the right way.
Is there a 'right' way to invoke jQuery plugins?

Many thanks.

Using Static (and Versioned) Assets in the Client

Is it possible to include static assets (namely images), served from Play and referenced from Scala.js code? Tricky because—when, for example, using sbt-digest to fingerprint assets—the final asset name isn't known and reverse Assets routes and AssetsFinder can't be used. Soliciting ideas or guidance here since my searches haven't turned up anything.

Fix Korean Translation

The Korean translation of the documentation seems to require a lot of fixing overall, from simple typos and grammatical mistakes to ambiguous and sometimes downright wrong wording.

  • README.md
  • SUMMARY.md
  • getting-started.md
  • application-structure.md
  • the-client.md
  • routing.md
  • main-menu.md
  • dashboard.md
  • css-in-scala.md
  • integrating-javascript-components.md
  • todo-module-and-data-flow.md
  • autowire-and-boopickle.md
  • server-side.md
  • testing.md
  • debugging.md
  • logging.md
  • sbt-build-definition.md
  • using-resources-from-webjars.md
  • production-build.md
  • faq.md
  • what-next.md

akka-http

@ochrons Otto: thank you for great tutorial.
I am curious: do you have plans to move/fork from play to pure akka-http?

not compiling on windows

Hey,
first of all great tutorial!

it won't compile in windows because of a less bug? it seems to go into an endless loop and then get a OutOfMemory Exception.

Using Java 8 btw.

Translate all documents into Japanese

  • README.md
  • SUMMARY.md
  • getting-started.md
  • application-structure.md
  • the-client.md
  • routing.md
  • main-menu.md
  • dashboard.md
  • css-in-scala.md
  • integrating-javascript-components.md
  • todo-module-and-data-flow.md
  • autowire-and-boopickle.md
  • server-side.md
  • testing.md
  • debugging.md
  • logging.md
  • sbt-build-definition.md
  • using-resources-from-webjars.md
  • production-build.md
  • faq.md
  • what-next.md

Failed to add new constructs

Steps to reproduce

I added a new method for API and an object hierarchy similar to TodoPriority (afterwards, I want to use case classes). See the diff here (clone the repository)

MikaelMayer@71a2ec1

Then do sbt run and navigate in your browser to localhost:9000

Expected

No error on the command line

Actual

Request path: spatutorial/shared/Api/getTodos
Request path: spatutorial/shared/Api/getMessage
Request path: spatutorial/shared/Api/motd
Sending 4 Todo items
[error] p.c.s.n.PlayDefaultUpstreamHandler - Cannot invoke the action
scala.MatchError: Request(WrappedArray(spatutorial, shared, Api, getMessage),Map
(what -> java.nio.HeapByteBuffer[pos=0 lim=3 cap=3])) (of class autowire.Core$Re
quest)
    at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:253) ~[scala-library-2.11.7.jar:na]
    at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:251) ~[scala-library-2.11.7.jar:na]
    at controllers.Application$$anonfun$autowireApi$1$$anonfun$apply$1.applyOrElse(Application.scala:32) ~[classes/:na]
    at controllers.Application$$anonfun$autowireApi$1$$anonfun$apply$1.applyOrElse(Application.scala:32) ~[classes/:na]
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[scala-library-2.11.7.jar:na]
    at controllers.Application$$anonfun$autowireApi$1.apply(Application.scala:32) ~[classes/:na]
    at controllers.Application$$anonfun$autowireApi$1.apply(Application.scala:25) ~[classes/:na]
    at play.api.mvc.Action$.invokeBlock(Action.scala:533) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.mvc.Action$.invokeBlock(Action.scala:530) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:493) ~[play_2.11-2.4.2.jar:2.4.2][error] application -! @6nd17m8mc - Internal server error, for (POST) [/api/spatutorial/shared/Api/getMessage] ->play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[MatchError: Request(WrappedArray(spatutorial, shared, Api, getMessage),Map(what -> java.nio.HeapByteBuffer[pos=0 lim=3 cap=3])) (of class autowire.Core$Request)]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:265) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:191) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.GlobalSettings$class.onError(GlobalSettings.scala:179) [play_2.11-2.4.2.jar:2.4.2]
    at play.api.DefaultGlobal$.onError(GlobalSettings.scala:212) [play_2.11-2.4.2.jar:2.4.2]
    at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:94) [play_2.11-2.4.2.jar:2.4.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:273) [play-netty-server_2.11-2.4.2.jar:2.4.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:269) [play-netty-server_2.11-2.4.2.jar:2.4.2]
    at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library-2.11.7.jar:na]
    at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library-2.11.7.jar:na]
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.11.7.jar:na]Caused by: scala.MatchError: Request(WrappedArray(spatutorial, shared, Api, getMessage),Map(what -> java.nio.HeapByteBuffer[pos=0 lim=3 cap=3])) (of class autowire.Core$Request)
    at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:253) ~[scala-library-2.11.7.jar:na]
    at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:251) ~[scala-library-2.11.7.jar:na]
    at controllers.Application$$anonfun$autowireApi$1$$anonfun$apply$1.applyOrElse(Application.scala:32) ~[classes/:na]
    at controllers.Application$$anonfun$autowireApi$1$$anonfun$apply$1.applyOrElse(Application.scala:32) ~[classes/:na]
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[scala-library-2.11.7.jar:na]
    at controllers.Application$$anonfun$autowireApi$1.apply(Application.scala:32) ~[classes/:na]
    at controllers.Application$$anonfun$autowireApi$1.apply(Application.scala:25) ~[classes/:na]
    at play.api.mvc.Action$.invokeBlock(Action.scala:533) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.mvc.Action$.invokeBlock(Action.scala:530) ~[play_2.11-2.4.2.jar:2.4.2]
    at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:493) ~[play_2.11-2.4.2.jar:2.4.2]CLIENT - [{"logger":"Log","timestamp":1441725398897,"level":"INFO","url":"http://localhost:9000/","message":"This message goes to server as well"}]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.