Activate your free membership today | Log-in

Tuesday, October 14th, 2008

Open Web Podcast - Episode 5: Ryan Stewart of Adobe

Category: Adobe, OpenWebPodcast

Ryan Stewart of Adobe joined us for episode 5 of the Open Web Podcast. We really want to be pragmatic Open Web citizens, so thought it would be good to hear from Ryan and get his point of view on what Adobe, and he, are thinking with respect to the Web as a-whole.

You can download the podcast directly (OGG format too), or subscribe to the series, including via iTunes).

We had a really fun chat, which had us discussing:

  • Adobe’s view of the Web
  • Silverlight, and Alex’s quote of the show: “Microsoft can’t write JavaScript.” Ah, come on, what about Scott Isaacs!
  • Ctrl/Cmd-R is the “Make All” of the Web, and Flex
  • ECMAScript, ActionScript, and the path forward
  • Video: A huge Flash advantage. Where does the video tag fit in? John pointed us to the experimental vorbis support via haXe
  • AIR: Ryan talked about how he sees AIR fitting into the landscape, and how he personally would love to see Geolocation APIs added
  • Open Source: Ryan shares his insight on the experience Adobe has gotten from their Open Source projects (Tamarin, Flex, …)

It was a real pleasure to have Ryan come into the lions den. He is very honest with what he does and doesn’t know from within, and doesn’t hold back on his own thoughts.

What would you like to ask Adobe?

Posted by Dion Almaer at 8:45 am
Comment here

++++-
4 rating from 2 votes

Runtime Page Optimizer: Fix performance on the fly

Category: Performance

Steve Souders posted on Runtime Page Optimizer a tool that you can think of as a performance proxy. It sits on the server side, and cleans up content before it is sent back to the browser.

What can it do? Steve let us know:

RPO automatically implements many of the best practices from my book and YSlow, so the guys from Aptimize contacted me and showed me an early version. Here are the performance improvements RPO delivers:

  • minifies, combines and compresses JavaScript files
  • minifies, combines and compresses stylesheets
  • combines images into CSS sprites
  • inlines images inside the stylesheet
  • turns on gzip compression
  • sets far future Expires headers
  • loads scripts asynchronously

RPO reduces the number of HTTP requests as well as reducing the amount of data that is transmitted, resulting in a page that loads faster. In doing this the big question is, how much overhead does this add at runtime? RPO caches the resources it generates (combined scripts, combined stylesheets, sprites). The primary realtime cost is changing the HTML markup. Static pages, after they are massaged, are also cached. Dynamic HTML can be optimized without a significant slowdown, much less than what’s gained by adding these performance benefits.

Steve had another couple of interesting posts recently:

  • Say no to IE6 discusses how we need to do something to help upgrade IE6 users (to IE7 is fine!)
  • Raising the bar talks about results from Steve’s UA Profiler tests and how new browsers are pushing forward

Posted by Dion Almaer at 8:11 am
Comment here

+++++
5 rating from 3 votes

Bacon - a sizzling new YUI utility

Beware of what you ask for. After Stephen Woods asked on Twitter why there are just no Bacon utilities in the browser Dav Glass of the YUI team went right to it and created YUI Bacon.

YUI bacon is now the only JS solution to fry any HTML element with a few lines of code:

JAVASCRIPT:
  1. var foo = new YAHOO.util.Bacon('demo');
  2. var bar = new YAHOO.util.Bacon('demo2');

As always with Dav, the utility comes with a full API and documentation, features useful methods like fryBacon() and stopFryBacon() and there are several clever custom events (baconReady, baconDone, baconStart) to subscribe to.

If you dive deeper into the workings of bacon you also find hidden messages of what the future might hold: void cook() An override method for extending this class to maybe fry eggs too.

I am now waiting for jQuery cocktail sausage and protoype T-Bone.

Posted by Chris Heilmann at 6:36 am
5 Comments

++---
2.3 rating from 13 votes

Dojo 1.2: Squeezing it into 5.5kb

Category: Dojo

James Burke gave a great presentation in Boston on the Dojo build system, and how he is able to get the core down to 5.5k.

With Dojo 1.2, the build system can generate a 5.5KB gzipped (13KB ungzipped) dojo.js file, via the customBase layer option. Useful for iPhone development if you want to get under the 25KB uncompressed size limits for the Mobile Safari cache. That small dojo.js is basically just the loader and some bootstrap functions, but it allows you then to tune your build layers to meet the 25KB and dynamically load what you need as you go.

