rstudio / shinymeta

Record and expose Shiny app logic using metaprogramming

Home Page:https://rstudio.github.io/shinymeta

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notes on debugging inside metaExpr

rpodcast opened this issue · comments

One of my preferred debugging techniques in a problematic reactive is to insert browser() in the relevant construct. Looking at the modules example app in PR #59 I tried this out:

values <- metaReactive2({
    req(input$col)
    bb <- metaExpr({
      browser()
      ..(df()) %>%
        dplyr::pull(!!..(input$col))
    })
  })

If I assign the complete chain above to an object, everything works perfect. But if I try assigning ..(df()) to an object, I get an error about not finding function ... Of course I can simply use df() instead, but it might help to talk about the nuances of using or not using ..() when debugging the app.

Great point, and yea, I plan on documenting this somewhere. I think the only real option is to wrap the code that you want to inspect with metaExpr()

@rpodcast there's now some notes on this in ?.., happy to consider any ideas for improving on what we have

Just installed the latest version and the help on .. is looking great. My only other thought is that this issue may merit discussion in one of the vignettes, and not just here in the operator doc.

If I encounter more edge cases besides the debugging pitfalls I'll add new issue(s).