insightsengineering / insightsengineering/roxy.shinylive
[Feature Request]: Decouple `roxy.shinylive` from `shinylive.io`
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### Feature description
The current logic of `roxy.shinylive` is to generate the app link with the code hash and embed the iframe link of the `shinylive.io` website with this code.
The problem with this logic is that we are heavily dependent with the deployed `shinylive.io` website rather than the `shinylive` R package which is the main package responsible for generating the HTML/CSS/JS assets to create the shinylive bundle. Additionally, there are some quirks/risks of using the `shinylive.io` website:
1. The maintainers might change the domain. Or perhaps an internal pkgdown website might not have access to the `shinylive.io` domain.
2. A change in hashing logic for the `shinylive.io` will break the pkgdown sites.
3. Currently, using the packages from the `r-universe` in `shinylive.io` is tricky. It has an auto-detect logic to force install R packages that are detected in the code and we'd have to manually unmount and install the package from `r-universe` for it to work. ([Example](https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMASzLgCcoDTqA3OAAgB4BaDgMwCuEZtRIAKAJQcAKlgCqAUQA6EWgGdSUADbaA+v3pEYe+nFRFufISJYTUTANZQA5nHW4OZi9JCqOHOpoqNoAnuIOBM5uHgLCovaOLtIA7nAARvSIiMIwRMKkEVCacAAM4spgAPSC6vRV2tTpVVgNTYz0oVWVnqhJkgP+HGmZ2RpauhUQAQGR0e64QwHeROocALwcBOIrnpUAFqSkqOqIVVUrGPQ8KcUwGET0LpWSQ6-THNrBYUVRrgufdpQTqeAj7YFMcj0B4QMIbWQKRTvAC+qjm-zWvC2UwClXIOgw2iILjc9B6HDxcAJxAAJnByZSCTSoFoGWB8doMClqDS3KR1AyPozOepGgR6XgKeyqZyVvQoWyOZVVO9xjp9IZjKZzERfvNYit4QcjiczlVUOD6DAoOx6Oo4FceMI2Ax7Rg6axumB3qpGplgeEOT7oOgrBxaNRCkNmVp4Ry9DGoOIAJJYZMAZXh1Ho1FiAFkZABhACCWEzmxgpAIwPUkkWHzyNME2nc8MbzfcOJmcAAHrAQnA9O2WxUwHmiE2WxwAIwveszDi9-stocTjuj8eTzgAJjnS0XfZgA9XW43a6nAGYXm95wJqNooXGZXpRdRxeouwF46-xeJE9B4CNMBUwzclWGBADOE2Sp01QOACGodxyXtFtmDgGkgPtUhViga8PneaQAB8AD4hkbah+FCPR9ipOl6HEfYL1HAA5OAUg4GioDol4iNIhsJwoqj+CIIgoQiFi2IEESFW9YMKI4cRaChSEXSkXwhnUfZaFCYt0HEYIABJBGoTxDPtehbRRVQwGRABdIA))
An alternative way to use this feature would be to use the `shinylive::export` to create the bundle assets this way:
1. A single pkgdown site typically needs the same R package dependencies, so the asset files related to the webR and R package dependencies that are generated using the `shinylive::export` can be just created once. And, it is possible to install `r-universe` packages here.
2. And we will just need the `app.json` file generated for each example app code.
I have not explored this a lot. But, I hope there is a way to just generate the `app.json` files for each example app code and maintain single asset files for webR and R package dependencies in a way that we do not have any external website dependency like `shinylive.io`.
I still think it is nice to have `shinylive.io` iframes as it has code editor, which might not be possible in the new way proposed above. This will give the users two ways to embed shinylive-r apps. This will also make sure that our multi-version pkgdown docs can use diferent versions of shinylive.
P.S Additionally, it will be nice to have the logic like `install_from_repo` so users can just specify the packages and repo somewhere and `roxy.shinylive` can force install the packages from the repo on `shinylive.io`.
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct.
### Contribution Guidelines
- [x] I agree to follow this project's Contribution Guidelines.
Contributor guide
Assessment
This issue has not been assessed yet.