Login Register

Dojo 1.2 Release Notes

Migration issues

This sections details changes you might need to make if upgrading your app from dojo 1.1 to dojo 1.2

Links to download files or execute javascript (dojo.addOnUnload() vs. dojo.addOnWindowUnload())
Callbacks registered via dojo.addOnUnload() were previously not always fired in IE. This is now fixed, but it exposed a problem with clicking on links to download files or javascript: links -- those types of links trigger the window.onbeforeunload event, which is what triggers dojo.addOnUnload callbacks. However those types of links do not actually destroy the page. So you should be careful doing destructive operations in dojo.addOnUnload().

If you need to do things like clean up circular reference to prevent IE leaks (over and above what dojo already does for you), then you can use the dojo.addOnWindowUnload() (new in Dojo 1.2), which triggers the callbacks on window.onunload. It works the same as dojo.addOnUnload, but it just fires on window.onunload, when the page is really unloading. Be careful trying to do DOM and JavaScript property access during a dojo.addOnWindowLoad() callback -- the state of the page may not be stable.

Editor
Use with TEXTAREA deprecated for security reasons; use DIV instead. See #2140

dijit._Widget.destroy()
There was technically an API change around _Widget's .destroy() method. Previously, it had documented a "finalize" parameter that did nothing. We've changed that parameter to become "preserveDom", a boolean to toggle weather destroy() will remove the domNode associated with the _Widget (this.domNode). Pass "true" and the dom will be preserved. See #6668 for details. Included is a simple test, and we've updated the FisheyeLite test to show how you can effectively start and stop the effect using
.destroy().

dojo.isGears moved to dojo.gears.available
Gears detection was moved to the dojo.gears module resource, so do dojo.require("dojo.gears") to get it. Then, use dojo.gears.available to get a boolean result that tells you if Gears is installed.

dojo.xhr calls that use handleAs: "json-comment-filtered" are deprecated. If you use handleAs: "json-comment-filtered" you will get a warning in the console about it. To suppress the warning, set djConfig.useCommentedJson to true. This also means djConfig.usePlainJson flag has been removed, since plain JSON is preferred, and no warning is given now for using it.

dojox.widget - form-based widgets moved to dojox.form: dojox.form.ColorPicker, dojox.form.FileInput . the dojox.widget probject uses a convention for its resources like: dojox/widget/WidgetName/WidgetName.css ... When migrating, you will need to adjust your path to the external CSS files: FileInput.css and ColorPicker.css both now reside in dojox/form/resources/ ... Both widgets are still marked experimental, and have been moved without deprecation into the dojox.form project as a permanent home more suited to the functionality.

Core and related libraries

AOP library - New dojox.lang.aspect module for before/around/etc advice and other AOP features.

Events:
New charOrCode attribute added to keyboard events (keyChar is deprecated) so that printable and non-printable keys can be handled in same switch statement, see [13544] and [13547].

djConfig.addOnLoad is now supported. Adds a callback via dojo.addOnLoad. Useful when Dojo is added after the page loads and djConfig.afterOnLoad is true. Supports the same arguments as dojo.addOnLoad. When using a function reference, use djConfig.addOnLoad = function(){};. For object with function name use djConfig.addOnLoad = [myObject, "functionName"]; and for object with function reference use djConfig.addOnLoad = [myObject, function(){}];

dojox.fx.easing has been promoted to Dojo Core, and is available by dojo.require("dojo.fx.easing"); an API shim is in place for users of dojox.fx.easing, and deprecation warnings are being thrown.

dojo.html.set() feature added to use ContentPane like functionality outside of ContentPane.

try/catch behavior changed with djConfig.isDebug = true. Some modules in Dojo Core (XHR, Deferred, dojo.addOnLoad callback code) would catch errors and either just report them in the console or did another throw which made it hard to track the origin of the error. This was done to keep the code robust and running in the page. However, for development scenarios it made it hard to track down the origin of the error. Now, those modules let the original exception bubble up, stopping JavaScript execution if djConfig.isDebug is set to true. If djConfig.isDebug is set to false (or undefined) then a try/catch is used and the error is logged to the console.

