Small Scriptaculous API Change for Seaside 2.8

Yesterday I was upgrading one of my applications to the latest version of Scriptaculous and Seaside 2.8, at first everything seemed to go OK but shortly thereafter I noticed that some of the Ajax in the application had stopped working. After a bit of testing I traced the problem to multi element Ajax updates where I'm using the evaluator. Stuff like this occasionally happens so it was time for some investigation.

I cracked open an older image and checked the version I'd been using and started reading the commit comments for each version looking for clues. You can do this from SqueakSource but I usually just do it in Monticello directly. After a bit of digging I find in Scriptaculous-lr.232.mcz the information I'm looking for, namely...

NOTE: SUElement>>#render: does not call #update: anymore, directly use #update:, #replace:, #insert:, and #wrap: now. These methods finally accept any renderable object (string, block, ...) and also encode the contents correctly.

Seems Lukas changed the API to make things more intention revealing. A quick trip through the app looking for evaluators and changing #render: to #update: and everything started working again. Having made the necessary changes, and looking at the new code for a few minutes, I liked it and agree with API change.

What I want to point out is the importance of good commit comments (thanks Lukas) that allow those who use your frameworks to work out their problems. Commit comments are the best place to share your thoughts about why you changed something or decided to go in a particular direction because they are, or should be, the first thing a developer reads before loading a new version of that code.

I also what to point out the process itself. Being open source code, when things go wrong it's often up to you to solve your own problems. Had I not found what I needed in the comments, I'd have started Googling and searching the archives of the Seaside-Dev list to see if anyone else had run into this issue. If that fails, then I'd post to Seaside-Dev asking for help.

There's not a lot of documentation on Seaside and Scriptaculous in comparison to some other frameworks, but there's plenty of help to be found with just a little bit of effort on your part to do your homework and a great community ready and willing to help you out when you need it. But always do your homework first, in case your question has been answered many times over.

about me|good books|popular posts|atom|rss