Repository navigation
fix(deps): update dependency nicegui to v4 - #157
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
>=3,<4→>=4,<5Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
zauberzeug/nicegui (nicegui)
v4.0.0Compare Source
NiceGUI 4.0 is a major release focused on cleaning up: it removes the APIs deprecated during 3.x, corrects a few defaults and catches up on the bundled JavaScript libraries. Nothing changes as fundamentally as the auto-index page did in 3.0, so most apps should only need small adjustments. Some changes don't raise any error, though, so please read the migration guide before upgrading.
How to upgrade
sanitize=None, before the first run.New features and enhancements
__slots__on observable collections and dropping the bindable property registry (#6409, #6410, #6412, #6434 by @evnchn, @falkoschindler)ui.inputand related elements narrows tostr(#6421, #6435 by @falkoschindler, @evnchn, @emmanuelprecieuxargent)pagination_controlsparameter toui.tablethat controls the pagination bar independently ofpagination, so that assigningtable.paginationlater now shows the controls as well, and addon_pagination_changetoui.table.from_pandasandui.table.from_polars(#6235, #6275 by @evnchn, @SaadZahem, @falkoschindler)run.cpu_boundprocess pool, because "fork" is unsafe in a threaded process (#6117, #6419 by @falkoschindler, @evnchn)run.io_boundandrun.cpu_boundkeep working inapp.on_shutdownhandlers and stop them from swallowingtask.cancel()(#6420 by @falkoschindler, @evnchn)ui.plotly(#6327, #6441 by @falkoschindler, @evnchn)ckb,lb,sr-Cyrl,sqandur-PK(#6440 by @falkoschindler, @evnchn)Bugfixes
Object3DandLayerobjects created after anawaitfrom landing in another client's scene or map (#6345, #6361, #6401 by @evnchn, @falkoschindler, @wolfgang-aura)app.remove_route()andendpoint_documentationwith current FastAPI versions (#6373, #6416 by @falkoschindler, @evnchn, @Melvin0hd)run.cpu_bound, and stop keeping their classes alive (#6412, #6434 by @evnchn, @falkoschindler)ui.leafletadd its layers beforeawait map.initialized()returns, so that layer methods no longer returnNone(#6470 by @falkoschindler)Minimum requirements
matplotlibextra)httpxhttpx2httpxis no longer installed. Apps importing it have to declare it themselves or switch tohttpx2, which has the same API. The testing API now useshttpx2types:User(client: httpx2.AsyncClient), andUserDownload.http_responsesandUserDownload.next()hold or returnhttpx2.Response. In general, please declare every package you import instead of relying on what NiceGUI happens to pull in.pytz. Install it yourself or switch tozoneinfo.Behavior changes
These changes mostly don't raise an error, so your code won't tell you about them.
Old prop names are ignored (#6397 by @falkoschindler, @evnchn)
Snake_case and camelCase prop names are no longer migrated to kebab-case.
.props('html_columns=[0]'), for example, now sets a prop nobody reads, so the feature silently stops working and nothing warns about it anymore. Constructor arguments are not affected. Please search your code for the old names:All removed prop names
resource_pathresource-pathdynamic_resource_pathdynamic-resource-pathui.aggridhtml_columnshtml-columnsui.codemirrorhighlightWhitespacehighlight-whitespaceui.codemirrorlineWrappingline-wrappingui.colorsdark_pagedark-pageui.colorscustom_colorscustom-colorsui.echartenable_3denable-3dui.fullscreenrequireEscapeHoldrequire-escape-holdui.headeradd_scroll_paddingadd-scroll-paddingui.leafletdraw_controldraw-controlui.leaflethide_drawn_itemshide-drawn-itemsui.leafletadditional_resourcesadditional-resourcesui.markdownresource_nameresource-nameui.markdownuse_mermaiduse-mermaidui.scenebackground_colorbackground-colorui.sceneclick_eventsclick-eventsui.scenedrag_constraintsdrag-constraintsui.scene,ui.scene_viewcamera_paramscamera-paramsui.scene,ui.scene_viewcamera_typecamera-typeui.scene,ui.scene_viewshow_statsshow-statsui.scene_viewscene_idscene-idCleared text inputs hold
''instead ofNone(#6421, #6435 by @falkoschindler, @evnchn, @emmanuelprecieuxargent)This affects
ui.input,ui.textarea,ui.date_input,ui.time_inputandui.color_input. Replacevalue is Nonewithnot value, which works before and after. A model usingNoneas "empty" can keep it withinput.bind_value(model, 'x', forward=lambda v: v or None, backward=lambda v: v or '').ui.numberandui.selectkeepNone.run.cpu_bounduses "spawn" by default (#6117, #6419 by @falkoschindler, @evnchn)Workers start from a fresh import and don't inherit module globals. The function must be importable in the worker: functions defined under
if __name__ == '__main__':, viapython -c, stdin, a zipapp or a package's__main__.pynow fail withBrokenProcessPool, and the actual error only appears in the worker's log. To keep the old behavior on Linux, setrun.process_pool_start_method = 'fork'beforeui.run().run.io_boundandrun.cpu_boundraiseasyncio.CancelledErrorinstead of returningNone(#6420 by @falkoschindler, @evnchn)Code checking
if result is None:to detect a shutdown or cancellation has to catch the exception or let it propagate.Element IDs in the DOM change from
c12tong-12(#6375, #6378, #6395 by @falkoschindler, @evnchn)Replace hard-coded IDs in CSS, JavaScript or tests with
element.html_idorgetHtmlElement(element.id). Custom components stripping the prefix withid.slice(1)have to useparseHtmlId(id). The implicit browser globals likec12are gone, and the global ofui.scenefor Selenium tests is nowscene_<id>.Spot lights in
ui.scenedefault todecay=2.0(#6243, #6366, #6417 by @falkoschindler, @evnchn, @python-and-novella)They now fall off like in Three.js with 1/r² instead of 1/r, so at a distance of 5 units they are five times dimmer. Pass
decay=1.0to restore the old look, or increaseintensity.table.paginationshows the pagination controls (#6235, #6275 by @evnchn, @SaadZahem, @falkoschindler)This also applies to tables created without pagination, and
.props('hide-pagination')no longer survives a later assignment. Usepagination_controls=Falseinstead.Custom scene objects and map layers need a
withblock in handlers and timers (#6345, #6361, #6401 by @evnchn, @falkoschindler, @wolfgang-aura)Constructing a custom
Object3DorLayersubclass outside ofwith scene:used to find the last scene or map touched anywhere in the process. Now it raises aRuntimeError. The same applies toon_click=scene.box, which fetches the constructor early: useon_click=lambda: scene.box().Object3D.current_sceneandLayer.current_leafletare now private.Screen.should_not_containwaits for the text to disappear (#6432 by @falkoschindler, @evnchn)It used to fail immediately if the text was still shown, and then observed for 0.5 s. A check that something must not show up after an action now needs
duration=0.5to keep its strength. The parameterwaitis a deprecated alias forduration.Observable collections have no
__dict__(#6409, #6410 by @evnchn, @falkoschindler)vars()and setting arbitrary attributes fail onObservableDict,ObservableList,ObservableSetand onelement.props,classesandstyle. Subclasses without their own__slots__, likePersistentDict, are not affected.Bindings no longer poll bindable properties written past
BindableProperty.__set__(#6412, #6434 by @evnchn, @falkoschindler)This only concerns values set via
__dict__.update, a custom__copy__or a descriptor subclass that skipssuper().__set__. Regular assignments still propagate.WEB_CONCURRENCYabove 1 raises aValueError(#6467 by @falkoschindler)NiceGUI doesn't support multiple workers. With
reload=True, the default, uvicorn used to ignore the variable with a warning, and withreload=False, the app logged a message and exited. Please remove the variable from the environment of your app.ui.timercallbacks must not swallow the cancellation (#6470 by @falkoschindler)A callback catching
asyncio.CancelledErrorwithout re-raising it can delay the shutdown, which 3.19 tolerated.run.io_boundandrun.cpu_boundno longer do this themselves (#6420), so this only concerns your own code.Removed APIs
These fail with an error or are flagged by a type checker (#6397 by @falkoschindler, @evnchn):
sanitize=Noneinui.chat_messageandui.interactive_imageTrue(default),Falseor a callablenicegui.dataclasses.KWONLY_SLOTSkw_only=True, slots=Truecoroutine=...inbackground_tasks.create()andcreate_lazy()awaitable=...app.on_startup(startup())app.on_startup(startup)'checkboxRenderer'inui.aggrid'cellDataType': 'boolean'and'editable': Trueui.taboutside ofui.tabsRuntimeErrorValueChangeEventArgumentswithoutprevious_valueObject3Dsubclasses withoutcomponent=component=or use a built-in base classObject3Dinstantiated directly or with a type stringObject3D.typeandObject3D.datanicegui.elements.scene.scene_objectsnicegui.elements.scene.objectsui.sceneandui.scene_viewwidthandheightofui.sceneandsceneofui.scene_viewstay positional)ui.add_scssandui.add_sass, including the bundled Sass compilerui.add_css, as CSS supports nesting nativelyProps.add_rename(#6464, #6471 by @shi-felix, @falkoschindler)add_warningonly drops the key and warnsui.codemirror(language='Jinja2')still works, but is deprecated and logs a warning. Please uselanguage='Jinja'(#6467 by @falkoschindler).Bundled libraries
If you use these elements, or target their internals with custom CSS or JavaScript, please check the respective changes:
Quasar 2.18.5 → 2.35.2 (#6440 by @falkoschindler, @evnchn)
ui.menuandui.tooltipkeep their placement while scrolling and stay attached to their anchor.clicklistener onui.itemorui.chipimpliesclickable.1–2 of 3).AG Grid 34.2.0 → 36.2.0 (#6444 by @falkoschindler, @evnchn)
'ValidationModule'tomodulesto get them back, now also as an overlay on the grid.ag-body-viewport,ag-center-cols-container), and theme and RTL classes moved to a parent element, so custom CSS may need an update.fontWeighttheme parameter defaults to400. SetfontWeight: 'inherit'to inherit the page's font weight.content-visibility: autois no longer applied by default (enableContentVisibilityAutobrings it back)..ag-center-cols-containerno longer exists. Custom CSS or tests selecting rows through it have to use.ag-rowdirectly.plotly.js 3.1.1 → 4.2.0 (#6327, #6441, #6467 by @falkoschindler, @evnchn)
scattermapbox,choroplethmapboxanddensitymapboxtraces, themapboxsubplot andmapboxAccessTokenare removed. Use the*mapequivalents.rgb()with 0–1 fractions andhsv()strings are no longer accepted, and invalid CSS color strings are rejected.layout.geo.fitboundsdefaults to'locations', andscattermapanddensitymapauto-fitcenterandzoom.splom.axis.matchesdefaults totrue, overlaying axes default totickmode: 'sync', and the double-click delay increased from 300 to 500 ms.hoveranywhereandclickanywhereevents return actual data values forxvalsandyvals.ui.plotly({'data': ..., 'config': {'showSendToCloud': True}})brings it back.three.js r180 → r187 (#6443, #6467 by @falkoschindler, @evnchn)
scene.gltf()for most models, conserve energy better: rough materials look slightly brighter.matrixAutoUpdate = falseand writingmatrixdirectly must also setmatrixWorldNeedsUpdate = true.Object3Dhas its owndispose(), so custom subclasses with adispose()should callsuper.dispose().xterm.js 5.5.0 → 6.0.0 (#6445 by @falkoschindler, @evnchn)
{'fontFamily': 'courier-new, courier, monospace'}to restore the old look. As the line height may differ,fit()can yield a different number of rows..xterm-viewportor.xterm-scroll-areamay need an update.overviewRulerWidthmoved tooverviewRuler: {'width': ...}, andwindowsModeandfastScrollModifierwere removed.nipplejs 0.10.2 → 1.0.4 (#6446 by @falkoschindler, @evnchn)
ui.joystickis no longer rendered at half opacity. Pass a semi-transparent back color likecolor={'front': 'blue', 'back': 'rgba(0, 0, 255, 0.5)'}to restore the old look.maxNumberOfNippleswas renamed tomaxNumberOfJoysticks.moveevent data no longer containsidentifierbut gainsbaseDelta, and the rawstartandendevents now containdata.Dependencies
Update the remaining Python and JavaScript dependencies, including uvicorn 0.54, Starlette 1.10 and websockets 17 in the lock file (#6467 by @falkoschindler)
Other JavaScript dependencies
@tailwindcss/browser: 4.1.13 → 4.3.4
@unocss/reset and @unocss/runtime: 66.6.0 → 66.12.0
socket.io: 4.8.1 → 4.8.4
vue: 3.5.22 → 3.5.44
@codemirror/language-data: 6.5.1 → 6.5.2
@uiw/codemirror-themes-all: 4.25.2 → 4.25.12
@babel/runtime: 7.28.4 → 7.29.10
vanilla-jsoneditor: 3.10.0 → 3.13.0
mermaid: 11.16.1 → 11.17.2
d3-transition: 3.0.2 (new)
sass: 1.94.0 (removed)
Documentation
Testing
Screen.SCREENSHOT_PASSED_TESTSto skip screenshots of passed tests (#6432 by @falkoschindler, @evnchn)Screen.start_server()wait until the server accepts connections (#6398 by @falkoschindler, @evnchn)Infrastructure
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!
v3.19.0Compare Source
Security
C:from the names of files uploaded viaui.upload, which could escape the upload directory (GHSA-75w7-4mx9-8qqc by @iaohkut, @evnchn, @falkoschindler):-prefixed keys inside the data ofui.aggridandui.echartas JavaScript, e.g. DataFrame column names (GHSA-m47w-xwfc-82pf by @iaohkut, @unbengable12, @SaaSforUS, @evnchn, @falkoschindler)ui.editorin the browser by default, preventing stored XSS when the value is shared across clients (GHSA-9g7v-h3pr-4qm8 by @evnchn, @falkoschindler)Breaking change:
ui.editorno longer displays markup that DOMPurify removes, like<iframe>embeds, and drops it from the value once the user edits the content; passsanitize=Falsefor trusted content.New features and enhancements
ui.uplotfor fast canvas charts of large or high-frequency datasets (#2669, #3340, #5917 by @CSharpDummy, @tungchentsai, @NvNielen, @Noghpu, @evnchn, @falkoschindler)Plane,Cone,Torus,Capsule,LatheandPolylineobjects, apolar_gridparameter androtate(order=...)toui.scene(#5989 by @Jepson2k, @evnchn, @falkoschindler)nicegui.json.register_type()to serialize custom types (#6406 by @KotzaBoss, @falkoschindler)Bugfixes
Fix
ui.sub_pageswithroot_pathnot leaving the page on links outside its root (#6385, #6400 by @techmatik, @inchang-ing, @evnchn, @falkoschindler)Fix
ui.sub_pagesnot converting parameters annotated asint | Noneor in modules withfrom __future__ import annotations(#6452, #6454 by @Dengzi555, @evnchn, @falkoschindler)Fix
Client.page_routes,ui.linkandui.navigate.toignoring the prefixes of included routers (#6418, #6423 by @falkoschindler, @shi-felix, @evnchn)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 ofapp.clients('/p/x').Fix
ui.sceneandui.leafletnever initializing when created hidden (#6414, #6424 by @falkoschindler, @shi-felix, @evnchn)Fix
ui.leafletgoing blank after its classes change, e.g. when hiding and showing the map (#6428, #6433 by @evnchn, @falkoschindler)Raise a
RuntimeErrorfrominitialized()ofui.scenewhen WebGL is unavailable instead of waiting forever (#6405 by @evnchn, @falkoschindler)Fix slow style recalculation on pages with many sibling elements, a regression in 3.10 (#6411, #6426 by @phreakocious, @Ayush-kukrety, @evnchn, @falkoschindler)
Fix template slots being remounted on every render, which swallowed the first click on removable chips of a
ui.select(#6284, #6287 by @samuller, @SaadZahem, @evnchn, @falkoschindler)Fix
ui.highchartfailing when the first chart is created in an event handler (#6290, #6391 by @evnchn, @SaadZahem, @falkoschindler)Fix an outdated async
validationresult overwriting the error state of the current input (#6453, #6455 by @Wang-MuFF, @falkoschindler)Fix deep-copied observable collections notifying their original parent (#6448, #6449 by @Yzzz88, @falkoschindler)
Fix
ElementFilter.exclude()ignoring markers with multiple names (#6456 by @Dengzi555, @falkoschindler)Fix the typing of
bindable_dataclasswhen called with arguments likebindable_fields(#6251, #6252 by @FranzForstmayr, @evnchn, @falkoschindler)Fix
ui.timercancelling@await_on_shutdowncallbacks on shutdown (#6331, #6372 by @evnchn, @Kshot3000, @falkoschindler)Fix shutdown waiting for a
ui.timerwhose callback swallows the cancellation (#6436, #6442 by @phreakocious, @evnchn, @falkoschindler)Fix the native window closing during hot reload on Windows (#6381, #6407 by @abi55, @evnchn, @falkoschindler)
Fix the process never exiting after closing the native window in a console-less build (#6392, #6396 by @SHDocter, @Boulea7, @evnchn, @falkoschindler)
Fix
ui.mermaiddelivering wrong node IDs toon_node_click(#6220 by @evnchn, @falkoschindler)Fix
ui.codebreaking on content with its own code fences (#6404 by @zurrll, @falkoschindler)Fix the focus outline of
ui.codemirror(#6429 by @falkoschindler, @evnchn)Fix deleted
ui.uploadelements being kept alivConfiguration
📅 Schedule: (in timezone Europe/Berlin)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.