Binding.scala

Reactive data-binding for Scala

MIT License

Stars
1.6K
Committers
28

Bot releases are hidden (Show)

Binding.scala -

Published by Atry almost 8 years ago

  • Support @fxml
  • Optimize performance on Scala.js
Binding.scala -

Published by Atry almost 8 years ago

Support empty attributes in XHTML literal.

Binding.scala -

Published by Atry almost 8 years ago

Improve the performance when initialize a big Vars

Binding.scala -

Published by Atry almost 8 years ago

Changes from Binding.scala 8.0.x/9.0.x:

New Features

  • Added route library.
    See this example for its usage.

  • Supported referencing HTML DOM elements by id attributes.

    @dom showInput(v: Vars[String]) = <div>
      <!-- any Scala code inside the div element is able to access `myInput` -->
      <input id="myInput" onclick={_: Event => v := myInput.value />
    </div>
    

Performance improvements

  • Avoided re-rendering in some complicated cases.
  • Reduced about 30% generated JavaScript code size for @dom methods.
  • Resolved some other minor performance issues.

Backward incompatible changes and deprecated functions

  • oldSeq/oldValue in MultiMountPoint/SingleMountPoint has been removed.
  • SingleMountPoint is deprecated, in favor of simply Binding[Unit] block. See this example for usage.
  • dom.currentTarget is deprecated, in favor of id attribute.

Requirements

  • Scala versions:
    • 2.10.x
    • 2.11.x
    • 2.12.x
  • Scala.js version
    • 0.6.13

Future plan

In the next major version (Binding 11.0), we will support JavaFX and FXML. Afterwards, we will also launch the development of Android support. Binding.scala will become an universal solution for GUI on all platforms in 2017.

Contributors

Thanks to all the contributors who create Pull Requests, report bugs and discuss the design for Binding.scala on Gitter and other forums.

Special thanks to @Psycho7, who created an amazing Chinese translation of README,
and @Algomancer, who created a full stack Scala example application showing how to integrate Binding.scala into a Play project with a Scala.js,
and @williamho, who fixed a critical bug,
and @MarisaKirisame, @OlivierBlanvillain, @maowug, @kitsudog, @bbarker, and all of you.

Binding.scala -

Published by Atry almost 8 years ago

Don't generate data-binding code for constant XHTML attributes

Binding.scala -

Published by Atry almost 8 years ago

  • Reset state on Route.watchHash
Binding.scala -

Published by Atry almost 8 years ago

Binding.scala -

Published by Atry almost 8 years ago

Build with Scala 2.12.0

Binding.scala -

Published by Atry about 8 years ago

Allow changing state managed by Route.hash

Binding.scala -

Published by Atry about 8 years ago

Suppress warnings like org.scalajs.dom.raw.CSSStyleDeclaration and String are unrelated: they will most likely always compare unequal

Binding.scala -

Published by Atry about 8 years ago

  • Use Queue as internal data-structure in macros
  • Add scala-xml as a dependency of dom library. Users of dom library will not need to add the dependency manually any more.
  • Reduce the usage of view
Binding.scala -

Published by Atry about 8 years ago

Add a route library for Scala.js

Binding.scala -

Published by Atry about 8 years ago

  • Add a separate internal library XmlExtractor
  • Optimize monadic map method
  • Optimize XHTML literals that have exactly one child

Unlike older versions, Binding.scala 10.0.0-M2 does not include scala.xml package.
If you use Binding.scala dom library, make sure scala-xml is in your classpath:

// Add the following settings in your Scala.js projects's build.sbt
libraryDependencies ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, scalaMajor)) if scalaMajor >= 11 =>
      Seq("org.scala-lang.modules" %% "scala-xml" % "1.0.6" % Provided)
    case _ =>
      Nil
  }
}
Binding.scala -

Published by Atry about 8 years ago

Automatically define vals for elements with an explicit id attribute

Binding.scala -

Published by Atry about 8 years ago

  • Remove oldSeq parameter in MultiMountPoint.splice method.
  • Minimize triggered events when a Var changed.
Binding.scala -

Published by Atry about 8 years ago

Fix a bug in Vars.++=

Binding.scala -

Published by Atry about 8 years ago

Fix a bug in Vars.++=

Binding.scala -

Published by Atry about 8 years ago

Fix inconsistent state when calling Vars.get.

Thank you! @williamho

Binding.scala -

Published by Atry about 8 years ago

Fix inconsistent state when calling Vars.get.insertAll.

Thank you! @williamho

Binding.scala -

Published by Atry about 8 years ago

Support Scala 2.12.0-RC1