browser detection 'falsey' values have changed for properties like dojo.isIE, dojo.isFF, dojo.isSafari. These properties are now undefined instead of zero when the user agent is not the given browser, but continue to produce version numbers when the condition is true. This should not have any impact unless a direct comparison was made with the number zero in code. Instead, it is best to simply check the value by letting JavaScript coerce the value to a boolean, e.g. if(!dojo.isIE){...}

dojo.cldr has been updated from CLDR version 1.5.1 to 1.6. Localization tables have been updated and, as a result, formatted strings or parsing of strings from the user with packages dojo.date.locale, dojo.number or dojo.currency may be different than previous releases.

Usability / LookAndFeel enhancements

TimeTextBox: auto-scrolling, keyboard support, better styling

Form validation:
- form widgets enhanced so that they won't turn yellow while the user is typing because the value they have is incomplete... however they will still turn yellow instantly if the value they are typing isn't valid (and can't be made valid by typing more characters)... should provide good feedback to users w/out crying wolf.
- Also, [14161] add onValidStateChange connect point to dijit.form.Form widget so that custom behavior like disabled submit buttons (when the form is invalid) can be created.

ComboBox/FilteringSelect: highlighting of search results

CheckBox:

  • fixed rollover effect of focused checkboxes
  • indicate focus on FF/Safari the same as IE (via a hatched box around the label) (for radio button too)

Buttons: fixed vertical alignment and various display problems

Tree: fixed issues with horizontal scrolling and made each row white-space:nowrap, so that the label doesn't wrap around. Also fixed vertical alignment issue between icons and text.

Animations: default animation time for widgets sped up, and controllable through dojo.config.defaultDuration

Tooltip: made arrow smaller

BorderContainer: fixed layout issues with panes resulting in missing borders or double borders.

Charting

whole bunch of stuff here, check bugdb or check w/Eugene. tooltips, animations, events, legends for charts, plus new chart types. (Bubble plotter [13248], intersection, financial plotting, etc....)

Grid

Should fill in this section with grid features and enhancements.

RPC and dojo.data

Google AJAX API powered Data stores in dojox.data as well as A preconfigured SMD for use with dojox.rpc.Service

Google Analytics Helper released: dojox.analytics.Urchin -- allows you to post-onload include Google Analytics
helper, and track Ajax-y pages via a simple API, with a very small overhead.

ServiceStore ServiceStore
and it's subclasses are a dojo.data implementation for any webservice. Fetches are routed through the service and the returned results are used as the data behind the API.

JsonRestStore - ServiceStore also has a subclass JsonRestStore, which provides read/write capabilities using the REST service in dojox.rpc.Rest. The read/write capabilities can be used directly with JsonRest, and JsonRestStore adapts these capabilities for the Dojo Data API. JsonRestStore has three subclasses:

These each have adjustments for minor differences in handling certain behavior for these three different Json Rest storage systems. (#5987)

ClientFilter - ClientFilter is an abstract class that can be used by remote data services for doing partial client side filtering, sorting, and paging, and can utilize these facilities for caching previous fetch results and querying the cached results for subsequent "narrower" queries. ClientFilter can update previous fetch result sets in response to data change notifications. This allows widgets to determine if and how to update a UI after a data notification. The ClientFilter is used by JsonRestStore/ServiceStore if it has been loaded.

OfflineRest/LocalStorageRest - OfflineRest provides auto-synchronization and caching of data for REST based applications. In particular, it is built for JsonRestStore to be used in offline mode, and it will save all data changes locally and synchronize/persist the changes to the server when connectivity is available.

new DojoX Projects/Modules

dojox.json.query - JSONQuery is a new module intended to succeed and improve upon the JSONPath module introduced in Dojo 1.1. JSONQuery provides a comprehensive set of data querying tools including filtering, recursive search, sorting, mapping, range selection, and flexible expressions with wildcard string comparisons and various operators.

dojox.json.ref - This module provides serialization and parsing of data structures with circular, multiple, cross-message, and cross-domain references using JSON Referencing. This module supports path-based, id-based, and combined referencing techniques, and can be used for indexing purposes for data stores (JsonRest/JsonRestStore utilizes this module).

dojox.json.schema - This module provides JSON Schema validation. This can be used by data stores (JsonRestStore will use the validator if it has been loaded and a schema has been defined) to maintain data integrity.

dojox.io.windowName - Provides secure cross-domain request capability. Sends a request using an iframe (POST or GET) and reads the response through the frame's window.name.

dojox.io.xhrPlugins - This is a registry for creating alternate XHR handlers, for example you can register to use IE8's XDomainRequest or a proxy server to handle cross-domain requests.

dojox.secure.capability - This provides object-capability JavaScript validation. This is
a validator to run before eval to ensure that a script can't access or modify any objects (like global objects) outside of those specifically provided to it.

dojox.secure.DOM - Provides a DOM facade that restricts access to a specified subtree of the DOM. The DOM facade uses getters/setters and lettables to emulate the DOM API.

dojox.secure.sandbox - Provides support for loading web pages, JSON, and scripts
from other domains using XHR (and XHR plugins) with a safe subset library and
sandboxed access to the DOM.

dojox.lang.observable - Provides a form of getter/setter support to objects. Observable objects can be created such that all property reads, writes, and method calls will trigger listener functions so that you can create APIs where property interaction can be controlled and monitored. This relies on VBScript hacks for IE and is somewhat limited in functionality.

DojoX Widgets

GridContainer: The Grid Container is a container of children elements that are placed in a kind of grid. It displays the children elements by column (ie: the children widths are fixed by the column width of the grid but the childs heights are free). Each child is movable by drag and drop inside the Grid Container. The position of other children is automatically calculated when a child is moved You can dynamically add/remove columns You can use keyboard to navigate and move children. (#6837)

New dojox.layout.RotatorContainer submitted by Chris Barber. Updates to RadioGroupSlide to include z-index
tracking and slideFrom direction control.

dojox.image.Badge - a fun prototype widget of looping proportions! Attach images or background images, and let loop. Coming next: dojo.data readyness.

dojox.widget.Wizard - the dojox.widget.WizardContainer (provided by Wizard.js) has been renamed to be simply "dojox.widget.Wizard" ... The relationship of a dojox.widget.WizardPane to a Wizard is unchanged. Simply remove the "Container" from your dojoType or class name.

XML parser for widget markup (#5766)

dojox.html.styles - Insert and remove CSS rules; Search document for style sheets; Toggle sheets on and off (based on the W3C spec).

dojox.form.FileInputOverlay - Turns most any button into an Uploader by laying a transparent FileInput over the top of it.

Dijit Enhancements

FilteringSelect - no longer need to put blank value in drop down list in order for user to be able to clear the value; they can clear it w/backspace or delete key now. (#5974)

Menu - New CheckableMenuItem class; when you select this menu item a check mark appears or disappears (like a toggle button)

util/buildscripts

stripConsole: There is a new build option that will strip console.* calls in all JavaScript files that are in the build. stripConsole=normal will strip all console.* calls except console.warn and console.error. stripConsole=all will strip all console.* calls.

Editor

There are new plugins in dojox.editor for creating/modifying tables and uploading images.

Also, Editor had a major refactor. It only uses an iframe now for FF2, and otherwise uses contentEditable div. TODO: fill in more details here. Are there any new features?

Background information for deprecated "json-comment-filtered"

Some background information about the reasons why the json-commenting approach seems to be unsecure and why it's deprecated now, can be found here: ticket #6380.

Regards,
Remi