chandu0101/scalajs-react-template

how to run this template?

extirpate opened this issue · 8 comments

i tried
sbt
container:start Or run or runMain or jetty:start

none of them works.

sbt
run
show me these errors

run
[info] Running scalajsreact.template.ReactApp
org.mozilla.javascript.EcmaError: TypeError: Cannot set property "React" of undefined to "[object Object]" (/Users/zn/.ivy2/cache/org.webjars/react/jars/react-0.12.1.jar#META-INF/resources/webjars/react/0.12.1/react-with-addons.js#4)

exec python -m SimpleHTTPServer 4000

i found this file "serve.sh" in another place, it works!

i am wondering is this just for test or learn, not a robust http server ? if i want to scale this template in a production server, can you give some suggestion?

my real purpose is to use scalajs-react with lift-web, still i can't find the right way

there is no inbuilt server for this project , you must bring your own. Sorry i don't have any experience with lift-web

can i just precompile scalajs-react into something under webapp, and not use the router things which renders the components directly.If all in the webapp, then i can use other framework in the server side.Thank you very much!

发自我的 iPhone

在 2015年11月6日,06:14,Chandra Sekhar Kode notifications@github.com 写道:

there is no inbuilt server for this project , you must bring your own. Sorry i don't have any experience with lift-web


Reply to this email directly or view it on GitHub.

if you want to serve html directly from server then take a look at server side rendering of react , unfortunately i have no experience with server side stuff, may be you can ask here https://github.com/japgolly/scalajs-react

I used https://github.com/lihaoyi/workbench to run the template.

Add the following to plugins.sbt

addSbtPlugin("com.lihaoyi" % "workbench" % "0.2.3")

Add the following to build.sbt

import com.lihaoyi.workbench.Plugin._
workbenchSettings
bootSnippet := "ReactApp().main();"
updateBrowsers <<= updateBrowsers.triggeredBy(fastOptJS in Compile)

When you run sbt a local web server will also start. Go to http://localhost:12345/index.html and the app should appear.

"The requested resource could not be found."
when add the following to build.sbt

refreshBrowsers <<= refreshBrowsers.triggeredBy(fastOptJS in Compile)

@extirpate I made a pull request using workbench based on what you were saying: #7