Skip to content

Commit

Permalink
Merge pull request #137 from posit-dev/feat/client-dev-mode
Browse files Browse the repository at this point in the history
feat: enable client-side dev mode features in R
  • Loading branch information
wch authored May 30, 2024
2 parents 70f4b47 + 47cc367 commit f4eb380
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Components/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export function Viewer({
env: { files, appDir },
captureStreams: false,
});
await webRProxy.runRAsync(".start_app(appName, appDir)", {
env: { appName, appDir },
await webRProxy.runRAsync(".start_app(appName, appDir, devMode)", {
env: { appName, appDir, devMode },
captureConditions: false,
captureStreams: false,
});
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/useWebR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ webr::shim_install()
lapply(rownames(installed.packages()), function(p) { .webr_pkg_cache[[p]] <<- TRUE })
}
.start_app <- function(appName, appDir) {
.start_app <- function(appName, appDir, devMode = FALSE) {
# Mount VFS images provided in Shinylive app assets
.mount_vfs_images()
Expand All @@ -312,6 +312,11 @@ webr::shim_install()
}
})
if (isTRUE(devMode)) {
# Enable client-side dev mode features, namely the error console
options(shiny.client_devmode = TRUE)
}
app <- .shiny_to_httpuv(appDir)
assign(appName, app, envir = .shiny_app_registry)
invisible(0)
Expand Down

0 comments on commit f4eb380

Please sign in to comment.