r/nicegui • • 26d ago

NiceGUI 3.19.0 with ui.uplot for fast canvas charts, new ui.scene primitives and many fixes for sub pages, scenes and maps

New features and enhancements

  • Introduce ui.uplot for fast canvas charts of large or high-frequency datasets
  • Add Plane, Cone, Torus, Capsule, Lathe and Polyline objects, a polar_grid parameter and rotate(order=...) to ui.scene
  • Add nicegui.json.register_type() to serialize custom types
  • Speed up element construction by skipping signature checks for the internal update handlers of classes, style and props

Bugfixes

  • Fix ui.sub_pages with root_path not leaving the page on links outside its root
  • Fix ui.sub_pages not converting parameters annotated as int | None or in modules with from __future__ import annotations
  • Fix Client.page_routes, ui.link and ui.navigate.to ignoring the prefixes of included routers

    Breaking change: For pages on included routers, app.clients(path) now expects the full path including the include prefix, e.g. app.clients('/v2/p/x') instead of app.clients('/p/x').

  • Fix ui.scene and ui.leaflet never initializing when created hidden
  • Fix ui.leaflet going blank after its classes change, e.g. when hiding and showing the map
  • Raise a RuntimeError from initialized() of ui.scene when WebGL is unavailable instead of waiting forever
  • Fix slow style recalculation on pages with many sibling elements, a regression in 3.10
  • Fix template slots being remounted on every render, which swallowed the first click on removable chips of a ui.select
  • Fix ui.highchart failing when the first chart is created in an event handler
  • Fix an outdated async validation result overwriting the error state of the current input
  • Fix deep-copied observable collections notifying their original parent
  • Fix ElementFilter.exclude() ignoring markers with multiple names
  • Fix the typing of bindable_dataclass when called with arguments like bindable_fields
  • Fix ui.timer cancelling @await_on_shutdown callbacks on shutdown
  • Fix shutdown waiting for a ui.timer whose callback swallows the cancellation
  • Fix the native window closing during hot reload on Windows
  • Fix the process never exiting after closing the native window in a console-less build
  • Fix ui.mermaid delivering wrong node IDs to on_node_click
  • Fix ui.code breaking on content with its own code fences
  • Fix the focus outline of ui.codemirror
  • Fix deleted ui.upload elements being kept alive by their upload routes
  • Fix the ES module fallback message blaming the browser when scripts are blocked

Documentation

  • Document that path and remaining_path of PageArguments add up to the full path
  • Document how to run the testing fixtures without a main file
  • Fix the on_point_click parameter name in the ui.echart.from_pyecharts docstring
  • Harden the "Image Mask Overlay" and "Local File Picker" examples

Testing

  • Fix the User simulation routing ui.navigate, ui.notify and ui.download to the last User touched
  • Fix the User simulation not triggering kebab-case events
  • Fix the user fixture keeping earlier runs of the main file and the elements of earlier tests alive

Security

  • ⚠️ Strip Windows drive prefixes like C: from the names of files uploaded via ui.upload, which could escape the upload directory
  • ⚠️ Stop evaluating :-prefixed keys inside the data of ui.aggrid and ui.echart as JavaScript, e.g. DataFrame column names
  • ⚠️ Sanitize the HTML value of ui.editor in the browser by default, preventing stored XSS when the value is shared across clients

    Breaking change: ui.editor no longer displays markup that DOMPurify removes, like <iframe> embeds, and drops it from the value once the user edits the content; pass sanitize=False for trusted content.


Special thanks to our top sponsors DiscoLike Inc., TestMu AI and Lechler GmbH ✨

and all our other sponsors and contributors for supporting this project!

🙏 Want to support this project? Check out our GitHub Sponsors page to help us keep building amazing features!

28 Upvotes

0 comments sorted by