Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 16 18:58
    scala-steward opened #253
  • Jan 07 16:20
    Atry closed #252
  • Jan 07 16:20
    Atry commented #252
  • Jan 07 09:27
    jilen opened #252
  • Jan 01 02:28

    Atry on master

    Update README.md (compare)

  • Dec 30 2019 04:22

    Atry on master

    Update README.md (compare)

  • Dec 30 2019 04:15
    Atry closed #175
  • Dec 30 2019 03:52
    Atry commented #175
  • Dec 30 2019 03:52
    Atry commented #175
  • Dec 30 2019 03:51
    Atry commented #175
  • Dec 30 2019 03:48
    Atry commented #175
  • Dec 30 2019 03:46
    Atry edited #175
  • Dec 30 2019 03:46
    Atry edited #175
  • Dec 26 2019 16:25

    Atry on upgrade-sbt-best-practice

    (compare)

  • Dec 26 2019 16:25
    Atry closed #249
  • Dec 26 2019 16:25

    Atry on master

    Update sbt-best-practice to 7.2… Merge pull request #250 from sc… (compare)

  • Dec 26 2019 16:25
    Atry closed #250
  • Dec 26 2019 16:25

    Atry on master

    Update sbt to 1.3.6 Merge pull request #251 from sc… (compare)

  • Dec 26 2019 16:25
    Atry closed #251
  • Dec 26 2019 11:59
    scala-steward opened #251
Mustafa Kuscu
@mcku
OK, there is XHTML5: "HTML5 and XHTML5 have identical vocabulary but different parsing rules"
Mustafa Kuscu
@mcku
ok. looks good now
杨博 (Yang Bo)
@Atry
StackOverflow + Google is brilliant. It is available to search immediately https://www.google.com/search?q=aria+binding.scala
Mustafa Kuscu
@mcku
i agree. very quick
杨博 (Yang Bo)
@Atry
Other users will benifit from that
Pascal Mengelt
@pme123
@mcku I used also in a Typescript project Redux - I created a blog with my findings - trying to adapt redux principles and ideas to the world of scala.js and Binding.scala - maybe you have some ideas;) https://pme123.github.io/scala-adapters/development/binding-scala-redux/
杨博 (Yang Bo)
@Atry

ensure that the components cannot modify the state

@pme123 What is the purpose of this rule?

杨博 (Yang Bo)
@Atry

Suppose you are creating an application for both desktop and web. You can share the same store (aka View Model) and external web services for both applications, and create different FXML template / HTML template.

However the two GUIs need some slightly different operations on View Model. Is it really necessary to share all those operations even when some of them are platform-specific?

I want to share some words from ESR's TAOUP
http://www.catb.org/esr/writings/taoup/html/ch01s06.html#id2878263

Rule of Representation: Fold knowledge into data, so program logic can be stupid and robust.

Mustafa Kuscu
@mcku
This makes me think about platforms other than HTML once again. React has React Native complement, suitable for devices implementation. I suppose FXML is for certain Java desktops. Any ideas on how to reuse the binding.scala app on the mobile in a native way?
杨博 (Yang Bo)
@Atry
The current FXML syntax shoud apply for Android as well, since Android components are JavaBeans. But I did not test it yet.
Mustafa Kuscu
@mcku
@pme123 I liked the idea of such a blog. I don't think many people are aware of such a facilitation provided by binding.scala. People still think they are type safe in typescript but the need to put extra effort to keep it type safe given the huge variety of emerging rival untyped javascript paradigms. At some point you give up type safety, at least i have that feeling.
@atry that sounds very interesting and of good utility
杨博 (Yang Bo)
@Atry
I thought it would be great to create some complex actions on stores for reusing. But I personally will not forbid to access stores directly.
杨博 (Yang Bo)
@Atry
Seperate of View Model and View could be useful or not, depends on which part tends to be changed frequently.
杨博 (Yang Bo)
@Atry

@pme123 If you like Redux's immutable store, and still want partial rendering. you can create some intermediate Bindings, which can prevent unchanged value from re-rendering

An example is here:
https://scalafiddle.io/sf/o5fWdS3/2

render2 is not triggered because store2 is unchanged.

Open your browser's inspector to see if it is re-rendered.

