-
Notifications
You must be signed in to change notification settings - Fork 18
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SHINYLIVE_WASM_PACKAGES
environment variable
#116
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,11 +253,22 @@ build_app_resources <- function(app_json) { | |
} | ||
}) | ||
|
||
# Download wasm binaries ready to embed into Quarto deps | ||
withr::with_options( | ||
list(shinylive.quiet = TRUE), | ||
download_wasm_packages(appdir, destdir, package_cache = TRUE, max_filesize = NULL) | ||
) | ||
wasm_packages_val <- sys_env_wasm_packages() | ||
wasm_packages <- as.logical(wasm_packages_val) | ||
if (is.na(wasm_packages)) { | ||
cli::cli_abort(c( | ||
"x" = "Could not parse `wasm_packages` value: {.code {wasm_packages_val}}" | ||
)) | ||
wasm_packages <- SHINYLIVE_WASM_PACKAGES | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth putting this in a helper function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I realised we're only really expecting to see an |
||
|
||
if (wasm_packages) { | ||
# Download wasm binaries ready to embed into Quarto deps | ||
withr::with_options( | ||
list(shinylive.quiet = TRUE), | ||
download_wasm_packages(appdir, destdir, package_cache = TRUE, max_filesize = NULL) | ||
) | ||
} | ||
|
||
# Enumerate R package Wasm binaries and prepare the VFS images as html deps | ||
webr_dir <- fs::path(destdir, "shinylive", "webr") | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's annoying, but I think we should allow literally
"true"
or"false"
, or the whole range ofTRUE
,"TRUE"
,"true"
,"1"
and1
and false variants. (Basically, `tolower(val) %in% c("true", "1").)I would read this expecting I could set
SHINYLIVE_WASM_PACKAGES=TRUE
in.Renviron
, but IIRC that will end up being"TRUE"
when set.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be handled OK by:
Because "1" will be caught by the
switch
, and then"TRUE"
/"true"
will be caught by theas.logical()
.Saying that, I might change it just to make things clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice, that makes sense. I just missed that
as.logical()
line