The shinyelectron package (GitHub, documentation) exports an R Shiny application as a standalone desktop application for Windows, macOS, and Linux. You point it at an app directory, and it hands back an installer that a colleague can double-click, with no server to host, no URL to share, and no R for them to install first. This is the first formal release, and it marks the moment the project moved from a personal experiment to something I am comfortable putting in front of other people.
I wrote about the idea earlier in a first look at shinyelectron; the short version is that a Shiny app is a wonderful thing to build and an awkward thing to hand to someone who does not live in R. v0.1.0 leans on the shinylive strategy to solve that. It compiles your app to WebAssembly with WebR, then wraps the result in an Electron shell. The app runs entirely inside the bundled browser, offline, with no server process and no R interpreter on the recipient’s machine. What ships is an ordinary desktop application.
export() to rule them all!
The entry point is a single function. Point export() at the app directory and a destination, and it autodetects the app type and defaults to the shinylive strategy, so the minimal call needs nothing else:
library(shinyelectron)
# Compile the app in ./my-app to a desktop application under ./dist
export(appdir = "my-app", destdir = "dist")Underneath, this release takes care of the parts that make desktop packaging tedious. It manages a local Node.js installation for you rather than asking you to set one up by hand. It reads its settings from a _shinyelectron.yml file in your project, so a build is reproducible and reviewable. And it wires up electron-updater so a shipped app can check for and install new versions on its own. Cross-platform builds for macOS, Windows, and Linux are supported out of the box.
This first release is deliberately narrow. It covers R Shiny apps through the shinylive strategy and nothing more; Python apps and the other runtime strategies came later. If you have an R Shiny app and you want a desktop build today, though, this is everything you need.
Installation
shinyelectron is available now from GitHub:
# install.packages("remotes")
remotes::install_github("coatless-rpkg/shinyelectron")For details, see the shinyelectron news file entry below:
shinyelectron news file entry for version 0.1.0
Features
- Initial release with
r-shinylivesupport. - Export R Shiny apps as standalone Electron desktop applications via WebR.
- Cross-platform builds for macOS, Windows, and Linux.
- Node.js local installation and management.
- Configuration via
_shinyelectron.yml. - Automatic updates via
electron-updater.
References
- shinyelectron on GitHub, the package source repository.
- shinyelectron documentation, the package documentation site.
- Shiny for R, Posit’s Shiny web framework.
- R, the R language.
- shinylive, Shiny compiled to run in the browser.
- WebAssembly, the portable WebAssembly binary format.
- webR, R compiled to WebAssembly.
- Electron, the framework for desktop apps built with web technology.
- electron-updater, electron-builder’s auto-update system.
- Python, the Python language.