New features
- Added
session.destroy()andsession.on_destroy()for cleaning up reactive objects (effects, calcs, values) when dynamically inserted module UI is removed. Callingsession.destroy()on a module's session fires all registered destroy callbacks, which stop effects, invalidate calcs and values, and remove namespaced inputs and outputs from the reactive graph. Reactive objects automatically register weak destroy callbacks so they can be garbage collected when no longer referenced, even before session end. (#2209)
Improvements
-
@reactive.calc,@reactive.effect, and render decorators (e.g.@render.text) now raise aTypeErrorif the decorated function has required parameters, since Shiny never supplies arguments to these functions. Functions with default parameter values emit a warning, as the defaults will always be used. (Thanks, @mvanhorn!) (#2200) -
Output resize/visibility detection now uses native browser observers (
ResizeObserver,IntersectionObserver) instead of relying on jQueryshown/hiddenevents andwindow.resize. This makes Shiny's client-side output-info pipeline (image/plot sizing, hidden-state tracking, theme reporting) work automatically in any layout — including CSS-only show/hide, third-party tab components, and non-Bootstrap frameworks — without requiring custom event hooks. This also introduces ashiny:themechangeevent for code that needs to trigger theme clientdata refreshes after changing surrounding visual theme context. (rstudio/shiny#3682) -
panel_conditional()no longer briefly flashes its contents on app start when the condition is initiallyFalse. (rstudio/shiny#3505)
Bug fixes
-
Fixed server-side input deduplication so that all values received from the client always trigger reactive invalidation. (#1600, #2219)
-
Fixed a caret drift issue in
ui.input_code_editor()where the cursor would appear to the right of the actual text insertion point when certain themes or on some operating systems. (#2223) -
Fixed OpenTelemetry name inference for
reactive.Valueto handle type-annotated assignments (e.g.,counter: reactive.Value[int] = reactive.Value(0)), generic subscript calls (e.g.,reactive.Value[int](0)), and multiline assignments where theValue()call is on a continuation line. This fixes anonymous OTel labels for packages likeshinychatthat use multilinereactive.Valueassignments. (#2205)