Mustafa Kuscu
@mcku
will look at the fxml example hopefully some day. wondering about how the dev workflow looks like. scenebuilder comes into the scene too?
杨博 (Yang Bo)
@Atry
I'm not familiar with Android. But the @fxml can mount your bindable data onto any JavaBeans.
Pascal Mengelt
@pme123
@Atry thanks for your feedback and ScalaFiddle
杨博 (Yang Bo)
@Atry
Feel free to take the fiddle to your blog
An updated version is https://scalafiddle.io/sf/o5fWdS3/3
Pascal Mengelt
@pme123
@Atry - thanks - the comments work now;) could you add your input as a comment - would be great! https://pme123.github.io/scala-adapters/development/binding-scala-redux/
Mustafa Kuscu
@mcku
What if a store has an optional substore? See: https://scalafiddle.io/sf/goKYlDa/0
杨博 (Yang Bo)
@Atry
Check your browser's inspector
Mustafa Kuscu
@mcku
isn't it working?
Kahli Burke
@kahliburke
Check the stackoverflow
Pascal Mengelt
@pme123
@kahliburke thanks - that helps - I updated the ScalaFiddle to see the effect.
Leonid Turnaev
@glmars
@Atry do you have any plans to migrate Binding.scala to Dsl.scala and Cats?
Do I understand correctly what it is possible? How hard is it in you opinion (may be PR can help)?
杨博 (Yang Bo)
@Atry

It could be.

But I did not see enough benifits.

Lorenzo Gabriele
@lolgab
There are ways to get the value of an input (like the inputId.value thing ) for dynamic elements (like a Seq of inputs) ? (The id is not fixed at compile time)
If it is a interesting question I can post it on StackOverflow.
Leonid Turnaev
@glmars
@Atry, to have the single FP library (cats) in projects which uses Binding.scala
杨博 (Yang Bo)
@Atry
@lolgab Go ahead
@glmars Binding.scala uses Scalaz because Each requires scalaz.Monad.
However, Dsl.scala does not depend on Cats nor Scalaz.
Binding.scala does not have to depend on Cats if we replace Each to Dsl.scala
Leonid Turnaev
@glmars
So, there is an additional benefit: reduced scalajs output size (Scalaz isn't so small in JS)! In case if some project still doesn't use any FP library.
杨博 (Yang Bo)
@Atry

(Scalaz isn't so small in JS)

The entire Scalaz is big. Fortunately a typical web application with Binding.scala only uses a very small part of Scalaz. You can open your xxxx-fastopt.js to check it. DCE in Scala.js is very useful.

Leonid Turnaev
@glmars

DCE in Scala.js is very useful

I agree, DSE is cool. But on some project I had 2640/2400 kb result of fullOptJS with/without Scalaz.

I suppose that the influence of Scalaz in Binding.scala can be not so much.
(my test project have not used Binding.scala)
Leonid Turnaev
@glmars

@Atry Unfortunately I found a case where application which uses Binding.scala should depend on Scalaz. Please, see example from FAQ:

@dom def renderList(data: List[Binding[String]]) = <ol>{
  import scalaz.std.list._ // Type classes for List
  for (b <- data) yield {
    <li>{b.bind}</li>
  }
}</ol>

Can Dsl.scala remove this dependency (or change to Cats)?

杨博 (Yang Bo)
@Atry
Of course, because Dsl.scala does not support for-comprehension
Dsl.scala itself can be considered as an alternative to for-comprehension
Leonid Turnaev
@glmars
:smile: O! I understand.
Leonid Turnaev
@glmars

@Atry If you're interested, I have repeated the js-framework-benchmark with different versions of Binding.scala.
Here are results for: Chrome 32-bit and for: Chrome 64-bit (sorry, 3 runs only).

Conclusions and questions:

  • your conclusions about Scala 2.12 was confirmed, memory usage is increased by 22-23%:

glmars-v2.12-memory.png

  • but the absolute values are lower than in your results:

atry-v2.12-memory.png

  • I especially pleases by memory consumption on a 32-bit version of Chrome:

32-bit-memory.png

  • one question only: do you have any guesses why the clear rows time increased in Binding.scala v11.0.1?

clear-rows-increase.png

杨博 (Yang Bo)
@Atry
v11 fixed a bug in v10 when removing a node. The fix to ThoughtWorksInc/Binding.scala#56 performs some internal cache invalidation.
Leonid Turnaev
@glmars
Thank you, I also thought about this task :smile:
杨博 (Yang Bo)
@Atry
There could be an optimization in Scala.js scala-js/scala-js#2675, which should improve both code size and computational performance.