DivKit 30.0.0 release

DivKit 30.0.0 release

DivKit

Hello everyone!

This Monday, we published the major release 30.0.0! It brought many changes and new features: we changed the naming rules for variables, raised the minimum supported iOS version, and added SVG support on Android. And that's far from all.

The post turned out to be very extensive, so for convenient navigation, we have collected for you:

  1. Key changes
  2. Breaking changes and how to migrate to version 30.0
  3. Non-breaking changes


Key changes

Across all platforms

  • Variable names with consecutive dots and dots at the end are now prohibited.

For example, variables like very.dotted..variable (two consecutive dots) and persuasive.var. (dot at the end) are considered invalid and generate a parsing error.

A variable named still.good.var is valid.

Android

  • All is_enabled conditions in actions are evaluated before the actions begin execution, not during the process.

So, if action_2 had is_enabled == false , and action_1 changed the condition during its execution such that is_enabled for action_2 became true , action_2 will not be executed.

At the next run, all is_enabled conditions will be recalculated, and action_2 will be executed.

iOS

  • The minimum iOS version has been raised to 13.
  • String literals in double quotes are no longer supported.

The expression @{\"abcd\"} is no longer valid. Instead, use single quotes: @{'abcd'}


Breaking Changes. Migration

Android

  • Breaking Change: ExpressionResolver is now required in DivActionHandler , Div2Logger , DivExtensionHandler , and custom classes. The method signatures of these classes now include a new argument for ExpressionResolver , which should be used for evaluating expressions within them:com.yandex.div.core.Div2Logger - expressionResolver: ExpressionResolver has been added as the second argument.
  • com.yandex.div.core.DivActionHandler - expressionResolver: ExpressionResolver has been added as the third argument.
  • com.yandex.div.core.extension.DivExtensionHandler - expressionResolver: ExpressionResolver has been added as the second argument.
  • com.yandex.div.core.DivCustomContainerViewAdapter - expressionResolver: ExpressionResolver has been added as the fourth argument.
  • Breaking Change: com.yandex.div2.DivAction.logId: String now supports expressions logId: Expression<String> . To fix, change divAction.logId to divAction.logId.evaluate(expressionResolver) . For example, you can use Div2View#getExpressionResolver()
  • Breaking Change: Variable names with consecutive dots and dots at the end are now prohibited. Check if you have any, and simply rename them if necessary.
  • Breaking Change: The StandardExoDivPlayerView and ZoomExoDivPlayerView classes have been replaced by ExoDivPlayerView .
  • Breaking Change: The following classes have been removed from the public API: ExoDivMediaSourceAbstractFactory , ExoDivPlayer (available through the DivPlayer interface) and ExoDivPlayerView (available through the DivPlayerView interface).
  • Breaking Change: The method DivPlayerView#isCompatibleWithNewParams(scale: DivVideoScale) has been removed.
  • Breaking Change: The method DivPlayerView#makePlayerView(context: Context, additional: Map<String, Any>) has been removed. Player view creation occurs in com.yandex.div.core.player.DivPlayerFactory .

iOS

  • Breaking Change: Method signature in ExpressionResolver changed from resolveString(_ expression: String) -> String to resolveString(_ expression: String) -> String? .
  • Breaking Change: The DivStateInterceptor protocol and its implementation DivStateInterceptorImpl have been removed. Please use DivExtensionHandler .
  • Breaking Change: The public API for DivActionURLHandler.updateReason has been changed.
  • Breaking Change: DefaultDivActionLogger has been removed and replaced with EmptyDivActionLogger .
  • Breaking Change: DefaultShimmerViewFactory has been removed.
  • Breaking Change: DivVariablesStorage.ChangeEvent.oldValues has been removed due to performance issues.
  • Breaking Change: The urlOpener argument has been removed from the DivKitComponents initializer. Use urlHandler instead.
  • Breaking Change: UserInterfaceAction.Payload.composite has been removed.
  • Breaking Change: UserInterfaceAction.Payload.json has been removed.
  • Breaking Change: The signatures of the setSource functions have changed: they are now marked as asynchronous to reduce the number of main thread locks.
  • Breaking Change: Variable names with consecutive dots and dots at the end are now prohibited. Check if you have any, and simply rename them if necessary.

Web

  • Breaking Change: Actions from variable_triggers will now call the onStat callback with a new type = trigger .
  • Breaking Change: Variable names with consecutive dots and dots at the end are now prohibited. Check if you have any, and simply rename them if necessary.


Non-breaking changes (relative to version 29.15)

Android

  • The toString() method is supported in evaluated expressions, example usage: @{123.toString()} . Previously, only functions could be used: @{toString(123)} . The list of available methods will grow.
  • Implemented the gesture extension, which allows performing actions when a swipe is detected on the specified view.
  • Implemented the item_builder property for the container component.
  • Supported SVG image loading for all DivImageLoaders implementations. Read more in a separate post.
  • Added the ability to force release all video players using the Div2View#releaseMedia() method.
  • Supported the use of Div2View in Jetpack Compose.
  • Fixed an issue where old visibility_actions continued to be logged after re-creating Div2View .
  • New border or background are not set if there are no actual changes.
  • TextureView is now the default view for DivVideo .
  • Fixed the calculation of height for text when line_height is specified.
  • Fixed the calculation of the is_enabled flag in actions . All is_enabled conditions are evaluated before the execution of the entire action list, not during the process.
  • Fixed the algorithm for complex rebind.

iOS

  • DivActionLogger is deprecated. Use DivReporter for tracking actions.
  • Raised the minimum supported iOS version to 13.
  • String literals in double quotes are no longer supported.

The expression @{\"abcd\"} is no longer valid. Instead, use single quotes: @{'abcd'}

  • Fixed animation in gallery .
  • Fixed the number to string cast in evaluated expressions.
  • Fixed the position of gallery elements after scrolling via an action.
  • Fixed parsing of the unary minus operator.
  • Fixed validation in evaluated expressions.
  • Fixed view reuse in ShimmerImagePreviewExtension .



Report Page