Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marcros not working (did add the compiler plugin) #82

Open
rparree opened this issue Jun 11, 2018 · 5 comments
Open

Marcros not working (did add the compiler plugin) #82

rparree opened this issue Jun 11, 2018 · 5 comments

Comments

@rparree
Copy link

rparree commented Jun 11, 2018

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

@rparree rparree changed the title Marcros now working (did add the compiler plugin) Marcros not working (did add the compiler plugin) Jun 11, 2018
@rparree
Copy link
Author

rparree commented Jun 11, 2018

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.

@Atry
Copy link
Collaborator

Atry commented Jun 11, 2018

Not reproducible

@rparree
Copy link
Author

rparree commented Jun 11, 2018

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

@Atry
Copy link
Collaborator

Atry commented Jun 11, 2018

Interesting, I suspect there is an underlying bug in https://github.com/scalamacros/paradise

@rparree
Copy link
Author

rparree commented Jun 11, 2018

i think so as well. have filed an issue there.

Thanks your framework rocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants