Conversation
|
@aronatkins @kevinushey I still need to think up a testing strategy, but I think the overall strategy is feeling pretty solid and it'd be useful to get your thoughts. |
| #' @description | ||
| #' `r lifecycle::badge("experimental")` | ||
| #' | ||
| #' `dryRun()` runs your app locally, attempting to simulate what will happen |
| appRunner <- function(appMode) { | ||
| switch(appMode, | ||
| "rmd-static" = , | ||
| "rmd-shiny" = function(primaryDoc) { |
There was a problem hiding this comment.
rmd-shiny should use rmarkdown::run(file = NULL, dir = getwd())
There was a problem hiding this comment.
When the R Markdown content is a site: rmarkdown::render_site(envir = new.env())
There was a problem hiding this comment.
I already set the working directory above, but I'll take the other changes.
There was a problem hiding this comment.
The ::run(..) signature is necessary to have R Markdown do its "run the whole directory" magic.. it's not setting the working directory. I think that's this logic: https://github.com/rstudio/rmarkdown/blob/main/R/shiny.R#L83-L107
There was a problem hiding this comment.
I just meant the dir argument
There was a problem hiding this comment.
OK. Once you give file = NULL, the dir value is necessary, as its default value of dirname(file) is meaningless.
| rmarkdown::render(primaryDoc, quiet = TRUE) | ||
| }, | ||
| "quarto-static" = , | ||
| "quarto-shiny" = function(primaryDoc) { |
There was a problem hiding this comment.
quarto-shiny should:
- render with Quarto
- use
rmarkdown::run(file = NULL, dir = getwd())
| "api" = function(primaryDoc) { | ||
| plumber::pr_run(plumber::pr("plumber.R")) | ||
| }, | ||
| cli::cli_abort("Content type {appMode} not currently supported") |
There was a problem hiding this comment.
Rendered content and "static" -- we could start an HTML server against the bundleDir so they could see exactly what files they are about to deploy. Maybe that would help cases where folks forget to include some images/CSS.
The result of this would be that every content type starts some type of HTTP server that they would interact with for validation.
| #' Both of these will work locally but fail on the server. [lint()] | ||
| #' uses an alternative technique (static analysis) to detect many of these | ||
| #' cases. | ||
| #' |
There was a problem hiding this comment.
Another limitation is that:
dryRun()doesn't help if the server does not have required system dependencies that are present
on the machine on which you're running this dryRun().
Maybe a bit nuanced to mention?
To fix #725.
Fixes #208. Fixes #253. Fixes #256.