Skip to content
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

Load R package binaries from relative URL #121

Merged
merged 12 commits into from
Apr 18, 2024

Conversation

georgestagg
Copy link
Collaborator

@georgestagg georgestagg commented Mar 26, 2024

Includes #82.

Required as part of posit-dev/r-shinylive#63.

Adds the virtual VFS path /shinylive/webr/packages to the .libPaths() and attempts to mount Wasm R package binaries there using webR's webr::mount() API with a relative URL.

If no R package binary image exists at the URL, it will fallback to the current behaviour: using the default webR package repository with webr::install().


In the end, the following directories are in the search path, in order of preference:

  • /usr/lib/R/library - Base R packages, and packages explicitly downloaded from a Wasm package repository.
  • /shinylive/webr/packages - Packages bundled with the app, as decided by r-shinylive at build time.
  • /shinylive/library - Packages bundled with Shinylive.

Keeping these libraries separated allows for masking in the case where custom/newer/development versions of packages are required by a Shinylive app.

@georgestagg georgestagg force-pushed the relative-package-binaries branch 3 times, most recently from f839217 to 4a63e63 Compare March 26, 2024 14:00
This might be revisited later, but to simplify deployment from a Quarto
document we'll load `metadata.rds` from URL, rather than embedding it in
`app.json`.
@georgestagg georgestagg marked this pull request as ready for review April 9, 2024 15:15
src/hooks/useWebR.tsx Outdated Show resolved Hide resolved
src/hooks/useWebR.tsx Outdated Show resolved Hide resolved
@georgestagg georgestagg merged commit 182fdec into posit-dev:main Apr 18, 2024
2 checks passed
@georgestagg georgestagg deleted the relative-package-binaries branch April 18, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants