New features and improvements
- New dependency management to reduce payload, improve load times and support ESM (658 by dclause, falkoschindler)
- Simplify API for registering [custom Vue components](https://github.com/zauberzeug/nicegui/blob/184c7f8590c19a481af47beb60d1e6393c2ce0d5/examples/custom_vue_component/counter.py#L6C1-L6C48) and [JavaScript dependencies](https://github.com/zauberzeug/nicegui/blob/184c7f8590c19a481af47beb60d1e6393c2ce0d5/examples/map/leaflet.py#L6) (1134 by rodja, falkoschindler)
- Improve [generic event registration](https://nicegui.io/documentation#generic_events) to provide access to sender and additional event arguments (583, 664, 672, 1095 by michelemoretti, bobanovo, falkoschindler)
- Provide source maps for minified dependencies (753 by aaad, falkoschindler)
- Tech-preview for [NiceGUI On Air](https://nicegui.io/documentation#nicegui_on_air): use `ui.run(on_air=True)` to get a temporary public URL through which your local app is accessible via the internet (falkoschindler, rodja)
- Reduce size of PyPI package by making pywebview, plotly and matplotlib optional (1010, 1143 by firai, rodja)
- Use snake_case style arguments for [`ui.notify()`](https://nicegui.io/documentation/notify) (#930 by CatamountJack)
- Allow using `ui.menu` for [custom context menus](https://nicegui.io/documentation/menu#custom_context_menu) (747 by falkoschindler)
- Remove `no-parent-event` prop for [`ui.menu`](https://nicegui.io/documentation/menu) (#713 by falkoschindler)
- Add `on_change` parameter for [`ui.knob`](https://nicegui.io/documentation/knob) (#1119 by rodja)
- Add [`ui.scroll_area`](https://nicegui.io/documentation/scroll_area) element (#1072 by eli-kha, falkoschindler)
Bugfixes
- Fix memory leak on client when removing elements (1089 by Kamil-Och, CrystalWindSnake, falkoschindler)
- Fix `on_shutdown` callback not being called on Windows 10 (1050 by chhinze, firai)
- Fix `ui.footer(fixed=False)` (1136 by falkoschindler)
- Find IP addresses more robustly using netifaces (1137 by falkoschindler)
- Fix two favicon issues (1139 by falkoschindler)
- Fix table selection not going away after removing selection (1115, 1122 by struffel, Trickshotblaster, falkoschindler)
Documentation
- Add demo for removing default padding with `ui.query` selector (1120 by rodja)
Breaking changes and migration guide
Generic event registration with `.on()`
The argument passed to the event handler is now of type `GenericEventArguments`. So instead of
py
grid.on('cellClicked', lambda msg: ui.label(f'{msg["args"]["data"]["name"]} has been clicked!'))
we access the event arguments like this:
py
grid.on('cellClicked', lambda e: ui.label(f'{e.args["data"]["name"]} has been clicked!'))
See https://nicegui.io/documentation/generic_events for more information.
Custom Vue components and JavaScript libraries
We radically simplified the API to register custom components and external libraries.
Now you can pass the location of the component and additional libraries as parameter to the derived class:
py
class CustomElement(ui.element, component='custom_element.js', libraries=['lib/some-library.min.js']):
super().__init__()
...
Note that you don't have to pass a `tag` to the base initializer. It will be set automatically.
Besides `libraries` you can specify `exposed_libraries` (will be added to `importmaps`) and `extra_libraries` (will be registered but not automatically requested by that element).
All library parameters support absolute and relative paths (relative to the Python file), either as `str` or as `Path`, and support globbing.
Exclude parameter
The `exclude` parameter of `ui.run` is gone.
Due to NiceGUI's new dynamic dependency management there is no need to explicitly exclude individual elements.
Python 3.7
With NiceGUI 1.3 we drop support for Python 3.7, which had its end of life on June 27, 2023.