These are chat archives for ThoughtWorksInc/Binding.scala

14th
Jan 2017
Longyang Zhang
@zhanglongyang
Jan 14 2017 01:04
Changing object BindingScalaDemo extends JSApp with App to @JSExport object BindingScalaDemo fixed it. :)
杨博 (Yang Bo)
@Atry
Jan 14 2017 02:33
JSApp with App makes me shiver
Both traits performs some magic transformation in your object, I would not suprise if the two traits conflict each other
Longyang Zhang
@zhanglongyang
Jan 14 2017 02:57

I think the reason is because trait App extends DelayedInit.

It should be noted that this trait is implemented using the [[DelayedInit]] functionality, which means that fields of the object will not have been initialized before the main method has been executed.

so after I move val data = Vars() into @dom def table: Binding[Table], object BindingScalaDemo extends JSApp with App starts to work.

杨博 (Yang Bo)
@Atry
Jan 14 2017 02:58
Just as you said
jfilali
@jfilali
Jan 14 2017 04:20
@Atry Looking at fxml.scala, look like you are making more and more progress ! This is very impressive code. I can't wait to give it a try. Look like you are getting close to the end.
Is fxml will need java to run or will it be translated in html - javascript. I'm not very familiar with javafx.
杨博 (Yang Bo)
@Atry
Jan 14 2017 05:10
@jfilali fxml.scala supports arbitary JavaBeans. Technically you will be able to use it in Scala.js, however, without JavaFX / Swing components, it is not very useful.
jfilali
@jfilali
Jan 14 2017 05:31

@Atry The use case I was the most interested was simply to declare custom tags that will render components. Something like <CustomTag requiredAttribute=1 otherRequiredAttribute="other"> </CustomTag>

You already mention a workaround there :
ThoughtWorksInc/Binding.scala#4

But it was not working for me at least or I missed something. I was hoping that will be easier with the JavaBean and FXML.

杨博 (Yang Bo)
@Atry
Jan 14 2017 05:35
I would recommend you simply create functions with different implementations for different platforms, instead of custom tags.
{ customTag(requiredAttribute=1, otherRequiredAttribute="other" ) }
Binding.scala's tags is a syntax sugar that represents an underlying mutable model.
I guess a reuseable cross-platform component may be not a mutable model.
杨博 (Yang Bo)
@Atry
Jan 14 2017 05:49
Anyway, the new FXML syntax will resolve ThoughtWorksInc/Binding.scala#4 if you prefer XML syntax instead of simple function calls
jfilali
@jfilali
Jan 14 2017 05:54
;-) You made my day. Actually I have been using Binding.scala with the flux/Model And even though it is a mutable model , it work very well. I follow the idea of having container that connect to the store and presentational components that take arguments in the form of Binding[Node] objects and I found that aproach very scalable.
I need to write some blog so far but my experience have been really good. I have improve my productivity. A project in React-js took me 2 months. One in React-Scala-ja a month and with Binding 2 weeks.
I will write a blog sometime soon to describe my experience.
杨博 (Yang Bo)
@Atry
Jan 14 2017 05:56
Cool
Let me know when you complete it
jfilali
@jfilali
Jan 14 2017 05:57
yeah sure I will keep you updated. ;-)
Darcy Shen
@sadhen
Jan 14 2017 15:02
also interested in custom tag
I'm thinking about writing something like ant-design
杨博 (Yang Bo)
@Atry
Jan 14 2017 15:32
@sadhen Sounds great!
Darcy Shen
@sadhen
Jan 14 2017 15:36
It seems I need to wait for the new FXML syntax
杨博 (Yang Bo)
@Atry
Jan 14 2017 15:37
You can try it on 11.0.x branch
I will publish a milestone binary release today or tomorrow
Darcy Shen
@sadhen
Jan 14 2017 15:38
nice
杨博 (Yang Bo)
@Atry
Jan 14 2017 15:48
Hi, all, I want to ask you guys a question: would you like to see the deprecated APIs getting removed in the next majoy version (11.0.0)?
Jordan Gwyn
@emanresusername
Jan 14 2017 22:38
@Atry i, for one, am always in favor of cleaning out deprecated stuff when you can :+1:
also, i’m trying to do an infinite scrolling thing, but the neither the onmousewheel or the onscroll handlers are firing like i expected, any examples how to use those properly with binding.scala?