ATK 2.2.0 Released!

Our team is excited to announce release of ATK 2.2.0. This release is primarily focused on clean-ups but depending on your code may contain some breaking changes. This article will highlight some of the more exciting new additions:

Breaking/important Changes

  • Significant improvement of template engine (#1349) @mvorisek
    • New implementation is backward compatible, but is faster.
    • If you have referenced spot with #-tag (e.g. $template->set('icon#2', $icon)) - internal spot numbering now starts with #0.
  • Add separate/explicit Model::setMulti() method, Model::set() no longer accepts array (#621) @mvorisek
    • use set() individually, if you really need to set an array (usually because the source is array itself), use setMulti() method
  • Drop AppScopeTrait trait from Model & Persistence classes (#654) @mvorisek
    • AppScopeTrait is now only used in ATK UI. Referencing $app from Model class is anti-pattern. If you want to reference $app in your models, apply this trait manually to all your Model classes.
  • Close html tag immediatelly - add nested Form support (#1275) @mvorisek
    • this changes HTML structure of a form slightly, if you do any custom Form styling, you may need to re-check your CSS selector.
    • no change should be taken
  • Drop App::dbConnect() method (#1361) @mvorisek
    • $app->dbConnect() was a handy way to inject $app into your persistence and all the models too.
    • We realise that having $app property in models is actually an anti-pattern
    • dbConnect() is removed and AppScopeTrait no longer applied on all Models.
    • You can manually implement dbConnect() in your own App class and give your models AppScopeTrait if your code is affected by this change.
  • Refactor render methods (#1358) @mvorisek
    • see PR if you are affected and how to migrate
  • HasXxx() methods now return bool only + always require field to be defined first (#616) @mvorisek
    • see PR if you are affected and how to migrate
  • Improve array persistence and disallow passing array by reference (#627) @mvorisek
    • passing data by reference is no longer supported, data are now internal only

a lot of namespaces/classes were refactored:

see individual PRs for regexes to quickly find if you are affected

  • add all breaking changes that were not listed (at least core has this issue, see Discord)

For full change logs:

Please post your update experience here or if you experience any other issue during upgrade.

2 Likes