Also, the djConfig options afterOnLoad/require/addOnLoad allows loading Dojo after the page is loaded. Great for making progressively enhanced pages render even faster.

Posted by Dion Almaer at 6:17 am
Comment here

++++-
4.5 rating from 11 votes

MozAfterPaint: Being able to get a callback event on repaint

Category: Firefox, Mozilla

John Resig put together a nice usage of MozAfterPaint, the new Firefox event that will call back letting you know when a repaint operation has happened:

The event object contains two properties: .clientRects and .boundingClientRect, both of which refer to the result of the associated DOM methods.

In a nutshell, boundingClientRect gives you a single rectangle encompassing the entire area in which a paint operation could've taken place whereas clientRects gives you a number of rectangles, each encompassing an individual area that was drawn.

To test this I created a quick demo using CNN.com (only works in the latest Firefox nightlies).

John creating a simple tracking script that uses the new event to show where you have been.

kourge reminded us of the related Flash event showRedrawRegions.

Robert O'Callahan mentioned a use for the event when he discussed SVG bling that made it into the first 3.1 beta.

David Hyatt put in a WebKit patch to add support for CSS transitions on some SVG properties.

Posted by Dion Almaer at 5:02 am
2 Comments

+++--
3.5 rating from 4 votes

Sensei: A beautiful Dojo application

Category: Dojo, Showcase

I have seen some of the great applications that SitePen produces, but unfortunately too many of them are for companies behind the firewalls.

It is great to see Sensei a really compelling Dojo application that SitePen wrote for their training class. This isn't one of those simple training examples that you normally get though. This says quality.

Revin Guillen explains:

When conducting Dojo training courses, we’ve found it to be very valuable to go beyond simple code snippets to demonstrate APIs, patterns, and other key concepts. Snippets and demos are useful, but they often lack a very important quality: context. Nothing beats having a full application in front of you—with code available to read and modify as you learn the ropes—so we built the Dojo Sensei Reader, a rich, powerful RSS reader realized as a single-page web application.

We designed Sensei specifically for training sessions. We wanted something that demonstrates the major areas of functionality Dojo offers, but as a single cohesive application rather than a collection of unrelated demos. We wanted something small enough that training groups could easily grasp the entire codebase, yet large enough to be worth using as a real-world application. We wanted something that shows the development process from start to finish, to demonstrate the level of polish you can achieve in a Dojo-based application. Beautiful as well as functional, it does all of this while providing a great, fast user experience.

One of the beautiful things about Sensei is that it proves that you don’t have to sacrifice maintainability to build a fast application. One key goal in our development process was to create an easy way for training groups to introspect the code, follow the app as it works, and even modify or augment its behavior at run-time by swapping code in and out. To deliver on this, we designed and integrated what we call Blox, a small JavaScript package with the power to make it all possible (it’s Sensei’s flux capacitor; we’ll cover it later). The result is a codebase that is very easy to work with but incurs negligible performance impact for its trouble.

Check out the screencast to see it in action

Posted by Dion Almaer at 2:24 am
4 Comments

++++-
4.6 rating from 12 votes

Monday, October 13th, 2008

Ajaxians join Mozilla; Creating a Developer Tools Group

Category: Ajaxian.com Announcements, Announcements, Mozilla

Today, we are really excited to be able to announce a big personal change. Ben and I are joining forces, full time, for the first time. What are we doing? We are joining Mozilla to create a new group with the charter to create developer tools for the Open Web.

Mozilla is placing a big bet, not only on us, but in the developer tools space.

Why are we doing this? Ben and I are passionate about a couple of things: compelling software and developers. In various roles in the past, we have built tools that attempt to make developers productive. We are huge advocates for the Open Web, yet we feel that tools are lacking on our collective platform. We want to help make a difference.

As we ramp up this new group, we will be looking at the problem and seeing where it makes sense to step in. We are going to be experimenting, and thinking about how to make developers lives better in different ways, so we aren't expecting to see traditional tools come out of this group. Also, we don't want to do this alone. We want to involve the entire community which is one reason that we are so excited to kick off this work at Mozilla. We believe that we have a unique opportunity to put developers first. We can build these tools in the open, with total transparency; the Mozilla way.

We respect the work being done by other vendors, and very much want to work together. We can't wait to reach out early-on in the process, involving companies that believe in the Open Web like we do. Together we can drastically improve productivity, allowing developers to build compelling user experiences.

We are just getting started. As soon as we come up with some ideas, we will be sharing then with you and asking for community participation in various forms. You, the Ajaxian community, have been phenomenal over the years, and we can't wait to do more together.

