Asynchronously (in a separate iteration of the JS event loop) to prevent Shiny from automatically binding inputs / outputs (closes #46).
Only once Shiny is fully initialized to remove the need for ShinyProxy, our previous workaround for Shiny's delayed initialization.
Remove the now unnecessary ShinyProxy.
Apply ShinyBindingWrapper to shiny::actionButton() and shiny.react::reactOutput() so they work in any React context (closes #21). This defect was uncovered by the rendering changes and caused issues with shiny.fluent showcase dashboard and E2E tests, so I decided to fix it in the same PR.
Refactor the code around ShinyBindingWrapper.
How to test
The shiny.fluent CI should pass with shiny.react installed from this branch (R CMD check, E2E test).
The code example from #21 should now work.
The snippets below should now work.
Unwanted bindings
The following snippet should now output character(0) to the R console, indicating that an <input> rendered by React is not bound regardless of the context. It used to output c("static", "render-ui"):
The added binding wrapper causes a difference in layout (the button and link now appear on separate lines; they used to be on one line). We already have that problem with other inputs/outputs (#52); I have a fix which I will submit at a later time.
Changes
ShinyProxy
, our previous workaround for Shiny's delayed initialization.ShinyProxy
.ShinyBindingWrapper
toshiny::actionButton()
andshiny.react::reactOutput()
so they work in any React context (closes #21). This defect was uncovered by the rendering changes and caused issues with shiny.fluent showcase dashboard and E2E tests, so I decided to fix it in the same PR.ShinyBindingWrapper
.How to test
Unwanted bindings
The following snippet should now output
character(0)
to the R console, indicating that an<input>
rendered by React is not bound regardless of the context. It used to outputc("static", "render-ui")
:Nested
reactOutput()
The following snippet should now render
Yay!
(it used to render nothing):Action buttons in React context
The button and link should log to R console (they used to do nothing):
The added binding wrapper causes a difference in layout (the button and link now appear on separate lines; they used to be on one line). We already have that problem with other inputs/outputs (#52); I have a fix which I will submit at a later time.