As I build more sites, two important patterns have come to light:
I implement model classes on both the front and back ends. This allows me to manipulate my models wherever it’s most appropriate; for cool AJAX features, this is usually on the front-end.
Much the same: sometimes I generate large blobs of HTML on the server side; sometimes I need to generate the same blobs of HTML dynamically on the client side.
I am aware of some template languages that approximate a solution to my second problem. Most recently, the json-template library made a bit of a splash. None of the libraries I’ve evaluated so far seem to capture the full problem.
And my first and frankly more pressing problem? I’ve seen no solutions whatsoever.