Author Archive

Dojo at ZendCon

Friday, September 19th, 2008

I gave a talk on Dojo Wednesday at ZendCon, and when I walked into the room for the talk, there was some disorder as the conference center staff were taking out the tables to fit more chairs in. Even with the extra space, the room was totally packed, thanks in large part to the amazing Dojo integration work that the Zend team has done.

(more…)

Dojo In 6K

Tuesday, July 1st, 2008

Some sites can defer most, if not all, of their JavaScript-driven progressive enhancements until well after the page has loaded. Even so-called “lightweight” libraries like JQuery are far too heavy for some environments…not because they (like Dojo) pull in all the code needed to use them, but because they do it all up-front. Often the best time to pay the expense of loading, parsing, and executing JavaScript code is when the user takes an action that needs the enhancement to run. Dojo already gives you the best tools available anywhere to defer loading modules until you actually use them; other than those provided by dojo.js itself…but what about dojo.js? What if even the small size of Dojo is too big for your page? This need to load as fast as possible and defer work is never greater than in mobile applications. The best-performing thing to do is always to hand-write all the code you’ll need and never use more script than that…but there are complications. Not being able to share your code between developers (let alone between pages) can be a huge disadvantage. The code is also likely to be slow, buggy, and unmaintainable. There’s a real reason why toolkits like Dojo are so incredibly popular: they make much of this pain go away at the cost of initial download size. Why would anyone want to invite the pain back?

So we need some middle ground: a common, expected API surface area combined with a trivial initial footprint to ensure that pages load as fast as possible. How small could we make such a thing? Turns out, 6K.

(more…)

TAE Talk On Dojo 1.0

Friday, October 26th, 2007

In addition to the panel discussion and keynote which the Ajaxians were gracious enough to let me participate in. I also gave a “regularly scheduled” talk on Dojo 1.0, many of the lessons we’ve learned leading up to it, and the philosophy of construction (and why it benefits you and your users).

openweb-001.png

The talk was packed, with folks actually standing at the back of the room. Thanks to everyone who turned up and especially to everyone who asked questions. Getting the kinds of focused, thoughtful questions that were asked always makes talks like these better for everyone.

Update: after my talk Andreas of the excellent qooxdoo framework made the point that my examples of how to use Dojo 0.9/1.0 widgets didn’t clearly enunciate how fully we support programmatic creation of all Dojo widgets. While beginning Dojo users may see markup-driven examples like:

<span dojoType="dijit.ProgressBar"
   progress="20%"
   …>

 

Dojo 1.0’s method of building widgets programmatically is hugely simplified from the 0.4.x days:

var pb = new dijit.ProgressBar({ progress: "20%" });
dojo.body().appendChild(pb.domNode);

 

Both examples create an equivalent widget, and every property that can be set via markup is also available to be passed via the configuration property bag that every widget expects when calling its constructor function via the “new” keyword. This lightweight convention, in conjunction with the alternate script types, allows for full feature parity between markup and programmatic construction of widgets. Both are first-class citizens in Dojo 0.9/1.0 and you can build your entire app with programmatic construction if you so choose.

Clue++: The IE Team Stops Treating Their Customers Like Criminals

Friday, October 5th, 2007

I can only imagine what kind of a political nightmare it must have been for the IE team to pull this off, but they deserve praise for finally liberating their browser from the clutches WGA (whose “advantage” has always been unclear).

When it became clear that IE 7 was going to be tied to WGA in an early beta, it left a lot of angry developers scratching their heads. Perhaps smart moves like this are enough to counter the lack of public communication about the future of IE and the stunning paucity of debugging tools for Redmond’s browser (among other things), but anything that cycles IE 6 out of circulation faster is good for the web. Kudos to the IE team for doing the right thing by their users.

Dojo 0.9 Power Tools: <script type=”dojo/method”>

Friday, September 21st, 2007

Dojo 0.9 is a different beast than any Dojo before it. It’s smaller, it’s (much) faster, and it “feels” different in many ways. As Jon Sykes noted, “everything is familiar yet strangely different”. I could go on for hours about why dojo.query() is completely indispensable or how having dojo.behavior as a part of Core changes everything, but there’s some fun stuff up the stack too. In particular, new parser bears mention, and a bit of explanation. In addition to now letting you build instances of any class (not just widgets), it also lets you configure their behavior as well as their properties.

For a long time systems like Flex and Laszlo have had a corner on naturally mixing behavior with markup. HTML’s native <script> tag doesn’t provide any context, and worse, can’t provide a way to be triggered by a particular event or action (outside of proprietary extensions). Several use-cases are important:

  • Scoped execution
  • Event-driven execution
  • Attachment vs. replacement

In Dojo 0.9 we took a hard look at them and devised <script type="dojo/method"> and <script type="dojo/connect">. Lets take a quick tour and show how it makes writing event handlers natural, building new widgets a snap, and over-riding built-in behavior trivial.

(more…)

Improve the Open Web. Live Anywhere you want. Get paid. Interested?

Tuesday, August 7th, 2007

I’m excited to announce that SitePen is hiring in our R&D department, which roughly translates into “do research on how to improve the Open Web, make it a reality through Open Source software, and get paid to do it”. If that sounds like your dream job, we want to talk to you.

Et Tu, Cupertino?

Saturday, June 30th, 2007

Here at SitePen, we’ve got some pretty deep experience with building apps for mobile devices and having seen the issues first-hand, I firmly believe that Apple is doing a great thing (in the medium term) for the world by making the Open Web the way to deliver apps to their phone. In the short term, they’ll be doing millions of people a huge favor by letting them replace their Treos with a device that doesn’t reboot when exposed to air, sunlight, or text messages.

There are interaction problems yet to be solved (how do you “thingify” a web app for the iPhone? offline? etc.), but fundamentally the iPhone puts the onus on the browser to mediate hardware access better. This is the right race to be running since it forces every one else to one-up Apple on openness and immediately cuts out the idiotic middle man situations that Brew and even J2ME create through oligopoly and ineptitude, respectively.

(more…)

Dojo 0.9 Update: M2

Sunday, May 13th, 2007

This past Friday, we pushed Dojo 0.9 Milestone Release 2 out of the nest. This is the last milestone before Beta and the system is starting to take a recognizable shape. Only thinner.

Here’s what’s new and awesome in M2:

  • Dijit has landed! Holy cow is it fast. Stay tuned for themes and more widgets.
  • Layered builds. Slice and dice your builds any way you like to achieve maximum performance
  • Style code is now even faster
  • Lots of new modules, bug fixes, and quality APIs

(more…)

Dojo 0.9 Update

Saturday, April 28th, 2007

As Chief R&D Monkey here at SitePen, my work primarily revolves around ensuring that Dojo rocks for our customers and that we take what we learn from building apps and ensure that the toolkit evolves to encompass those lessons. Early this year it became clear that for folks building Dojo apps, the question of “what is Dojo?” was becoming increasingly hard to answer. Each individual user might be working with a different subset and therefore they don’t share a common definition, which makes sharing what you know about the system harder than it needs to be.

In response, we’re in the middle of a huge undertaking: rethink the entire API surface area of Dojo from the ground up and split it up into 3 different top-level projects. With R&D dollars and time coming from all corners of the Dojo universe, 0.9 is shaping up to be smaller, faster, more coherent, and easier to understand. I’ll be doing a regular “where are we now?” set of posts here on the SitePen blog for folks who don’t have time to follow all our mailing lists and forums or watch the commit flow.

So, where are we now?

(more…)

Mobile Movement

Thursday, April 26th, 2007

At last month’s Open Ajax Alliance meeting in New York, a good chunk of time was dedicated to revisiting what, if anything, OAA should do about “Mobile Ajax”.

I’m something of a pessimist about what most people mean when they say “Mobile Ajax”, but the OAA meeting included several bits and pieces that gave me a lot of reasons to be less grumpy. Firstly, the device manufacturers are starting to get it. One of the attendees made the prescient point that the content devs, the phone vendors, and users alike are all trying to route around the OpCo’s. This suddenly put a lot of things in perspective for me: is wifi a stupid thing to put in a phone? You bet. But it beats the OpCo network. The list of cat-and-mouse features like this goes on and on. At some point something’s gotta give.

At the meeting someone was passing around a very slick Nokia device that has done more to convince me that that the web on phones isn’t dumb than anything else I’ve seen in the last year. Clearly, the UI issues are horrendous, but good screen + beefy CPU + wifi + thumboard makes a lot things bearable. Better yet, there was word that many of the issues I’ve raised about what’s useful input and output in a mobile web context (hint: text is no longer king) is starting to be addressed by the phone vendors. Better yet, there’s rewnewed work at the W3C to address some of the most pressing issues. In fact, it seems that the mobile browser vendors might be attacking the problem of rich content types better/faster than their desktop counterparts. An 18-24 month handset turnover rate will help make up for a lot of lost time.

But I mentioned Ajax and not just the web.

Ajax/DHTML lives in the nexus between a lot of the various web standards which means that it’s subject to the vagaries of all of them. No matter what the specs say, the lowest common denominator of what the clients ship is what the “standard” really is. The mobile browser market has been hugely fragmented for a very long time, but that looks to be changing. I think it’s pretty safe to say that in the next 3 years we’ll be down to three major rendering engine “flavors” in smartphones and that KHTML/Webkit derived browsers will probably carry the day for folks not on MS or Blackberry devices. Frankly, I didn’t expect it to happen this quickly, but I’m gald of it. Clearly, there are major issues still to overcome, but relative standardization on browsers brings the mobile web into alignment with a world that desktop web devs can approach. The sooner good browsers trickle down, the sooner we can start the painful process of forgetting what we think we know about doing webapps and building better idioms for mobile apps.