Binding.scala
Binding.scala copied to clipboard
Marcros not working (did add the compiler plugin)
I have a working project to test drive some of the things i want to do in a larger application. Within this larger application i am not able to get macros to work. This is my project definition
lazy val frontApp = (project in file("clients/front-app")).
enablePlugins(ScalaJSPlugin).
settings(
scalaVersion := "2.12.6",
libraryDependencies ++= Seq(`scalajs-dom`.value, `binding.scala`.value, `binding.scala-future`.value),
skip in packageJSDependencies := false,
relativeSourceMaps := true,
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)
However it keeps coming back with the error that scala.xml.Elem is not equired: com.thoughtworks.binding.Binding[org.scalajs.dom.Node]
I am using bare minimum test code:
@JSExportTopLevel("Suggestions")
object FrontApp {
@JSExport
def main(): Unit = {
dom.render(document.body, d)
}
@dom
def d: Binding[Node] = {
<div>hello</div>
}
}
This code works in a separate project, but not inside my larger multi-project
Ok there was something wrong with my imports:
This works:
import org.scalajs.dom.{Event, Node, document}
import com.thoughtworks.binding.{Binding, dom}
When i add
import com.thoughtworks.binding.dom
It no longer works.
Not reproducible
have a look at https://github.com/rparree/binding.scala-issue82
Open playfield/SampleApp.scala
Uncomment the line and try to do a fastOpsJS. With the line commented it works for me, with the line uncommented it breaks
Interesting, I suspect there is an underlying bug in https://github.com/scalamacros/paradise
i think so as well. have filed an issue there.
Thanks your framework rocks.