DivKit 29.0

DivKit 29.0

DivKit

Hey everyone! We released a major release, DivKit 29.0.0, in which we reduced the layout restrictions for all platforms:

  • container, gallery, pager and grid without the items field are now considered correct.
  • Removed restrictions on the minimum number of elements in ranges, patch, filters, background and for the images field in text.
  • text with an empty text field is now displayed as a block without text instead of disappearing. 


Android

  • Fixed the removal of timers after applying a patch.
  • Added the ability to reset expression runtimes, error collectors and states for DivDataTag.
  • Added ability to change ViewPreCreationProfile in Div2Context.
  • Added support for the try operator.
  • Fixed a situation where the wrong DivActionHandler was being used.
  • Improved performance by making functions stateless.
  • Fixed a bug that caused visibility_action to not work for gallery children.
  • Added the ability to enable/disable the scroll bar in the gallery.
  • Added Coil image uploader.


iOS

  • Supported the item_builder property in DivContainer.
  • Supported the scrollbar property in DivGallery.
  • Supported the clipToBounds parameter in DivContainer.


Web

  • Added a new experimental method setData. This method allows you to quickly redraw a DivKit card using new json, which is much more efficient than directly destroying and recreating it.
  • Added try !: operator for expressions.
  • Undeclared variables will not cause errors in expressions.
  • Fixed behavior of match_parent inside container with wrap_content size and orientation = overlap.
  • Added len function for variable arrays.
  • Fixed an issue with expression support in the transition_change property.
  • Fixed SSR errors occurring when rendering a card with a list of timers and containers with the separators property.
  • Added support for patches to tabs and states (note that patches require exactly one element for each change, unlike other component types).
  • Fixed a problem with spaces next to () brackets in expressions.
  • Fixed possible errors when calculating integers for the functions getArrayInteger, getIntegerFromArray, getArrayOptInteger, getOptIntegerFromArray, getDictInteger, getIntegerFromDict, getDictOptInteger, getOptIntegerFromDict, copySign.

Breaking Changes

  • Expressions are now executed without waiting for all variables in them.
  • The Variable type and other related types (such as StringVariable) are now classes, not interfaces. In most cases all code will work the same way, but in rare cases this may break something. Also note that you can now check the type of a variable with instanceof, which works like type guard in TypeScript (getValue() will return a value with the correct type). Previously this was not possible because only getType existed, and TypeScript did not use it as a type guard.
  • Removed private methods in the DivKit instance. These methods were not typed or documented.
  • Added arrows for pager on the desktop platform. There are new options for customizing these arrows. platform can be passed in the options of the render method.
  • The internal implementation of the lottie extension has been changed. This was necessary to fix a problem with gif fallback being displayed simultaneously with lottie itself. If you provide a similar extension created from scratch, you may need to modify it slightly.

Report Page