These are chat archives for chandu0101/scalajs-react-components

31st
May 2017
Øyvind Raddum Berg
@oyvindberg
May 31 2017 00:08
great!
so i finally had some time to have a look now
chandu0101/scalajs-react-components@ff91348
Øyvind Raddum Berg
@oyvindberg
May 31 2017 00:14
thats what I managed to come up with to get a simple demo working. updated the macro to handle Vdom(Node|Element), and found JsComponent
integrating the generator and rewriting the build looks great :thumbsup:
Roberto Leibman
@rleibman
May 31 2017 04:45
Awesome, I brought in your changes, the generation is going well and the compiler is doing it's thing. Man, it's super slow, I'm assuming it's the JsMacro, but it's taking forever to compile the whole thing.
Roberto Leibman
@rleibman
May 31 2017 04:54
I've never played much with Macros, it's odd trying to figure out what's wrong with it, do you have any tips? for example:
[error] /home/rleibman/workspace.scala/scalajs-react-components/gen/target/scala-2.12/src_managed/MuiSelectField.scala:136: missing parameter type
[error]     val props = JSMacro[MuiSelectField[T]](this)
[error]                        ^
Anyway... going to bed, I checked in what I have so far.
Now that I know how the whole generator works I may do the same for elemental-ui.
Øyvind Raddum Berg
@oyvindberg
May 31 2017 10:25
You can println from the macro, si thata easy debugging right there
Roberto Leibman
@rleibman
May 31 2017 16:01
Hey... I'm down to less than 10 compiler errors. I'm not sure what this one means:
[error] /home/rleibman/workspace.scala/scalajs-react-components/gen/target/scala-2.12/src_managed/MuiStepLabel.scala:38: diverging implicit expansion for type scala.scalajs.js.|.Evidence[String,B]
[error] starting with method left in class EvidenceLowPrioImplicits
[error]     val props = JSMacro[MuiStepLabel](this)
[error]                        ^
It's happening on MuiStepLabel, I'm guessing because of it's icon property, which the generator is rendering as:
  icon:               js.UndefOr[VdomElement | String | Double] = js.undefined,
Øyvind Raddum Berg
@oyvindberg
May 31 2017 22:56
That implicit might not be tested with a union type of more than two type params
Sounds like it could be ReactNode
Roberto Leibman
@rleibman
May 31 2017 23:12
I changed it to ReactElement instead of VdomElement and that seemed to work.
Roberto Leibman
@rleibman
May 31 2017 23:30
The next thing is the case of Generic Params (e.g. MuiIconMenu, MuiMenu)
[error] /home/rleibman/workspace.scala/scalajs-react-components/gen/target/scala-2.12/src_managed/MuiIconMenu.scala:154: diverging implicit expansion for type scala.scalajs.js.|.Evidence[T,B]
[error] starting with method left in class EvidenceLowPrioImplicits
[error]     val props = JSMacro[MuiIconMenu[T]](this)
[error]                        ^