Friday, December 1st, 2006

Miro: light-weight JavaScript rendering engine

Category: JavaScript, Library

Edwin Khodabakchian and Olivier Devaux started off integrating Google Custom Search capabilities into Vulnpedia.com, using the Google JavaScript tools.

They wanted to go beyond this, and tell their story in Experience #1: Miro, Ajaxlets and the Google Custom Search API which goes through various iterations of the project.

It includes a tutorial on Miro, A Light-weight Javascript Template Engine:

Miro is a light-weight template engine for applications which take advantage of Ajax. It focused only on one task: how to make it easy for developers to convert in the browser, a Javascript object or an XML DOM object into a fragment of HTML code that can later be assigned to a div using div.innerHTML. As an Ajax developer, you are forced to make these types of conversion 1) each time you want to dynamically change in the client a part of your document (example: sort a list of rows) or 2) each time you have made an async call to the server using HTTPRequest or <script…> and want to present and display the result to the user. The goal is to get rid of htmlFragment += “some <a href=\”” + var1 +”\”> which is very painful to generate and even more painful to maintain.

Miro looks similar to Apache Velocity, and comes with an ant task that will generate a JavaScript function for each template.

Vulnpedia

Posted by Dion Almaer at 8:00 am
3 Comments

++++-
4 rating from 25 votes

3 Comments »

Comments feed TrackBack URI

Interesting approach… I would certainly like to give it a try, but I get a 404 when I try to download ant-miro.jar from the given link in the article. Thanks.

Comment by Raj — December 1, 2006

Raj,
Thank you for the heads up. We fixed the broken link. You can download the ant file from:
http://www.devhd.com/dist/ant-miro.jar
Best,
Edwin

Comment by Edwin Khodabakchian — December 2, 2006

Thanks Edwin, you must have moved onto bigger and better things after Collaxa. Good luck with devHD…

Comment by Raj — December 2, 2006

Leave a comment

You must be logged in to post a comment.