Note: If you’re looking for information on Houdini or Toggle, you’re in the right spot. After changing the project name from Toggle to Houdini (for SEO reasons), we’ve switched again (there was another Houdini already). If you know of another language called “Presto” please let us know, we’ve got more names.
Over the years we’ve noticed that it seems like every day, all day, all our fancy code boils down one basic thing: showing and hiding DIVs. That’s it. Send a bunch of DOM to the browser, then toggle those DIVs on and off. Logged in? Show a DIV. Logged out? Hide a DIV. Click a tab? Yup, another DIV.
So, we’ve gone and done it. We wrote our own language, Presto. And Presto is all about showing and hiding DIVs. Fast. How? Read on. It’s like magic.
The Presto Manifesto
It’s super fast at showing and hiding DIVs. See the benchmarks below.
It’s both a language and a framework. They’re often confused for one another anyways, so we made it simple.
Based on the number one web pattern of all time! MVC.
Your Model is the DOM. Use XML, HTML, Web Components or whatever as long as it has lots of < /> (Man, that’s hard to type on an iPhone. Go ahead, try it.)
Controller methods must return (and can only return) the special Presto Boolean: show or hide
The View is the same as the Model. Think about it. Yes, it’s that simple.
Stuff We’re Still Working On
Routing: Should be pretty straightforward
Performance: Only affects large datasets. We have some good ideas.
Native Browser Support: like we said – coming soon.
Documentation: You nagging us is not going to make it go any faster. How about doing something constructive like submitting a pull request?
Stuff Under Consideration
Lambdas: I don’t totally understand what these are, but I think we’ll want them. -David
Easier selectors: Some of you are complaining about having to use XQuery to select DOM elements to show or hide. We’re considering adding support for Regex.
//div[id=’foo’]/div[class=’login’] => presto()
Clarity, Simplicity, Deceit.
That’s right, O’Reilly. We’re ready.
Time to show & hide 1,000 DIVs
Opening & closing my eyes really fast
* I had trouble measuring this because in the middle I passed out. If you count that time, then probably about 6 or 7 hours.