{shinylive}: Serverless Shiny Apps | Barret Schloerke | Posit

Sdílet
Vložit
  • čas přidán 11. 09. 2024
  • In the rapidly evolving landscape of web technologies, the integration of R (and Python) with modern web frameworks has become increasingly important for data scientists and developers. This presentation introduces {shinylive}, a new R package that exports Shiny applications to be run within statically hosted websites. We will explore the capabilities of {shinylive} through its use of the innovative R package {webR}, which allows for the execution of R code in the browser (via WebAssembly and service workers) without the need for a centralized server.
    The presentation will cover the technical foundation of {shinylive}, including its architecture and the integration process with Quarto documents. We will also discuss the practical aspects and drawbacks of exporting Shiny apps with {shinylive}, highlighting the ease of exporting apps to a folder for local use or hosting them on GitHub pages.
    {shinylive} bridges the gap between Shiny and static websites, making it a valuable resource for interactive data analysis and presentation.
    Link to app: schloerke.com/...
    Link to script: github.com/pos...
    Link to use_github_action(): github.com/pos...
    Shinylive website: posit-dev.gith...
    {webr} docs: docs.r-wasm.or...

Komentáře • 14

  • @hanswurst4728
    @hanswurst4728 Před 3 měsíci +10

    This is actually huge, much appreciated.

  • @benschneider4830
    @benschneider4830 Před 3 měsíci +2

    This is such a huge feature for R and open source analysis software. Great work, Posit

  • @brynhumberstone
    @brynhumberstone Před 3 měsíci +2

    Thanks for making this short overview/demo video - great to see what can be done with shinylive and also how to do it.

  • @econmaett
    @econmaett Před 2 měsíci +1

    Thank you for this introductory video 😊

  • @marianklose1197
    @marianklose1197 Před 2 měsíci +1

    This is great!

  •  Před 3 měsíci +2

    at 8.28 you mention, that Shiny running in the browser can call out to an API with a secret database. But the httr2 package is not supported as I know. Did I miss something?

    • @schloerke
      @schloerke Před 3 měsíci

      Correct. {httr2} is not supported as {curl} is currently not supported by R-wasm.
      However, you can make regular URL requests that don't use {curl} (e.g. `readLines()`). While it is not a perfect solution, it does work!

    • @PositPBC
      @PositPBC  Před 3 měsíci +2

      Correct. You can not use the `{curl}` package in r-wasm and `{httr2}` is based on `{curl}`. However, you can use a `readLines()` approach to access general `GET` urls.

    • @PositPBC
      @PositPBC  Před 3 měsíci

      Example of an app that accesses an external random number generator API: shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKAZwAtaJWAlAB0IdJiw71OY4RBEBXWgAIAPAFolqKAHM4AfQBmtatSj1qcdiKVKYLANYATIgHcI7LZ3IAGKxBs2QmAAxMFKWFAQzjBKEPIw9HCMSroQSVCkRIxCIkG41gFBOXJ4BYFgEVFEMXEJSZwpFOnkjkoAbrRQSsDcpKSonIgA9EMuYxjMVTAYWdpDnHAAjvIUBHCcALrsvf2DI2MuE5HRM4xzC8ur68K5YAUCAvn+StK0jkkAkhCo8qR+AUo+D9SB9WgBeJRBSa6PJlJSmRLUJQQoKVXSIWHPGwwPjIpTeJ4AuwADzxAEZvAS4W0oNQVniCOwCUoAEzeWQ2R4FNpJegZWgwAAqcGJpAA8r9gewiJLfqC8VDjtUgrJZCIFowecl1EoDPIIARSLQSOwgb9cEoZf1fgIlCBcs9JtE9PJGEidYw4FBDbQeex7VilE7qnpoXBVBozaQACRhuGeHz-AGQsA7AbDUbjYPTWbzJYrA3rIYAfkxyZTOIgYLyQaVMFDkV0wDJGwtcPKADISdW8LWpg2IE2Wa3IYHO8RqGCyR2DFk7KQwahTHwO4womC0i4ioGOUoAL5qx11vQ06gND1en1+gMA0-njSeqCOAAyfHW7GzLrd7Ae1NpnAKA8HRsK1gVjOsIyDCh3kYAAFRg+D+G8Ak-O8f0A2Q9wdHg+FYABBdB2EUPFFAtDUtTxciklkMA9w2IA

    •  Před 3 měsíci

      @@PositPBC Thanks!

  • @emilyriederer4685
    @emilyriederer4685 Před 2 měsíci

    Great demo! I know last year it was said that Shinylive + Quarto required all app code to be in one cell. For the {shinylive} package can that app directory be arbitrarily complex (e.g. modules in separate subfolders) or does it have to have a specific structure?

    • @schloerke
      @schloerke Před 2 měsíci

      It can be arbitrarily complex! No restrictions like shinylive + quarto

  • @nirajjuneja7149
    @nirajjuneja7149 Před 3 měsíci

    can we do this with shinylive python