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

Is manual bundling of packages possible? #66

Closed
maek-ies opened this issue Mar 22, 2024 · 2 comments
Closed

Is manual bundling of packages possible? #66

maek-ies opened this issue Mar 22, 2024 · 2 comments

Comments

@maek-ies
Copy link

dear George, dear Barret,

you are doing god's work with this package, thank you!

I know that making easy bundling possible is already in the pipeline (related issues #63, #27). My question is whether it is by any chance already possible to achieve that manually e.g. by manually copying the .data and .metadata to a certain subfolder (e.g. \shinylive\webr\vfs\usr) and then maybe just adjusting some additional lines of the existing code. Being able to freeze the deployed shinylive app in a static website without a need to download additional packages from the repo already would be fantastic. Sorry for being impatient, if this is not straightforward/possible currently, feel free to outright just close the issue, I will wait for the feature to be available.

@georgestagg
Copy link
Collaborator

georgestagg commented Mar 22, 2024

Hi,

Indeed, we're planning on adding this soon to make it easy to bundle fixed package binaries with an app.

It is currently possible but requires a little extra work. You should be able to upload the .data and .metadata package files to static hosting in a directory relative to your app, then mount them into a new package library directory on the webR virtual filesystem using the webr::mount() function (docs).

Once the packages have been mounted, you'll need to add the virtual directory to your library path using .libPaths().

The resulting code would look something like this:

webr::mount("/custom_library/cli", "https://repo.r-wasm.org/bin/emscripten/contrib/4.3/cli_3.6.2.data")
.libPaths(c("/custom_library", .libPaths()))
library(cli)

Since this is not quite ready to be officially supported yet, and is largely the same as #27, we'll close this issue as a duplicate.

@maek-ies
Copy link
Author

Thanks a lot for clarification, George!

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

No branches or pull requests

3 participants