raquo / Snabbdom.scala

Virtual DOM for Scala.js based on Snabbdom.js
MIT License
8 stars 1 forks source link

unable to run examples #5

Open doofin opened 6 years ago

doofin commented 6 years ago

The short example is not working,the symbol := and lots of other things are undefined,do i have to add some other dependencies or the api is changed?

raquo commented 6 years ago

Ah sorry, it looks like import com.raquo.snabbdom.simple.implicits._ is missing from the docs. You need that import as well.

doofin commented 6 years ago

Thanks,I will try that later.

doofin commented 6 years ago

I am not sure whether it is appropriate to ask other problems here but when i am doing some experiments i encounter this problem with snabbdom (https://github.com/scalacenter/scalajs-bundler/issues/195) and no one replies for some time,very grateful if you would like to help! (actually I am trying to implement something like react on top of snabbdom but with a purer object-oriented way,which allows you to write web ui like native android ui)

raquo commented 6 years ago

I'm a bit confused... In the scala.js bundler issue, are you trying to use Snabbdom.scala in one of your projects, or are you trying to create your own interface to snabbdom.js that you would be using without Snabbdom.scala?

There's... too many things going on here at once, it would be easier to give advice with a simple failing case without all the other classes and dependencies. It does seem like a build configuration issue or a mistake in jsimport annotations but i can't put my finger on it yet.

Let's start with – were you able to get the basic Snabbdom.scala example to work?

doofin commented 6 years ago

Sorry for the confusion..Actually I am doing two things on parallel:play with your library and create my own interface to snabbdom.js without snabbdom.scala. I still can't get snabbdom.scala to work after

import com.raquo.snabbdom.simple.implicits._

it then complains that there is no

snabbdom.modules

in

val patch = Snabbdom.init(snabbdom.modules)

raquo commented 6 years ago

Sorry, another error in the example: the correct name is snabbdom.builtInModules, I must have renamed it at some point and forgot to update the docs. I hope this is the last required fix, but let me know if you're still having issues running the example.

As for rolling your own snabbdom.js interface, I suggest once you have the Snabbdom.scala example working, just copy over all the build-related and jsimport-related stuff from this project into yours to get yourself started. Scala/Scala.js build tooling can be really dense at times, so it's good to start with something that you know works.

doofin commented 6 years ago

I have got my own bindings work! The problem is the version of snabbom(the api of 0.7.0 has changed ) and incorrect caching of sbt-bundler