Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sketch dryRun() implementation#833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hadley wants to merge8 commits intomain
base:main
Choose a base branch
Loading
fromdryRun
Open

Sketch dryRun() implementation#833

hadley wants to merge8 commits intomainfromdryRun

Conversation

@hadley
Copy link
Member

@hadleyhadley commentedMay 3, 2023
edited
Loading

Tofix#725.

Fixes#208.Fixes#253.Fixes#256.

@hadleyhadley marked this pull request as ready for reviewMay 8, 2023 16:00
@hadleyhadley requested review fromaronatkins andkevinushey and removed request foraronatkinsMay 8, 2023 16:00
@hadley
Copy link
MemberAuthor

@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.

@hadleyhadley requested a review fromaronatkinsMay 8, 2023 16:42
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' `dryRun()` runs your app locally, attempting to simulate what will happen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

nit: s/app/content/

appRunner <- function(appMode) {
switch(appMode,
"rmd-static" = ,
"rmd-shiny" = function(primaryDoc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

rmd-shiny should usermarkdown::run(file = NULL, dir = getwd())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

When the R Markdown content is a site:rmarkdown::render_site(envir = new.env())

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I already set the working directory above, but I'll take the other changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I just meant thedir argument

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

OK. Once you givefile = NULL, thedir value is necessary, as its default value ofdirname(file) is meaningless.

rmarkdown::render(primaryDoc, quiet = TRUE)
},
"quarto-static" = ,
"quarto-shiny" = function(primaryDoc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

quarto-shiny should:

  1. render with Quarto
  2. usermarkdown::run(file = NULL, dir = getwd())

"api" = function(primaryDoc) {
plumber::pr_run(plumber::pr("plumber.R"))
},
cli::cli_abort("Content type {appMode} not currently supported")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Rendered content and "static" -- we could start an HTML server against thebundleDir 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 thatevery 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.
#'
Copy link

@andpattandpattMay 10, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@aronatkinsaronatkinsaronatkins approved these changes

@kevinusheykevinusheyAwaiting requested review from kevinushey

+1 more reviewer

@andpattandpattandpatt left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

4 participants

@hadley@aronatkins@andpatt

[8]ページ先頭

©2009-2025 Movatter.jp