Closed georgestagg closed 3 months ago
Note: I think the "integration" test fails because /local/quarto
also includes a python Shinylive app, and the Shinylive assets from posit-dev/shinylive@main
are not yet compatible with the posit-dev/py-shinylive
repo.
From what I can tell, it looks like the file repodata.json
was renamed to pyodide-lock.json
in a Pyodide update, but repodata.json
is still referenced by the python CLI interface. Once that's been updated in posit-dev/py-shinylive
, hopefully the test should pass.
@georgestagg Thanks for pointing out the issue with repodata.json
being renamed to pyodide-lock.json
. This is a good reminder of why we can’t just have the r-shinylive or py-shinylive packages deploy arbitrary versions of the shinylive assets.
Fixes #65
A first-pass implementation of #63.
Exports shinylive apps with Wasm R binary packages downloaded and included in
.../shinylive/webr/packages
. Metadata is stored in.../shinylive/webr/packages/metadata.rds
and loaded at runtime.For
shinylive::export()
, you can disable Wasm package bundling withwasm_packages = FALSE
. And disable using the cache withpackage_cache = FALSE
. Both areTRUE
by default, meaning Wasm packages will be downloaded and bundled.For Quarto documents with embedded R Shinylive apps,
quarto_ext.R
is updated so thatapp.json
bundles passed to theshinylive
R package are decoded onto disk, and then R Wasm binaries are downloaded using the same tools as created forshinylive::export()
. Finally the resulting list of binaries are passed back to Quarto as HTML dependencies.Metadata is merged over subsequent runs since (in e.g. Quarto docs) we can have multiple
app.json
bundles, and we want all referenced packages to be available in the static assets.Recursive dependencies are resolved using the
pkgdepends
package. This can get slow for large local package libraries (My R library has all of CRAN installed, for unrelated reasons, and so it takes a few seconds to resolve). We might want to think about how we could make use ofr-lib/pkgcache
in future. This should be "fine" for the moment, though.Note: Requires the
shinylive
assets bundle from https://github.com/posit-dev/shinylive/pull/121