Skip to content

v1.0.0

Compare
Choose a tag to compare
@kfranqueiro kfranqueiro released this 11 Jan 17:20
· 111 commits to master since this release

dgrid 1.0 includes all of the fixes included in 0.4.1. Note that this means it requires a minimum of Dojo 1.8.2 and dstore 1.0.3 or 1.1.1 as well.

It also includes the following major changes:

Removal of put-selector and xstyle dependencies

Users upgrading to 1.0 will need to manually import dgrid/css/dgrid.css (preferably before any dgrid skin) due to this change. It should have no other adverse effects.

dgrid 0.x relied upon put-selector for DOM manipulation and xstyle for its css AMD plugin to automatically load structural CSS resources expressed as module dependencies.

In 1.0, put-selector usage has been replaced with dojo/dom-construct, for several reasons:

  • While its APIs may be less terse, they are also generally easier to read and thus maintain
  • The majority of dgrid users are already loading it anyway, making it effectively a smaller footprint than adding another DOM library
  • dgrid and its users have occasionally suffered issues ultimately due to put-selector, while dom-construct has remained stable for years

The xstyle dependency has also been removed, since some of its modules also depend on put-selector (although the specific modules that dgrid used do not), which would have required builds including dgrid to still include put-selector in order for the build to run successfully.

Removing xstyle should also ultimately simplify some aspects of development:

  • Avoids potentially confusing behavior in cases where structural CSS loads after other custom CSS, when loaded dynamically via the css AMD plugin
  • Removes a level of complexity from the build process, since it is no longer necessary to worry about configuring the xstyle build plugin or otherwise optimizing all of the structural CSS files that would normally load dynamically

dgrid.css now includes structural styles for all dgrid components, but as it turns out, there is a pretty even trade-off between this and the bandwidth necessary to load xstyle's CSS plugin anyway.

Refactoring of CSS to Stylus

Complementing the removal of xstyle, dgrid's CSS has been rewritten and reorganized using the Stylus preprocessor. This offers the following benefits:

  • Projects consuming dgrid that also use Stylus can specifically import structural styles for only the components they need, starting with dgrid/css/base.styl and adding more as appropriate
  • Creation of custom skins with Stylus is now largely facilitated by setting variables and importing dgrid/css/skins/skin.styl. For more information, see the documentation on Customizing Skins.

Migration to Intern 3 and end of IE8 support

dgrid 1.0 now uses Intern 3 for automated testing. As Microsoft has ended support for IE8, and Intern 3 no longer maintains a geezer version supporting it, we do not intend to expend effort on IE8 from this point onward.

Note that IE8 is still unofficially supported insofar as any logic that existed in dgrid 0.4 to specifically accommodate it still exists in 1.0.

Additional APIs

  • Grid#hasNeutralSort - boolean property indicating whether clicking a header cell toggles between just ascending/descending, or ascending/descending/none. Default is false (ascending/descending only, like previous versions)
  • _StoreMixin#refreshCell(cell) - re-renders an individual grid cell from the collection or dirty state. (Thanks @msssk)

Removed APIs

  • Column definition objects no longer support the init and destroy functions, which were deprecated as of 0.4 along with the transition from column plugins to mixins. See _configColumns (or optionally _configColumn) and _destroyColumns in Grid for prototype-level equivalents.
  • The TouchScroll module has been removed, as it generally outlived its usefulness once modern mobile browsers effectively supported proper touch scrolling, and this module was only designed for WebKit environments.
  • The util/misc.contains function has been removed, as only one of its code paths was ever being used. Use Node#contains instead.