Friday, September 28th, 2007

Apple Store hits the Dojo

Category: Dojo, Showcase

We got quite a few emails to letting us know that Apple is now using the Dojo Toolkit for their store after a quick refresh, which people seem to find interesting as it seems to be a bit of a switch from Prototype (although there is some Prototype code copied over too).

It is also interesting that they are using 0.4.0. Not 0.4.3, let alone 0.9. It takes time to get applications from concept to production though, so this shouldn’t be so surprising to people.

The look is very clean and decidedly un-flashy. They did encapsulate some reuseable widgets.

This is what the Apple Blog had to say about it:

Apple launched a revamped online store on Wednesday, giving it a refreshed look and just the polish it deserves. Product categorization is greatly improved, making it much easier to visually make connections between products and accessories. More emphasis is being put on new and top selling products (taking a cue from Amazon perhaps?), and alot of the tabs and buttons got really big. Navigation has also greatly improved, with an obvious breadcrumb trail at the top of each page.

But overall the store just looks and feels rock solid. It’s big, beautiful and welcoming. I’ve always had issues with the organization (or seemingly lack thereof) and aesthetic of the online store in the past, and have cited it as the weakest part of the Apple online experience. It’s nice to finally see Apple rectify that and make a place where I want to shop even more.

Dojo Apple Store

Posted by Dion Almaer at 5:18 am

3.5 rating from 28 votes


Comments feed TrackBack URI

I think they used it to do the best and no doubt they did the best in the store. Great work.

Comment by DESIGNEXPANSE.COM — September 28, 2007

i don’t know, but to be honest they could as well not used any framework at all.

the only ajax based control i found was basically the “was this comment usefull for you” feature on products comments.

Comment by mhr — September 28, 2007

Maybe I’m mistakening, but I thought Apple had been using Dojo in the Apple store for quite a while.

Comment by Tobie Langel — September 28, 2007

Is there a reason why the Dojo widget toolkit (Dijit) must rely on Dojo core?

I see that there a large overlap in functionality between Dojo Core and e.g. Prototype. Why not to port Dijit to Prototype? I think that would benefit both frameworks.

Comment by Les — September 28, 2007

Just to confirm my initial thoughts – Apple Store has been using Dojo for quite a while now, hence the fact that they’re using 0.4.

Comment by Tobie Langel — September 28, 2007

Could this be why they are ditching prototype?

Comment by Steve Brewer — September 28, 2007

