Shiny_prerendered, page reload, events

shiny

#1

Hi, I’m porting quite a large document from shiny runtime to shiny_prerendred. Performance is much better but I found one problem. At the first load of the document everything is perfect, but it behaves differently after page reload.

I created a small rmd to repeat the problem.

After page reload the following section is never executed, the behavior is not context related, because it performs the same in render context.

```{r context='server', echo =FALSE}
     observeEvent(input$do, {
     cnt <<- cnt +1
      output$tcnt <- renderText(cnt)
   })
``` 

https://gist.github.com/janezj/fbe24aa93559f73bf5f76d8ceab61b6c

---
title: "test observe after reload"
runtime: shiny_prerendered
output: 
  html_document
---

```{r setup, include=FALSE}
library(shiny)
cnt <- 0
```
```{r context='render', echo=FALSE}
 actionButton("do", "Click Me")
```
```{r context='render', echo=FALSE}
div(textOutput('tcnt'))
```
```{r context='server', echo=FALSE}
 observeEvent(input$do, {
   cnt <<- cnt +1
   output$tcnt <- renderText(cnt)
 })
```