Sharon Machlis
Executive Editor, Data & Analytics

Shiny R web framework arrives in Wasm

news
Sep 20, 20232 mins
Development Libraries and FrameworksR LanguageSoftware Development

Shinylive R package exports Shiny R apps as Wasm-enabled Shinylive applications that run completely in a web browser.

command line
Credit: Thinkstock

The Shiny web framework for R is now officially available in a WebAssembly (Wasm) version that runs in-browser and doesn’t require a back-end Shiny server, Posit CTO Joe Cheng announced at the Posit::conf(2023) user conference today.

There are currently three ways to use this new R version of Shinylive (a Python version of Shinylive was announced last year):

  • A new Shinylive R package has an export function that can convert a local Shiny app.R application to a Shinylive application with an index.html file and additional assets. That can then run as other conventional HTML files.
  • The Shinylive.io website now has an R version where users can write and share apps directly in browser, similar to a site like JSFiddle for JavaScript. 
  • Shiny apps can now be included as {shinylive-r} code chunks within Quarto documents using the new Shinylive Quarto extension https://github.com/quarto-ext/shinylive.
shiny live option3 IDG

Cheng cautioned that Shinylive for R is still new, and it can currently be slow to download all the necessary R code to a user’s browser. That should speed up in the coming weeks, he said. In addition, not all packages and functions are immediately available, apps can’t connect directly to databases (although API calls may work), and all code and data is fully accessible to end users, so there’s no way to hide things like API keys.

You can find out more in the GitHub repository for Cheng’s presentation

Sharon Machlis
Executive Editor, Data & Analytics

Sharon Machlis is Director of Editorial Data & Analytics at Foundry (the IDG, Inc. company that publishes websites including Computerworld and InfoWorld), where she analyzes data, codes in-house tools, and writes about data analysis tools and tips. She holds an Extra class amateur radio license and is somewhat obsessed with R. Her book Practical R for Mass Communication and Journalism was published by CRC Press.

More from this author