Can scalatags be used together with binding.scala?

503 Views Asked by At

Binding.scala's examples contain Scala XML tags as a language to code DOM fragments. Can scalatags be used instead?

1

There are 1 best solutions below

2
Yang Bo On BEST ANSWER

Binding.scala internally generates very sophisticated ScalaTags code. On the other hand, manually written naive ScalaTags code recreates entire DOM whenever the data changes.

Milad Khajavi created an example demonstrating the problem of the manually written ScalaTags code: https://gitter.im/ThoughtWorksInc/Binding.scala?at=581b6367eed0c3125f30d57b

ScalaTags is very convenient for simple application. However, since they are plain function calls that do not have any ability to partially update, ScalaTags is not a good choice for a complex interactive application if you need fine-grained update on DOM.