Guide for changes from 0.9 to 1.0 for dojo core, dijit, and dojox.
If porting from an older release, please see the 0.4 to 0.9 porting guide also.
Mapping a .* resource name to __package__.js is no longer supported. It was too much "magic", and caused confusion with the Java notion of .* in package names. So things like dojo.require("foo.*") mapping to foo/__package__.js is no longer supported. Instead, use one of the following conventions:
Several non-standard attribute and pseudo selectors were implemented (but never documented) in Dojo 0.9. These have been removed. If your code used the "!=" attribute value test, you can now use the :not() pseudo selector to achieve the same affect (including chains of not clauses). The non-standard ":contains" pseudo selector has also been removed.
Following files were capitalized to reflect that they host classes rather than collection of functions:
avatar.js ⇒ Avatar.js
container.js ⇒ Container.js
manager.js ⇒ Manager.js
selector.js ⇒ Selector.js
source.js ⇒ Source.js
Please rename your require statements like this:
dojo.require("dojo.dnd.source"); ⇒ dojo.require("dojo.dnd.Source");
Additionally move.js was split into 3 files: move.js, Mover.js, Moveable.js. This change needs no actions on your part, because move.js includes the other two files, but if you need just a single class, now you can include it directly.
Moveable implements three events:
As always look into the source and test files to see implementation details and suggested use scenarios.
Events have better locality than topics: instead of getting called on every move and check if it is "the right" move, you can connect directly to events on the Moveable. Nevertheless topics are still supported.
When programmatically creating a widget, class, style, and id now need to be specified as parameters to the constructor, not as attributes of the placeholder node. Example:
new dijit.form.Button({ "class": "large", style: "color: red" });
The baseClass for a form widget must now be specified in the javascript instance, like:
templatePath: ..., baseClass: "dijitTextBox", ...rather than in the template.
Widget: a new attributeMap property has been added to widgets that automatically copies things like id and tabIndex into the widget's DOM tree. If you are writing custom widgets (or even just custom templates) you should be aware of it. When declaring markup on the page, standard attributes will now be mixed in with those in the Widget templates. However, when attaching to nodes programmatically using the widget constructor's second argument, carrying over attributes is no longer supported -- these attributes must be passed explicitly.
Formatting for all the <input> widgets (TextBox, ValidationTextBox, ComboBox, etc.) has changed. You will need to update your CSS rules for customizing formatting.
<input dojoType="dijit.form.TextBox" style="width: 10em;">or
<style> medium { width: 10em; } </style>
<input dojoType="dijit.form.TextBox" class="medium">
Note that previously, you specified a pattern like .dijitComboBox INPUT { ... }.
Remember that that if there's an error, that width will be split between the inpu area and the validation icon
<input dojoType="dijit.form.NumberTextBox" size=4>
The pageSize attribute was changed from a default of 30 to Infinity to better align with common customer use cases.
a number of changes to tree including specification of the root node and also that childAttr is now an array rather than just a scalar (this affects programmatic creation of trees).
Method name changes:
create() (which calls postMixInProperties(), postCreate(), etc.) is now called from postscript(), which means that you should do widget initialization (stuff that needs to happen before the properties are mixed in) in constructor() rather than preamble(). I think preamble() will still work in most cases but constructor() is now the standard.
Typically people initialize arrays and objects in constructor() to avoid multiple widgets sharing the same object, although actually that generally isn't necessary. It's only really needed if you are writing directly into the object rather than setting it like this.foo = { ... }.
dijit.form.InlineEditBox was deprecated in favor of dijit.InlineEditBox, which has a new signature without a nested widget:
This new version still has some kinks to work out but is working in general, and should be faster since it doesn't instantiate the editor until it's needed. (In particular this is useful for using a heavy editor widget like dijit.Editor, although I haven't tried that yet.) Note that this implies that you have to write out the "display version" of the widget's value on the server, which could be complicated for things like currency due to internationalization issues. But I'm expecting the main use of InlineEditBox to be for editing plain or rich text, rather than numbers or currency.
Most people don't use this class directly, but for those that do, note a few changes: