With tremendous gratitude to G-d, Who created the universe and oversees its tiniest detail, I would like to announce some important new reactive-web features!
Since these features may break some code (not much though), version 0.1 has been released (it's available from maven central) and master has moved to 2.0-SNAPSHOT (published to Sonatype OSS snapshots, as usual). (The features were developed in wip_jseventstream and are now in master.) The following are the most important new features:
Now you can write scala code to handle events, without requiring them to make an ajax call to the server. Instead, you can set up relationships with between components that are carried out purely within the browser. This is partially enabled by...
- Type-safe javascript expressions
You can write type-safe javascript expressions directly in scala code, concisely. Currently only a limited number of operators etc. are implemented. The idea is to be a full DSL including all javascript statements.
- Javascript API stub interfaces
The javascript support allows you to define a stub trait in scala that represents a javascript API. Calls to its methods are translated into javascript expressions which can be executed in the browser. This makes it simple to access not just built in APIs like the window object, but also any third-party library like ExtJs or Google Maps.
Dom mutations now have a semantic representation, which paves the way for the features such as:
- Pluggable implementations, such as jQuery with effects
- Powerful testing support: DomMutations know how to apply themselves to a NodeSeq, so your tests can simulate the effect your logic has on the DOM, without actually running jetty/selenium etc.