Building Evented Single Page Applications
Today I did a presentation on what Steve and I have been working on behind closed doors for the past year (or more it seems). It is always fun to share the exciting things we have been up to and this was no different.
I promised those that were at the talk that I would post my slides, so here you go. I don’t know how helpful the slides are without my incredible, booming voice, but hopefully you find value in them.
Since people were curious, I have also pasted some of the code online. Right now it is quick, dirty and relies on an older nightly version of jQuery, but hopefully some will find it helpful. Once 1.3.3 is released, you will not need this nightly version to get stuff working. Also, your mileage will vary in IE as we haven’t really done any testing with it.
You can download the core layout javascript file from Harmony (gist) and from Peoplebase (gist). The two files are very similar, but have a few different features that haven’t been merged together. Feel free to play with it, but I in no way recommend using it in production right now. Just look at the code for ideas.
Once we get some time, we’ll extract the parts that we see valuable into a framework with tests that anyone can feel free to drop in to their project.
That’s definitively the way to go for evented websites ! Thanks for this nice article
Man i wish there was a video to go with them slides. I am doing alot of this stuff lately so i am very interested! :D crosses fingers for a recording of your next speech.
also … good job! can’t wait to see the apps live!
We are using the same approach. One thing to note is you also have global ajax events at your disposal as well. Not that you really need them, but if it makes you feel warm and fuzzy to use them, go for it.
I’m not sure if I’m typing rubish here but If there’s no browser history a user can’t really go back to the place he / she was before unless they click on a link that takes them to it but for that they must know clearly where they where and where it is.
They also would not be able to bookmark specific parts of the page, for example a specific form.
I’de love to listen to the presentation instead of just reading it.
@Mario: Yep, you are typing rubish. ;) What I’m saying in the presentation is that doing the things I show will fix back/forward, bookmarking and browser refreshes. The greyed out text with a strikethrough means problem solved.
Nice slides. Wish there was audio to go along with it :)
Your approach is very similar to GWT best practices and methodogies. I think event driven front ends are going to becoming more and more popular as the line between desktop apps and web apps is blurred.
Nice article. A give a thanks