Thar article is written by a moron, using a half baked tool that throws tons of false positives on perfectly valid code is a waste of time. His stance that you should use Lint reguardless is ridiculous. I am sick of clueless devs. >:(

Comment by J — September 28, 2007

@Steve: Prototype 1.6 generated just 8 warnings in JSLint.
This is a very good and scalable framework, certainly on a par with Dojo core. Dojo core has some nice module loading functionality, which is not available in Prototype, but Prototype is easier to use IMO.

Comment by Les — September 28, 2007

@Steve, Les: check out Dean Edward’s comment JSLint Considered Harmful.

Comment by Tobie Langel — September 28, 2007

@J: not having completely woken up yet and reading this post, I was inclined to agree with you. But then I dug a little deeper and it seems to me that Mr. Watkins *does* know what he’s doing, and he’s been doing it longer than most of us–so I’m more inclined to respect his opinion of yours (since yours is anonymous and therefore I have no idea what your background is, and therefore what your basis of judgement is). Though I do agree wholeheartedly with Dean Edwards on this one.
@all: my understanding is that Apple uses both Dojo and Prototype (certainly the main website uses heavy Prototype), and that’s good–because it’s a high-profile example of what everyone should be doing, which is choosing the right tools for the job at hand, regardless of what your feeling is about other toolkits. That’s the beauty of what we do: we give everyone a *choice*. Though I don’t have an ear to the grapevine, as it were, nonetheless I have not heard *anything* about Apple ditching Prototype; one dev’s opinion on the matter does not change months of work overnight.
Once again I think Apple serves as a good example to all: use what works best for the need, regardless of what any fanboys might clamor about.
@Les: two words: “loading system” (among quite a few others). But if you’re inclined, feel free to start a project that allows someone to use Dijit on top of Prototype (or anything else for that matter); we’d be interested to see what would happen. One thing though–I’d wait until the 1.0 release, we’re still stabilizing a number of things and to try to do a port without the Grid in place would probably be spinning wheels a bit.

Comment by Tom Trenka — September 28, 2007

I just tried using JavaScript Lint against Prototype and jQuery. This tool is not useful at all. I pasted below below a jQuery fragment with corresponding warnings. You will find similar warnings when you try JavaScript Lint against Prototype. You can redeclare variables in JavaScript and you don’t have to use curly braces for one-liners.

629 swap: function(e,o,f) {
630 for ( var i in o ) {
631[“old”+i] =[i];
632[i] = o[i];
633 }
634 f.apply( e, [] );
635 for ( var i in o )
warning: redeclaration of var i
636[i] =[“old”+i];
lint warning: block statement without curly braces

Comment by Les — September 28, 2007

6 xmlhttprequests upon loading the store. I’m sorry, I just don’t like dojo at all, let alone 0.4. I understand it’s probably been in development for a long time, which is why they’re on an older version.

To Tom Trenka’s point about how Apple isn’t even using Dojo for it’s widgets is a completely valid argument to NOT use dojo.

Comment by Wayne Pan — September 28, 2007

While it can be configured to warn about pedantic things, it also has a very real capacity for finding bugs.

And reasonable people can disagree on which warnings are pedantic and which might reasonably prevent bugs.

Jeff, I invite you to go through the long list of warnings and categorize them. The vast majority, I’ll wager, are warnings about omitted braces (in places where braces are optional) and omitted semicolons (in places where semicolons are optional — although we do fix these as we come across them in the code).

I don’t check in any files that aren’t 100% free of warnings.

But here you’re conflating linter warnings with compiler warnings. A linter is, by its nature, nitpicky. Even the warnings generated by the Firefox console are more noise than signal.

I understand the importance of getting out from under a huge stack of annoying messages, but above all else I try to write code that can be easily parsed by interpreters and humans alike. And I think it’s unfair to suggest that we’re not acting professionally simply because we have different code conventions than one particular code linter.

Comment by Andrew Dupont — September 28, 2007

@Mike: So adding features should be front-seat, whereas code quality should be secondary? Hmm. Personally, I don’t know Jeff, but I appreciate Jeff’s serious efforts to use the best tools at his disposal. Too many developers cut corners.

Comment by alphadog — September 28, 2007

@alphadog – thats just it, he isnt using the best tools (and or) he is using them incorrectly.

Comment by headalphadog — September 28, 2007

@Jeff: No worries, I’m just glad to hear that you’re considering it at all–and I’m entirely with you on the bandwidth problems! If it helps, 0.9 is a bit less namespace-depthy than 0.4 was, but we do still try to be very considerate of the host object (most of the reason why we did that in the first place). And I’d just like to clarify that I was taking your statements over J’s (I typoed in my first post, “of” should have said “over”: “so I’m more inclined to respect his opinion *over* yours”). Any way we can be of assistance, just ask :)
@Wayne: I didn’t say that. Re-read my post, please :) Think Jeff said that, actually.
@All others slamming Jeff over Lint: everyone has thier own standards, and Jeff’s are a bit higher than others in some respects. If he chooses to use JavaScript Lint over other tools and take the results seriously, that’s his choice–after all, he’s working on a very high profile site. Jeff’s point about the lack of response from the Prototype team was the main point of what he is getting at, IMHO.

Comment by Tom Trenka — September 28, 2007

BTW, let me clarify that that last comment is not a snipe at Prototype; we’re all super busy and can’t always respond to everyone all the time, particularly when most of us do this part-time and spend a lot of time buried in other things.

Comment by Tom Trenka — September 28, 2007

The online version of JavaScript Lint will not accept scripts larger than 128 KB – this limit is too small.

Comment by Les — September 28, 2007

I just revisited the thread in question on the prototype-core list. As he states, Jeff got a response the next day from fellow core member Tobie Langel. It wasn’t the response that he was looking for, but it was a prompt response regardless.

I would’ve replied much the same way, but also might’ve suggested that Jeff at least file a bug if he was unwilling to write a patch. The mailing list, though appropriate for the question he was asking, is much less useful for bug-tracking. Adding a Trac ticket allows us to verify the bug, categorize it, and write the patch ourselves.

Also, as far as I can tell, the issue he was asking about has been fixed in the 1.6 release candidate. My copy of JavaScript lint reports 45 warnings on Prototype 1.6 — all of which complain about the aesthetics of uncommon, yet valid, code constructs. There are no “undeclared identifier” warnings.

Comment by Andrew Dupont — September 28, 2007

So now Apple completely seizes up Firefox for seconds at a time on load like other sites using Dojo.

