Thursday 15 November 2007

Dojo 1.0 is now ready

Dojo 0.1 was born novembre 5th 2007 ;). This new release is very close to 0.9 one.
Release was out with a new theme for the dojo webSite




Dojo Now Include (Source SitePen ):
  • Accessibility
  • New grid (away from every table layout problem) [Sample]
  • 2D and 3D Charting [Sample] [Tutorial]
  • A full library of easy-to-use, attractive UI controls
  • Universal data access for simple and fast data-driven widget development
  • Internationalization with localizations
  • CSS-driven themes to make customization and extension simple
  • Dojo Offline, based on Google Gears
  • Support for the OpenAjax Alliance Hub 1.0 to guarantee interoperability with other toolkits
  • Native 2-D and 3-D vector graphics drawing
  • Access to many more widgets and extensions through the Dojo package system
have a look to the press release.


An interesting article was also published on sitePen in order to well understand the new Dojo widget mechanism : Dissecting Dijit

One of the most import stuff in this post is the widget workflow :
preamble()
Originating in dojo.declare, preamble is a new Dojo Core feature. It’s a pre-constructor accessory. By analogy, preamble is to constructor as postMixInProperties is to postCreate. Since preamble gets the same arguments as the constructor, you may extend another object, and jump in front of the constructor and change the arguments.

constructor()
Originating in dojo.declare, constructor has a new usage pattern. Previously, it fired last, which I didn’t find particularly useful nor accurate. It now fires early in the widget lifecycle, allowing early initialization with the arguments passed into the object. While more common in use, it’s not exactly necessary, as Dijit handles the job of converting your arguments into object properties.

postMixInProperties()
Originating in dijit._Widget, postMixInProperties is used more commonly by widget developers. That said, some of its duties are superseded by the addition of constructor and preamble. Its main purpose is firing after the properties have been set, but before the widget has been parsed and created. Pre-creation work on widget properties is typically done in this method.

postCreate()
Originating in dijit._Widget, postCreate is the “heavy lifter” of Dijit. This fires after creation, but before the widget is rendered to the page. At this time in the widget lifecycle, you have access to the widget’s nodes, so additional parsing, connections, styling, or even attaching more widgets is possible.

startup()
Originating in dijit._Widget, startup is somewhat misunderstood. startup doesn’t fire unless the widget is a child of another widget. And then it only fires after it, and all of its siblings have been created. Then they all fire together.

Tuesday 21 August 2007

Dojo 0.9.0 has been released

Dojo 0.9.0 has been released today.

Here is the feature list (original post from Dylan Schiemann on SitePen) :

Dijit:
* unified look and feel for all widgets
* ambitious a11y and i18n features in every Dijit widget
* a mature CSS-driven theme system with multiple, high-quality themes
* huge improvements in system performance
* data-bound widgets
* Declarations for lightweight widget writing
* a new page parser that allows instances of any class, not just widgets
* no magic

Core:
* reduced API surface area (easier to remember and use)
* dojo.query() always available, returns real arrays
* from-scratch high-performance DnD system
* Base (dojo.js) is 25K on the wire (gzipped)
* dojo.data APIs finalized
* new build system
* new test harness for both CLI and browser use
* dojo.behavior now marked stable and based on dojo.query
* excellent animation APIs with Color animations in Base (always available)
* all the features you’ve come to count on from Dojo (RPC, JSON-P, JSON, i18n, formatting utilities, etc.)

DojoX:
* high quality implementations of previously experimental features:
* gfx (portable 2D drawing)
* data wires
* offline
* storage
* cometd (Bayeux client)
* etc.
* dojox.gfx now includes Sliverlight support
* many more features and improvements than there’s room for here



Read the migration guide for more information

Thursday 9 August 2007

How to optimize Dojo 0.4.X?

Dojo out of the box is not really efficient, there are some optimization to do before putting it in production :
  • Build it (Dojo Doc)
    • On command line as explain in Dojo Doc
    • With an Eclipse Plugin
    • With an online application
  • Optimize your Dojo Application as describe in the Dojo Book


You can also read this very interesting article from Eugene Lazutkin about Dojo Application Optimization.

Wednesday 1 August 2007

When does the Dojo DatePicker start?

Dojo is mainly developed and maintained by Americans, so I let you guess what is the first available date in the Dojo DatePicker : 10/12/1492

What about us, poor European from the "old europe" ;). How can we make some references to our huge and old history ? ;)

Thanks to François for the screenshot.

Tuesday 22 May 2007

Dojo 0.9 Milestone Release 2

Alex Rusell recently anounce Dojo team pushed Dojo 0.9 Milestone Release 2 which is the last before 0.9 Beta.
What is new in this release?
  • A lot a performance optimization
  • Dojo is now divided in subproject :
    • Dojo : Core project containing main features (event management, light effects management, Dom management, io - Ajax - , rpc, date, etc... )
    • Dijit : Project containing widgets which can be compiled to optimize performance with widget used in an application.
    • Dojox : Some experimental modules and other widgets
  • Lots of new modules, bug fixes, and quality APIs

Dojo (core) is now 43k (20k gzipped) and is very otimized. Js size is now roughly Prototype's size. An other very interresting feature is the API, it is now a stable one with homogen function.

have a look to Alex post to get more information : http://www.sitepen.com/blog/2007/05/13/dojo-update-m2/



tags : dojo, javascript, web2.0

Monday 12 February 2007

Creating a splashScreen for "heavy" web application with Dojo

More and more web application are build with same constraints as "heavy client". We all want our application looks like an OS native application in a web browser.
A lot of cool framework allow developper to build such application. The problem now is the application loading. A very "heavy" application can take more than 1 or 2 seconds to be loaded and while application loads, end user don't know if the application works or if it is down.
There is an alternative to this kind of problem : the splashScreen. This kind of feature could be implemented by dojo with the famous dojo.addOnLoad Method.

Here is a simple exemple showing how to make a splashScreen with Dojo :
function showApp() {
    dojo.byId("splash").style.display = "none";
    dojo.lfx.fadeShow("real", 100);
}
dojo.addOnLoad(showApp);

<div id="splash" style="position: absolute; top: 200px; width: 100%;z-index: 100;">
   <div align=center>
       ... 
   </div>
</div>

<div id="real" dojoType="LayoutContainer"
    style="opacity: 0.01;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);">
    ... 
</div>

In this exemple, we simply show in simple splash when page is shown and we remove it when all Dojo js has been executed (with a fade - just for fun) for showing the main application. It is very simple... let try it.

Wednesday 10 January 2007

Refreshing a Dojo widget in a XMLHTTPRequest

When you add an html fragment containing a Dojo Widget to a WebPage, Dojo does not interpret this html fragment. So this new widget is not added to the Dojo manager and it does not work. This kind of dom opration often happens in Ajax application using Dojo so you can force dojo to add this widget to the manager in order to make it work with this 2 lines :
  djConfig.searchIds = ['widgetIdToInterpret']; 
  dojo.hostenv.makeWidgets();
searchIds is a table containing widget to interpret by Dojo manager and the dojo.hostenv.makeWidgets runs the dojo interpretor to make the new widget

Some Tips for Dojo

I've just opened a new category called Dojo to share some Dojo tips or feelings.
Hope it could be usefull for readers