© Shutterstock / By chombosan
Udash is a Scala framework that promises to make web developing as professional and safe as possible. Here, we have a look at some advantages and disadvantages of Udash.
“A framework for building beautiful and maintainable Web Applications”
According to the official website , Udash offers type-safe layer over HTML, CSS and JS with powerful data binding into DOM templates, thanks to the cooperation with Scalatags and ScalaCSS libraries. The list of advantages and useful features goes as follows:
- Reactive Data Bindings – Automatically synchronise user interface with your data model.
- Type-safe RPC & REST – A client↔server communication based on typed interfaces. Bidirectional RPC via WebSockets out of the box.
- User Interface Components – Twitter Bootstrap components enriched by Udash features.
- Generator – Generate a customized application, compile and try it out in 5 minutes.
- Open Source – The whole framework code is available on GitHub under Apache v2 license.
- Backend independent – Udash provides a complete support for your web application and the communication with the server but does not influence your backend implementation.
- IDE support – With any IDE supporting the Scala language. No extra plugin needed.
According to a Hacker News entry , Udash is the perfect choice for developing rich single page apps and big complex websites where you have to “share models and validations between front and back end”.
Let’s have a look at the classic Hello World example.
import io.udash._ import io.udash.css.CssView._ import io.udash.bootstrap._ import io.udash.bootstrap.alert._ import io.udash.bootstrap.button._ import io.udash.bootstrap.form._ import io.udash.bootstrap.modal._ import io.udash.bootstrap.utils._ import org.scalajs.dom val name = Property("Udash") UdashJumbotron( div(BootstrapStyles.container)( UdashBootstrap.loadBootstrapStyles(), h1("Welcome to Udash!"), UdashForm( UdashForm.textInput()("Type your name: ")(name), UdashAlert.success("Hello, ", b(bind(name)), "!").render ).render ) ).render
Verbose and inefficient?
Nonetheless, there are some drawbacks in using Udash for your project. To begin with, there has been much criticism that Scala is not an efficient language for web developing in the first place. However, it is not the scope of this article to criticize Scala.
SEE ALSO: How well do you know your Scala trivia?
Concerning Udash in particular, a lot of feedback was given under the same Hacker News entry . According to the comments, apparent flaws of Udash are the following:
- Runtime errors – it is difficult to avoid them, at least to the extent that Elm does (by design).
- Complexity – designers should be proficient in Scala at least to the extent that they can fix compile errors in the page code, otherwise, it would be simply impossible to share a template.
- Too much code? – some comments suggested that “It looks really verbose only to render simple html”.
Udash is still a new framework in the Scala ecosystem. There is still much room for review and improvement. The fact that it is an open source framework makes it a promising asset since users’ contributions and remarks can offer valuable insight for further and faster development and improvement.
Luca Mezzalira (DAZN)