Repository navigation
Conversation
✅ Deploy Preview for shinywidgets canceled.
|
cpsievert
force-pushed
the
docs-accessors-experimental
branch
from
November 23, 2026 23:22
6512cd9 to
9b988e5
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for this documentation-only update clarifying experimental accessors and cached-widget lifetimes.
No open issues 🎉
What changed in this PR
This documentation-only PR marks shinywidgets’ reactive accessor API as experimental and clarifies the breaking change affecting widgets cached by @reactive.calc. It keeps website guidance and bundled agent references aligned; runtime behavior is unchanged.
Changes:
- Adds a consistent experimental notice covering accessor names, return shapes, and opt-in defaults.
- Documents why cached widgets can be closed between renders and how
session_lifetime()prevents this. - Reclassifies the cached-widget ownership error as a breaking change in the changelog.
| File | Description |
|---|---|
website/guide/updating-in-place/index.md |
Explains the cached-widget lifetime trap and remedy. |
website/guide/reacting-to-widgets/index.md |
Adds the experimental accessor notice. |
shinywidgets/.agents/skills/shinywidgets/references/updating-in-place.md |
Mirrors the lifetime guidance for agents. |
shinywidgets/.agents/skills/shinywidgets/references/reacting-to-widgets.md |
Mirrors the experimental accessor notice. |
CHANGELOG.md |
Marks accessors experimental and documents the cached-widget breaking change. |
Review effort: Balanced
cpsievert
force-pushed
the
docs-accessors-experimental
branch
from
November 23, 2026 23:30
9b988e5 to
3288b44
Compare
cpsievert
force-pushed
the
docs-accessors-experimental
branch
from
November 30, 2026 18:06
4cf353c to
dac452b
Compare
…e regression The accessor API (41 render_* decorators, 83 accessor methods, listen_to, rate_policy/rate_delay) ships in the next release with names and shapes that were still being renamed weeks before cut. Mark it experimental in the two places a user or agent actually encounters it -- the accessors guide article and its matching skill reference -- rather than all 41 renderer docstrings. Also reclassify the "returning a closed widget now raises" bug fix: for a widget built by a @reactive.calc and returned by a render with its own independent invalidation trigger, this is a visible breaking change from 0.8.2, not just a bug fix. Add a Breaking changes entry with the fix (construct the widget inside `with session_lifetime():`), verified against the actual render/invalidate cycle, and note the same trap in the widget-lifetimes guide and its skill reference.
The breaking-change entry, skill reference, and guide paragraph all implied a second render returns the calc's cached widget. It's actually the same render re-running: its own re-run closes the widgets it built last time (including the one the calc cached), so the calc hands back an already-closed widget on the next call. Rewrite all three to describe that accurately.
cpsievert
force-pushed
the
docs-accessors-experimental
branch
from
November 30, 2026 18:32
dac452b to
72ad017
Compare
This branch was previously deployed
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.
Why
The next release adds a very large public surface in one step: 41
render_*decorators and 83 reactive accessor methods across them (clicked(),selected(),view_state(), ...), plus.read(name),listen_to=, andrate_policy/rate_delay. The accessor names were renamed three times in the weeks before this, and which accessors are opt-in is still being adjusted. Once this ships without a caveat, every name, return shape, and default becomes a compatibility promise. This PR marks the accessor API experimental (docs only -- no runtime warnings, no behavior change) so the next rename doesn't need a deprecation cycle.It also reclassifies one Unreleased changelog item: returning a
@reactive.calc-cached widget from a render that re-runs for a reason the calc doesn't share used to display a (possibly stale) widget on 0.8.2; onmainit now raises a clear ownership error. That's a visible breaking change for a real pattern, not just a bug fix, so it gets its own Breaking changes entry with the fix.Where the experimental notice appears
Same wording everywhere: "Experimental: accessor names, return shapes, and which accessors are opt-in may change in a future release without a deprecation cycle."
CHANGELOG.md, as its own paragraph under the existing "Rendered outputs gain reactive accessors" bullet (didn't touch that bullet's own lines, since other PRs are concurrently editing its plotly sentences)website/guide/reacting-to-widgets/index.md-- the guide's intro, which every widget page's "Reacting to user interaction" section and the cheat sheet point back toshinywidgets/.agents/skills/shinywidgets/references/reacting-to-widgets.md-- the matching skill reference, same spotCandidates considered and skipped:
SKILL.md's index table (kept index-only, matching the existingshared_lifetime()precedent, whose experimental marker also lives only in the reference body) and the 41 renderer docstrings inshinywidgets/_render_widget.py(each hand-repeats a "Responding to user interaction" paragraph; adding a sentence there means touching all 41). I also built the site and confirmedrender_widget_base's andread()'s docstrings don't reach the generated per-renderer reference pages (quartodoc only lists eachrender_*subclass's own methods), so they wouldn't have helped either.New breaking-change entry
The existing bug-fix sub-bullet ("Returning a widget closed by an earlier render raises a similar error") now cross-references this instead of duplicating it. The same mechanism (and trap) is also spelled out in
website/guide/updating-in-place/index.md's Lifetimes section and its matching skill reference, with the exact error text.I verified the
session_lifetime()fix directly with a scratch test modeled ontests/unit/test_widget_lifetimes.py: a renderer returning a plain cached widget raises pointing atsession_lifetimeonce its first render is invalidated (reproducing the regression), and wrapping that same cached construction inwith session_lifetime():lets the renderer re-render successfully across four invalidate/re-render cycles, each returning the samemodel_id.Branch name note
Asked-for name
docs/accessors-experimentalcollided with an existing flat branch nameddocsonorigin(git can't have both a ref filedocsand a ref directorydocs/). Useddocs-accessors-experimentalinstead, matching the flat-hyphenated convention other concurrent branches on this repo are already using for the same reason.Verification
uv run pytest tests/unit/test_agent_skill.py-- 284 passed, 4 skipped (optional deps not installed)uv run python website/_tools/check_docs.py-- no output (clean)make check-format-- cleanmake docs-- built successfully; confirmed the experimental notice and the lifetimes trap note render correctlymake check-typeswasn't required