Closed schloerke closed 11 months ago
@schloerke this should be handled by an internal webR API calling R code. I mocked up something for library()
/require()
c.f. https://github.com/r-wasm/webr/issues/280
I think (where possible) I would lean towards using the tools that already exist in renv
for discovering dependencies, rather than replicating the work in webR.
I am currently working on the next iteration of the webR package building process, and investigating Emscripten's FS.mount()
API. In principle I think it should be possible to pre-build a Wasm filesystem image containing an R library (defined by renv
, or a package list, or similar) ready to pre-load into the environment for a given shinylive/webR app.
This should have the additional benefit of being much quicker than downloading, decompressing, and writing many packages from the public package repo to the virtual disk.
r-shinylive seems like the wrong place to do this.
Seems like it needs to be run in the shinylive R process if the feature is enabled.
Bug fixed in https://github.com/posit-dev/shinylive/pull/68
Shinylive asset support updated in #21
Closing
If
renv::dependencies("path/to/app")
can be used to detect dependencies, then we can preload app dependencies for users.There should not be a requirement for users to call
webr::install("FOO")
to load a precompiledFOO
package.