For our personal takes, see what I said and Ben thought.

Posted by Dion Almaer at 12:15 pm
14 Comments

++++-
4.9 rating from 36 votes

Tying great visualizations to Ext charts and maps

Category: Ext

Aaron Conran has developed a nice Ext extension to tie that world to the Google Visualization API:

Working with different API’s can present hurdles as we attempt to massage the same data in two different data structures - one for a grid and another for a pie chart. To address this specific challenge, I developed a short user extension Ext.ux.GVisualizationPanel enabling users to integrate visualizations into Ext JS applications without concern for these issues. The GVisualizationPanel adapts any Ext data Store into the google’s format and enables you to embed any type of visualization into a panel.

He then shows some examples, such as this intensity map:

JAVASCRIPT:
  1.  
  2. var countryStore = new Ext.data.SimpleStore({
  3.     fields: [{
  4.         name: 'Country',
  5.         type: 'string'
  6.     },{
  7.  
  8.         name: 'pop',
  9.         type: 'int'
  10.     },{
  11.         name: 'area',
  12.         type: 'int'
  13.     }],
  14.     data: [
  15.         ['CN', 1324, 9640821],       
  16.         ['IN', 1134, 3287263],
  17.         ['US', 304, 9629091],
  18.         ['ID', 232, 1904569],
  19.         ['BR', 187, 8514877]       
  20.     ]
  21. });
  22. var intensityMap = new Ext.ux.GVisualizationPanel({
  23.     id: 'intensityMap',
  24.     visualizationPkg: 'intensitymap',
  25.     title: 'Intensity Map Sample',
  26.     store: countryStore,
  27.     columns: ['Country',{
  28.         dataIndex: 'pop',
  29.         label: 'Population (mil)'
  30.     },{
  31.         dataIndex: 'area',
  32.         label: 'Area (km2)'
  33.     }]
  34. });
  35.  

Posted by Dion Almaer at 9:37 am
1 Comment

+++--
3.2 rating from 168 votes

The bane and choice of Rich Text Editors

Category: RichTextWidget

Whenever Abe Fettig is in town I think about how painful his live has been working with rich text editors :)

Stuart Atkinson has kindly done a roundup of the state of rich text editors, and it covers:

  • TinyMCE: There’s a modified version of this included in Wordpress these days, and it’s extremely well supported by its developers. You get all the formatting options you’d expect, plus the ability to easily remove excess formatting tools with just a little code. As an added bonus, there’s a collection of plugins which enable even more advanced formatting options.
  • YUI Editor: Sadly, this one is quite often ignored, perhaps due to that fact it’s the product of a large corporation. Nonetheless, I know a kick-ass set of tools and utilities when I see one, and this editor is fit for any such best-of list!

    You have 2 main configurations for this - Editor and simpleEditor. You’re not limited to these however, as once you get to grips with the API you can bespoke it with relative ease.

  • FCKEditor: FCKEditor is one of the longest standing web-based editors out there, and used in a great many open-source apps. It’s also available in a number of server-side languages
  • FreeRichTextEditor: FreeRichTextEditor is gaining more momentum these days, and comes available with 2 modes available straight out the box: design, code and preview.
  • WidgEditor: This is the work of client-side coding guru Cameron Adams, whose personal project has become an extremely viable, standards-based rich text editor for web applications. The JavaScript behind is also lean yet easy to read (should you want or need to understand it further), and the code output is smooth.

Then, people in the comments linked to WYMEditor, OpenWYSIWYG, NicEdit, and Dojo's editor (Abe Fettig in part).

Are there others out there that you like? Any experiences that you would like to share? A friend recently jumped from a paid widget to TinyMCE saying that it was finally ready for prime time.

Posted by Dion Almaer at 6:49 am
12 Comments

+++--
3 rating from 32 votes

Ruby on jQuery and Closures

Category: JSON, jQuery

Sam Ruby has that way about him that sees things very clearly. He just took a peak at jQuery for the first time and was able to really put into words what I think jQuery enthusiasts like about the library:

The notable thing about this is that despite all of the asynchronous events taking place, the code is sequential (nested, but sequential), and that the JSON results of the AJAX call is immediately available to the function that is invoked when the selection changes.

This is based on the following code that he wrote:

