We’ve just released Anvil Extras v2.0.0 with:
Breaking Changes
-
routing.load_form()was removed. Userouting.set_url_hash()instead.
This is our first breaking change (hence this being version 2.0 rather than 1.10). If you have apps using routing.load_form(), you should ensure that the dependency is pinned to version 1.9 and only upgrade once you have changed all instances of that call to routing.set_url_hash()
New Features
- Popovers - supports changing the default container to something other than
"body"
adddismiss_on_scroll()andset_default_container()methods - Quill - adds a sanitize property and a sanitize kwarg to the
set_html()method - routing - adds support for multiple top level forms
-
@routing.template(path='', priority=0, condition=None)
A template form is a top level form that holds the header, navigation bar, side panel and an emptycontent_panel.
When navigating the routing module will ensure the correct template is the currentopen_formbased on thepriority,path, andcondition. The currenturl_hashmust start with thepath, and if aconditionis set it must returnTrue.
Templates are checked order of priority, highest values first. -
@routing.default_templatereplaces@routing.main_router.
The@main_routerdecorator is still available.@default_templateis equivalent to@template() -
routing.NavigationExit()
when raised within atemplate'son_navgationcallback, this will prevent theroutingmodule from changing thecontent_panel.
This is useful if you have aLoginFormas atemplatewhose content should remain unchanged when the user tries to navigate to otherroutes. -
routing.launch()
called within a startup module, replaces the call toopen_form().
routing.launch()checks the currenturl_hashand ensures that the correct template is loaded based on the paramaters of each template.
Callingrouting.set_url_hash()in a Startup Module will have no effect on form loading untilrouting.launch()has been called. (This allows you to change theurl_hashwithin the startup logic)
-
-
loggingmodule
Small, simple, lightweight API for logging in anvil apps, a bit like the Python logging module.
See the docs:-
LoggerLogging — Anvil Extras documentation -
TimerLoggerLogging — Anvil Extras documentation
-
Bug fixes
- Multi-select - fix button clicks don’t always close the dropdown menu
- fix bug with
@timeddecorator if used with keyword logger and level arguments