posit-dev / posit-dev/shinyreact

Safeguard `reactive_output` against use outside the `ui.tsx` pattern

Open
#149 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
14
Forks
3
Avg merge
9h 12m
Merged PRs (30d)
74

Description

shinyreact.reactive_output is designed to deliver values to useShinyOutputValue() hooks inside a ui.tsx app configured with set_react_page(). If used in a standard Shiny app (with ui.output_text() or other server-rendered UI elements), it silently sends a JSON payload that no client-side binding consumes. Add a runtime check (or a session-level marker set by set_react_page()) so reactive_output errors clearly when used outside the ui.tsx context.

Filed from the retired docs/todos.md.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace reactive_output, set_react_page(), and useShinyOutputValue() to understand how the ui.tsx context is marked and how standard Shiny outputs differ. Add a runtime error for reactive_output outside that context, then verify that ui.output_text() usage receives the clear error while configured ui.tsx usage still delivers values.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.