DivKit 29.0
DivKitHey everyone! We released a major release, DivKit 29.0.0, in which we reduced the layout restrictions for all platforms:
container
,gallery
,pager
andgrid
without theitems
field are now considered correct.- Removed restrictions on the minimum number of elements in
ranges
,patch
,filters
,background
and for theimages
field intext
. text
with an emptytext
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
inDiv2Context
. - 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 inDivContainer
. - Supported the
scrollbar
property inDivGallery
. - Supported the
clipToBounds
parameter inDivContainer
.
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
insidecontainer
withwrap_content
size andorientation
=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
andstates
(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 asStringVariable
) 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 withinstanceof
, which works like type guard in TypeScript (getValue()
will return a value with the correct type). Previously this was not possible because onlygetType
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 thedesktop
platform. There are new options for customizing these arrows.platform
can be passed in the options of therender
method. - The internal implementation of the
lottie
extension has been changed. This was necessary to fix a problem withgif
fallback being displayed simultaneously withlottie
itself. If you provide a similar extension created from scratch, you may need to modify it slightly.