With the closer integration of mojito and YUI, as well as the advent of Yahoo-Arrow, mojito needs new examples on how to write code once for client and server so that it can live up to its promises.
Why?
At the moment, all our client-side code is dumped in the binders and we hand off any complex stuff to the server which we access via a RESTified data interface. We are however now at the point that we need a more advanced MVC architcture in the client, over and above what the mojitproxy seems to offer according to the mojito Demos. The MojitProxy comes across as a messaging system between mojits, so that they can message each other, rather than making direct object calls on each other and each other's HTML nodes. I see that the ActionContext is now almost completely "common" in affinity.
So is there a demo of how the ac can be used for client side MVC action handling?
The LazyLoader Mojit is almost such an example: it gives us the following in the binder -- i.e. the binder triggers a call to the controller of it's own mojit. This could also be done via MojitProxy events in response to actions on other mojits, right?
this.mp.invoke('load', {
params: {
body: {
mojit: this.mp.config.proxied
}
}
}, callback);
One more thing:
I have reimplemented the "render" function of the MojitProxy for our system, which is based on Jade and precompiled Jade-JS on the client (which results in extremely flexible light-weight client code). I presume that client-side view rendering in Mojito works only with Handlebars, right?
Well, this important functionality should definitely be mentioned in two places in the doc:
http://developer.yahoo.com/cocktails/mojito/docs/topics/mojito_extensions.html#view-engines
and
http://developer.yahoo.com/cocktails/mojito/docs/code_exs/views.html
This is a key feature for single page apps and an aspect that could seriously speed mojito adoption.
Please let me know and I will put in a PR on doc.