Anvil Extras 2.5

We’ve just released Anvil Extras v2.5.0.

If you’re using the new Beta Drag-and-drop Designer with anvil-extras components then we strongly recommend moving to v2.5.0.

We had to make a few changes to the way some of anvil-extras components work inside the beta designer.


New Features

  • authorisation module
    • adds check_permissions and has_permission functions
  • routing.lazy_route
    • allows you to lazily load Forms whilst using routing (see below)
  • Autocompletion
    • adds filter_mode property - either "contains" or "startswith"
  • navigation module
    • set_mode("hash") can be used to set the default navigation mode to hash routing
    • menu definition can include title, rather than registering a form with a title
    • set menu item visibility using conditions defined in the menu definition (see docs)
  • view transitions
    • routing and navigation use a transition on page changes (can be turned off)
  • Progress Bars
    • support dynamic property changes

Bug Fixes

  • Pivot component
    • doesn’t fail if self.items is not set
  • routing alerts (docs)
    • was no longer dismissing alerts on navigation
    • you will now need to use routing.alert in place of anvil.alert for an alert to be dismissed on navigation
    • non-dismissible alerts will block the navigation (as before)
  • Tabs component
    • ensure the selected tab indicator adjusts when the tab component changes size

Minor Changes

  • Slider
    • improve behaviour in the designer
  • wait_for_writeback
    • is now written in pure python
  • Switch
    • improve behaviour in the designer

routing.lazy_route

A new decorator inspired by this thread on the forum:

Lazy Loading for Forms? - #4 by stein

from anvil_extras import routing

@routing.lazy_route('')
def home_route():
    from ..HomeForm import HomeForm
    return HomeForm

@routing.lazy_route('articles')
def article_route():
    from ..ArticleForm import ArticleForm
    return ArticleForm

This means you can define all your routes in a single module (if you prefer)

8 Likes

We’ve bumped the version to v2.5.2, which fixes an issue with anvil_extras.storage serialization

3 Likes