A simple PWA bundler to work with Shiny
After writing this blogpost about a R + Shiny + Mongo + Docker (RSMD) stack, I've pointed out about shinyMobile
pacakge, but to my suprise it's built on to of the Framework7.
So to complement the example shown in my post, to provide a proper Progressive Web App (PWA) experience I've decided to built yet another PWA package to allow my example -- which is based in shinyDashboard
-- to work.
As almost any of my projects by now, I've developed by using Docker, so you can find an image already built to use to test this package in the following architectures:
- 386
- amd64
- arm/v6
- arm/v7
- arm64/v8
- s390x
- ppc64le
devtools::install_github('Fazendaaa/shinyPWA')
There is only one function that this package exports, the shinyPWA
function. Here's an example in the R + Shiny + Mongo + Docker
project:
...
dashboardBody(
shinyPWA(list(
hasIcons = TRUE,
version = 'v1',
shortname = 'RSMD',
name = 'R + Shiy + Mongo + Docker',
display = 'standalone',
backgroundcolor = '#fdfdfd',
themecolor = '#db4938',
orientation = 'portrait-primary'
)),
tabItems(
...
Even the example using shinydashboard, you can use shinyPWA without the dashboard package itself.
If you set hasIcons
to TRUE
you will need to follow the icons steps.
If you make icons for your application, just create a folder called icons
under your www
directory and place it there:
...
|
|- www/
| |- icons/
| | |- myFirstIcon.png
| | |- mySecondIcon.png
| | |- myThirdIcon.png
| ... ...
...
You do not need to set the aspect ratio of images as is common in PWAs. So you won't need to save something like my-icon-52x52.png
, just my-icon.png
will be needed.
To run the current tests just:
docker run -it fazenda/shinypwa R -e "devtools::test()"
And if you want to contribute with some code, before opening a new Pull Request (PR) just run:
docker run -it --volume $(pwd):/test --workdir /test fazenda/shinypwa R -e "devtools::test()"
note: of course this will break and not run if you add a new dependency to the package, so a Dockerfile is also provided to aid you in the development
- Tests
- Better docs
- Write a
CONTRIBUTING.md
- Examples folder
- Deploy it to CRAN
This project is licensed under the GNU v2