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)

杨博 (Yang Bo)
@Atry
I did not understand what's the meaning of maximum level of complexity
jfilali
@jfilali
  @dom def apply(usersPage: Var[SubMenuInUsers]) : Binding[Node]= {


      usersPage.bind match {
        case AllUsersPage() =>  AllUsersComponents(
          Graphql.DoAjaxAndReturnDom(
            request = QueryBinding(AllUsersInATable.formGroupDefinitionsFrag, AllUserInATable.usersFrag),

            displayOnSuccess = (result:ValueResult) => AllUsersInATable(
              result.obj("data").obj("formGroupDefinitions").list(),

              result.obj("data").obj("users").list(),

              (result:ValueResult) => SomeNestingComponent(
                  "title",
                  value2,

              )

              onClickUserId = (userId:String) => (e:Event)=> {
                usersPage := SingleUserPage(Var(userId))
              }
            )
          )
        ).bind
        case SingleUserPage(userId) =>  SingleUserMatrix.Container().bind
        case GroupPage =>  GetAllGroupDefinitions().bind
      }

    }
@Atry : This is the kind of code you end up in a real world scenario. It is hard to read and friendly.
there is way to improve it always but in a fast rapid development environment, you need to do it right immediately.
杨博 (Yang Bo)
@Atry
Do you think <AllUsersComponents> is better than AllUsersComponents()?
jfilali
@jfilali
```
<AllUsersComponents>
    <GraphQL
        request = {QueryBinding(AllUsersInATable.formGroupDefinitionsFrag, AllUserInATable.usersFrag)}
    >
        <Success>
        {
            (result) => <AllUsersInATable
                definitions = result.obj("data").obj("formGroupDefinitions").list(),
                users = result.obj("data").obj("users").list()
                >
                {
                    (result) => <SomeNestingComponent title ="title", value2 = "value2">


                }
                </AllUsersInATable>
        }
        </Success>

    </GraphQL>
</AllUsesComponents>
```
This is easier to work with, you just copy paste some xml there and there and you extend you application with your own template/components
It look the same but in reality it make a lot of difference.
杨博 (Yang Bo)
@Atry
        AllUsersComponents(
          Graphql.DoAjaxAndReturnDom(
            request = QueryBinding(AllUsersInATable.formGroupDefinitionsFrag, AllUserInATable.usersFrag),

            displayOnSuccess = (result:ValueResult) => AllUsersInATable(
              result.obj("data").obj("formGroupDefinitions").list(),

              result.obj("data").obj("users").list(),

              (result:ValueResult) => SomeNestingComponent(
                  "title",
                  value2,

              )

              onClickUserId = (userId:String) => (e:Event)=> {
                usersPage := SingleUserPage(Var(userId))
              }
            )
          )
        )
It does not convince me.
I don't know if you have any experience in PHP or Play/Twirl templates.
You may find Binding.scala is very similar with PHP.
jfilali
@jfilali
No I haven't use PHP or Play/Twirl. I used React in the past. Some people like this notation.
杨博 (Yang Bo)
@Atry
Do you like colon-equals for assignment or a single equal symbol?
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.