Closed JosiahParry closed 5 months ago
Indeed, I almost exclusively use dependencies = NA
. We can definitely add a note to the rwasm
docs along these lines.
It may also be worthwhile having the default be dependencies = NA
. It was really confusing when I compiled my package and added it to my own little repo. Then when I tried to call it from https://webr.r-wasm.org/latest/ it said I needed vctrs
which was surprising! But perhaps that's exactly how the CRAN-like repo structure works
See https://github.com/r-wasm/actions/issues/15 for a longer discussion about why dependencies = FALSE
is the default. The short version is that, in principle, we would like to mask the CRAN/r-wasm version of packages as little as possible.
The idea would be that by building only the minimal packages by default, we could lookup packages in both our repository alongside the default webR repo when installing packages, e.g.
install.packages("myfancypackage", c("https://myrepo.github.io/", "https://repo.r-wasm.org"))
You can then chain together packages from custom repos, r-universe, r-wasm.org etc. This reduces the number of packages required to be built and distributed for a given custom Wasm R package.
Installing a package with
rwasm::add_pkg()
will install only that package and not its dependencies. One can usedependencies = TRUE
but then this installs all soft recursive dependencies. I understand that the doc points topkgdepends::as_pkg_dependencies()
but that is almost like reading a novel.I think the argument doc can be enhances to make this easier to pick up e.g.
Example of the difference in dependencies when installing {vctrs}.
packages are still installing now while writing this! 😅