Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:33

    Atry on Atry-patch-1

    (compare)

  • 04:33

    Atry on master

    Upgrade Scala version Merge pull request #224 from Th… (compare)

  • 04:33
    Atry closed #224
  • 03:00
    Atry opened #224
  • 03:00

    Atry on Atry-patch-1

    Upgrade Scala version (compare)

  • 02:59

    Atry on master

    Update sbt-scalajs, scalajs-com… Merge pull request #213 from sc… (compare)

  • 02:59
    Atry closed #213
  • Nov 20 07:38

    Atry on v11.8.2

    (compare)

  • Nov 20 07:37

    Atry on v11.9.0

    (compare)

  • Nov 20 07:33

    Atry on v11.8.2

    (compare)

  • Nov 20 07:27

    Atry on 219-fix

    (compare)

  • Nov 20 07:27
    Atry closed #219
  • Nov 20 07:27

    Atry on master

    Always update for views and mut… Merge pull request #220 from Th… (compare)

  • Nov 20 07:27
    Atry closed #220
  • Nov 20 07:12
    Atry synchronize #220
  • Nov 20 07:12

    Atry on 219-fix

    Always update for views and mut… (compare)

  • Nov 20 01:33
    Atry reopened #219
  • Nov 20 01:32
    Atry closed #219
  • Oct 09 04:00
    notyy commented #222
  • Oct 09 03:59
    notyy closed #222
杨博 (Yang Bo)
@Atry
I prefer not to fight convention in these minor things
jfilali
@jfilali
@Atry : This is a good article but let me give you a example with JavaFX
why is there fxml ?
杨博 (Yang Bo)
@Atry
Binding.scala supports HTML and FXML, not because we dislike ScalaTags syntax.
Because HTML and FXML are existing languages.
So you can copy and paste them from your favorite design tools
nawfalhasan
@nawfalhasan
杨博 (Yang Bo)
@Atry
@nawfalhasan Binding.scala's partial updating is very fast, even faster than vanillajs for some operations. However, the benchmark does not count operations faster than 16ms.
Nikolay Artamonov
@nartamonov
@Atry But why is memory consumption is so high according to benchmark? 24 MB after adding 10000 rows. Is it expected result for such frameworks like Binding.scala, or not?
杨博 (Yang Bo)
@Atry
Because of scala-js/scala-js#2675 I guess
Nikolay Artamonov
@nartamonov
Okay, so there is hope it will be optimized in future :+1:
nawfalhasan
@nawfalhasan
I see. Fair enough..
Jordan Gwyn
@emanresusername
@Atry finally got things together here’s a complete version of the project i was asking about about before. hopefully this can be useful as a resource example using Binding.scala in the wild as well
杨博 (Yang Bo)
@Atry
@emanresusername, very impressive.
I think it can be a benchmark for DOM-based animation also
Jordan Gwyn
@emanresusername
Thanks! Hope it's at least entertaining if not useful :sweat_smile:
杨博 (Yang Bo)
@Atry
I think it would be a very good showcase for web extensions built from Scala.js + Binding.scala
The name linfinity sounds like linsanity :smile:
杨博 (Yang Bo)
@Atry
@emanresusername I guess you can wrap each row in a <pre> tag, so that the user may choose whitespace as the blank character.
Jordan Gwyn
@emanresusername
Oohh good point!
Alex Reisberg
@a-reisberg
I just came across this project. Looks very nice!
I have a quick question: how do you insert a Binding twice
for eg
  @dom val hello: Binding[Node] = <p>Hello from Binding.scala</p>

  @dom val helloTwice: Binding[Node] =
    <div>
      {hello.bind}
      {hello.bind}
    </div>
I got Cannot insert P twice!
杨博 (Yang Bo)
@Atry
Change hello to a def @a-reisberg
杨博 (Yang Bo)
@Atry
This is a limitation of DOM API, since a HTML node only has one parent
Alex Reisberg
@a-reisberg
@Atry Thanks!
so when I do .bind, hello is mutated under the hood?
Alex Reisberg
@a-reisberg
maybe it's good to have Binding[_] lazy by default
杨博 (Yang Bo)
@Atry
I did not get what does "lazy" mean
Alex Reisberg
@a-reisberg
Binding[Node] would then be approximately () => Binding[Node] in the current incarnation
杨博 (Yang Bo)
@Atry
Then you should use def by default
Alex Reisberg
@a-reisberg
yeah :)
Thanks!
杨博 (Yang Bo)
@Atry
A Binding is a container that continuously maintain its element according to upstream changes.
Alex Reisberg
@a-reisberg
Right
杨博 (Yang Bo)
@Atry
if you need two different values, you need two containers
Alex Reisberg
@a-reisberg
btw, when I have
@dom def hello: Binding[Node] = <p>Hello from Binding.scala</p>
intellij complains about type issues. Is it possible to make it go away?
Found Elem, required Binding[Node]
杨博 (Yang Bo)
@Atry
You can create an implicit view to make IntelliJ happy
Alex Reisberg
@a-reisberg
Ah, thanks.
I'm gonna keep playing with it. It seems quite nice!
杨博 (Yang Bo)
@Atry
@a-reisberg Would you mind editing FAQ to include this workaround for IntelliJ?
Alex Reisberg
@a-reisberg
Will do!
Alex Reisberg
@a-reisberg
Hi again, quick question: how do you make the following work:
@dom def hello: Binding[Node] = <p>Hello from Binding.scala</p>

@dom def helloTwice: Binding[Node] =
  <div>
    {
      (1 to 10).map(_ => Binding{hello.bind})
    }
  </div>
杨博 (Yang Bo)
@Atry
See FAQ
Alex Reisberg
@a-reisberg
I did, that's how I added the Binding
FAQ says:
someCollection.map(item => Binding { renderItem(item.bind) } )
杨博 (Yang Bo)
@Atry
(1 to 10).map(_ => Binding{hello.bind}) should compile