Skip to content

Commit 2594909

Browse files
committed
Fix 224-shinymeta: add explicit varname to metaReactive calls
shinymeta's auto-detection of variable names via source references (mrexprSrcrefToLabel) crashes with shiny >= 1.13.0.9000 due to changed source reference behavior in callModule(). The while loop in mrexprSrcrefToLabel can decrement firstLineIdx to 0, causing lines[0] to return character(0) which crashes the grepl() check. Adding explicit varname parameters bypasses the broken auto-detection.
1 parent 1ff9c0d commit 2594909

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • inst/apps/224-shinymeta

inst/apps/224-shinymeta/app.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ selectColumn <- function(input, output, session, df) {
2626
..(df()) %>%
2727
dplyr::pull(!!..(input$col))
2828
})
29-
})
29+
}, varname = "values")
3030

3131
avg <- metaReactive({
3232
..(values()) %>%
3333
mean() %>%
3434
round(1)
35-
})
35+
}, varname = "avg")
3636

3737
output$average <- metaRender(renderText, {
3838
paste("Average of", ..(as.character(input$col)), "is", ..(avg()))
@@ -59,15 +59,15 @@ server <- function(input, output, session) {
5959
# include shinyjster_server call at top of server definition
6060
shinyjster::shinyjster_server(input, output)
6161

62-
dataset <- metaReactive({mtcars})
62+
dataset <- metaReactive({mtcars}, varname = "dataset")
6363

6464
x <- callModule(selectColumn, "x", dataset)
6565
y <- callModule(selectColumn, "y", dataset)
6666

6767
df_plot <- metaReactive({
6868
"# Combine x and y into data frame for plotting"
6969
data.frame(x = ..(x$values()), y = ..(y$values()))
70-
})
70+
}, varname = "df_plot")
7171

7272
output$plot <- metaRender(renderPlot, {
7373
plot(..(df_plot()))

0 commit comments

Comments
 (0)