JAVASCRIPT:
  1.  
  2. $("#archive").click(function() {
  3.   $.getJSON('unscanned.cgi', {}, function(unscanned) {
  4.  
  5.     // replace realname input field with a selection list
  6.     var select = $('<select name="realname" id="realname"/>')[0];
  7.     for (var i=0; i<unscanned .length; i++) {
  8.       select.options[i] = new Option(unscanned[i][1], i);
  9.     }
  10.     $('#realname').before(select).remove();
  11.  
  12.     $("#archive").attr("disabled","disabled");
  13.  
  14.     // process selection
  15.     $('#realname').focus().change(function() {
  16.       var icla = unscanned[$("#realname option:selected").val()];
  17.       $("#realname").before('<input type="text" ' +
  18.         'id="realname" name="realname"/>').remove();
  19.       $("#realname").val(icla[1]);
  20.       $("#pubname").val(icla[2]);
  21.       $("#email").val(icla[3]);
  22.       $("#replaces").val(icla[0] + ':' + icla[3]);
  23.       $("#filename").val('').focus();
  24.       $("#archive").removeAttr("disabled");
  25.     });
  26.   });
  27.   return false;
  28. });
  29.  

Those that love jQuery, love the API.

John himself had an example in the comments:

JAVASCRIPT:
  1.  
  2. $(':radio[name=is_user]')
  3.   .change(function(){ $('.depends-isuser')[ this.value == 1 ? ‘show’ : ‘hide’ ](); })
  4.   .change();
  5.  

Posted by Dion Almaer at 6:40 am
1 Comment

+----
1.9 rating from 20 votes

Saturday, October 11th, 2008

This Week in HTML 5: Web Forms 2, Search, and more

Category: HTML

In Mark's eighth roundup of HTML 5 land, he delves into the merging of Web Forms 2, which gives us fun things like:

Then Mark discusses input type="search":

Andy Lyttle wants to standardize one particular feature of <input type="search"> (which is already supported by Safari, but not standardized): placeholder text for input fields. The text would initially display in the input field (possibly in a stylized form, smaller font, or lighter color), then disappear when the field receives focus. Lots of sites use Javascript to achieve this effect, but it is surprisingly difficult to get right, in part because no one can quite agree on exactly how it should work. Mozilla Firefox displays the name of your current search engine in its dedicated search box until you focus the search box, at which point it blanks out and allows you to type. Safari's search box is initially blank (at least on Windows), and only displays the name of your default search engine after it has received focus and lost it again. Google Chrome's "omnibox" displays "Type to search", right-justified, even when the omnibox has focus, then removes it after you've typed a single character. Adding an <input placeholder> attribute would allow each browser on each platform to match their users' expectations (and possibly even allow end-user customization) of how placeholder text should work for web forms. Discussion threads: 1, 2, 3. So far, there is no consensus on whether this should be added to HTML 5, or what the markup would look like.

And, he finishes with some interesting posts:

Posted by Dion Almaer at 12:43 am
9 Comments

+++--
3.6 rating from 11 votes

Friday, October 10th, 2008

Maintainable JavaScript videos are now available.

One month ago, the Fronteers conference in Amsterdam featured several "deep dive" talks on various web development topics. Stuart Langridge for example explained in detail what closures are and I talked about Maintainable JavaScript. The slides of my talk have been available for quite a while now and now Bachelor ICT have released the videos of the talk and an interview.

Here's the first half of the talk on Vimeo:


Chris Heilmann: Maintainable JavaScript, part 1 from Bachelor-ict.nl on Vimeo.

And here's the second:


Christian Heilmann: Maintainable JavaScript, part 2 from Bachelor-ict.nl on Vimeo.

Posted by Chris Heilmann at 7:13 pm
4 Comments

+----
1.9 rating from 258 votes

Reinhardt: a Client-side Dispatch Framework

Category: Dojo

Kevin Dangoor of SitePen has introduced Reinhardt a dispatch engine on the client side:

A typical server-side web framework today includes three main components: a URL dispatching to some controller object scheme, a template engine, and a data mapping facility. Currently in Dojo, you’ll find that the latter two items already exist. dojox.dtl provides the first one, and dojo.data provides the second.

Given that Dojo already offers an implementation of the Django template engine, and that regular expression-based URL dispatch was a good fit for our problem at hand, I decided to base our URL dispatch on the model provided by Django.

You can see an example using the framework which uses these patterns:

JAVASCRIPT:
  1.  
  2. var patterns = reinhardt.urldispatch.patterns("demo.code",
  3.   [/^list\/(\d*)$/, "showMovieList", ["year"]],
  4.   [/^search$/, "search"],
  5.   [/^movie\/(\d+)\/$/, "whatyear", ['id']],