Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 09 04:00
    notyy commented #222
  • Oct 09 03:59
    notyy closed #222
  • Oct 09 03:59
    notyy commented #222
  • Oct 08 20:28
    Atry commented #223
  • Oct 08 20:28

    Atry on master

    docs: fix typo Merge pull request #223 from Ja… (compare)

  • Oct 08 20:28
    Atry closed #223
  • Oct 08 20:20
    Jason-Cooke opened #223
  • Oct 07 03:30
    glmars commented #222
  • Oct 06 04:05
    notyy opened #222
  • Oct 04 11:29
    datalchemist commented #217
  • Oct 04 11:02
    datalchemist commented #217
  • Oct 04 06:58

    Atry on scalafmt

    (compare)

  • Oct 04 06:46

    Atry on master

    Run scalafmt Merge branch 'master' into scal… Merge pull request #221 from Th… (compare)

  • Oct 04 06:46
    Atry closed #221
  • Oct 04 06:46
    Atry synchronize #221
  • Oct 04 06:46

    Atry on scalafmt

    Update scalafmt to 2.0.1 Update sbt to 1.3.2 Merge pull request #215 from sc… and 2 more (compare)

  • Oct 04 06:06
    Atry commented #217
  • Oct 04 05:30
    glmars commented #217
  • Oct 04 05:09
    Atry closed #191
  • Oct 04 05:09

    Atry on master

    Update scalafmt to 2.0.1 Merge pull request #203 from sc… (compare)

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
Alex Reisberg
@a-reisberg
that's exactly the same as what I wrote above right?
杨博 (Yang Bo)
@Atry
However, the type is Seq[Binding[Node]], which is unable to be inserted into DOM.
Alex Reisberg
@a-reisberg
oh, so I should remove the { ...}
杨博 (Yang Bo)
@Atry
You need a Seq[Node] or BindingSeq[Node] in order to insert to the DOM
So you may look at the other solutions
Alex Reisberg
@a-reisberg
Ok, I got the Constants one to work
but since this one was mentioned as one of the solutions
I thought that it might work as well