When in god’s name are they going to fix that and why did they ever think that was a good way to load js?

Comment by ziggy — September 28, 2007

yep, dynamic script loading is a problem while switching tabs (which I do often). I tested it on IE7, Safari 3 (Windows) and FF 2.0. Interestingly, it works fine on FF 3.

Comment by Les — September 29, 2007

If you mean my comment, it has nothing to do with switching tabs, it is the type of loading used. Load a dojo page in FF and it seizes up the entire browser for seconds.

Comment by ziggy — September 30, 2007

@ziggy: don’t you think this is also a browser issue? The browser should not allow itself to be locked up, and in fact it will not lock up in newer browsers, e.g. FF 3 and Opera 9.5. But, I agree with you this should be addressed for older browsers such as IE7 or FF 2. The browser should not lock up while modules are loaded. You can’t switch tabs b/c it locks up or you get an error (on IE7).

Comment by Les — September 30, 2007

@ziggy: Open up the Apple store with FF using Firebug and take a look in the Net tab. Dojo is not freezing that site at all; most of the time spent is loading images from different domains. I think you’re referring to Dojo 0.4, particularly on pages with lots of widgets defined via markup. If you try any of the Dijit test pages (0.9+), you’ll find that that freeze has been eliminated for the most part.

Comment by Tom Trenka — September 30, 2007

Steps to recreate the problem:
1.) Open and in two tabs.
2.) Reload both tabs.
3.) Try switching btwn tabs while the Dojo demo is loading.

On FF 2, you won’t be able to switch tabs until Dojo is done loading modules presumably b/c the browser in locked. In IE7, you will get an unspecified error on Line 20 when you try to switch tabs.

Again this works smoothly in FF 3 and Opera 9.5

Comment by Les — October 1, 2007

now i truly believe that dojo is sucks, especially 0.9 (i come to this while we were converting site from 0.4.3 to 0.9, it’s a pain in the ass). I think from now on we’ll switch to extjs or something

Comment by anonymous — October 1, 2007

Mind filing a bug on the Dojo Trac for that? Steps to recreate are invaluable, and this sounds like it’s pretty straightforward to reproduce., guest/guest.

Comment by Tom Trenka — October 1, 2007

Dohjo sucks crashes the browser so often and its SLOW SLOW SLOW!

Does the AppleStore works like this now? Yes? Then GOTO HELL!

Comment by JohnDoe — October 2, 2007

Sure, I created Ticket #4615: Module loading locks up browser

Comment by Les — October 2, 2007

@Les: thank you, got it.

@JohnDoe: troll.

Comment by Tom Trenka — October 2, 2007

Tom, it completely froze my FF up, and loading images never freezes the browser.

I just tried the dojo email example using 0.9 and it completely seized ff2 for about 10 seconds. ( )

>>@ziggy: don’t you think this is also a browser issue? The browser should not allow itself to be locked up, and in fact it will not lock up in newer browsers, e.g. FF 3 and Opera 9.5.

I always thought it was to do with dojo’s synchronous loading or some such thing. In any case, I’ve never experienced it with other libraries so, while it would be better if the browsers didn’t lock up, it’s something dojo causes because of the way it loads modules. When I posted the same thing here last year, Alex didn’t even seem to know about it from his reply, which is weird:

I find dojo freezes firefox completely for a few seconds onload. At least the dojo example pages do. Very annoying.
Comment by ziggy — August 16, 2006

Ziggy: which example pages? are they using a build or are they from source? Builds should be pretty snappy. See the test pages at:
Comment by Alex Russell — August 16, 2006

>>Ziggy: which example pages? are they using a build or are they from source? Builds should be pretty snappy.

Sorry, for the delay, Alex.

Just tried again. Go to your homepage, freezes the entire browser for a couple seconds. Stutters for a moment, then freezes again, then the page is loaded finally. Doesn’t matter if I’m on that tab or not. FF1.506, XP. Does it every time unless I just loaded it. Does it again briefly when clicking to view a first demo.

Sorry, only website I experience it on anywhere, and been the same since I first visited ages ago.
Comment by ziggy — August 24, 2006

Alex, I just tried the new filter/sort table example and it SERIOUSLY locked up the browser to the point where it even disappeared from my task bar and went all white and only came back after 5-10 seconds.

Hope it helps.
Comment by ziggy — August 24, 2006

Comment by ziggy — October 3, 2007

Leave a comment

You must be logged in to post a comment.