Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@bogdan bogdan released this 18 Dec 09:20
· 11 commits to main since this release

Datagrid Version 2

Migration Guide.

Datagrid v1 was released on Sep 19 2013 - more than 10 years ago.
A lot of changes in best practices and available technology
had happened during this period.
These include:

  1. HTML5
  2. Ruby endless ranges
  3. Ruby beginless ranges
    • Put a star if you didn't know they were introduced one version apart.
  4. Ruby Keyword Arguments
  5. Modular CSS
  6. Rails Engines

It caused the library to be designed without support of those technologies
or their implementation to be suboptimal because of backward compatibility.
Version 2 addresses all that evolution.

API changes

  1. Ruby endless ranges for range filters.
  2. Use Hash instead of Array for multiparameter attributes.
  3. Remove column[url] option.
  4. Inherit Datagrid::Base instead of include Datagrid.
  5. ApplicationGrid is recommended base class instead of BaseGrid.

Frontend Changes

  1. Use form_with instead of form_for.
  2. Deprecated datagrid_order_for
  3. Modern modular CSS classes.
  4. HTML5 input types: number, date, datetime-local.
  5. Native Rails Engines:
    • while supported, the library was not initially designed for it.
  6. HTML5 data attributes
  7. Use column[tag_options] option instead of column[class].
  8. Consistent label[for] and input[id] for range filters.
  9. Updated app/views/datagrid/enum_checkboxes
  10. Introduced datagrid.filters.range.separator localization
  11. Remove SASS dependency
  12. Replace rake datagrid:copy_partials with rails g datagrid:views