BristolMyersSquibb / blockr

Composable, extensible no-code UI
https://bristolmyerssquibb.github.io/blockr/
GNU General Public License v3.0
36 stars 3 forks source link

Shinylive links #326

Open JohnCoene opened 9 months ago

JohnCoene commented 9 months ago

The create_app_link function is an exported function used in the documentation.

https://github.com/blockr-org/blockr/blob/78782f38edd9c45be9ee012dc4c90149e784853b/R/utils.R#L393

How can we easily update the embedded app (embedded by this function)?

DivadNojnarg commented 9 months ago

I was working on this https://github.com/DivadNojnarg/shinylivePkgdown2 to automatically export an app to shinylive from the R code. However, I currently don't have availability to finalise it.

At the moment, the "process" is manual, boring and dumb. You have to copy/paste your app code like:

webr::install("blockr", repos = "https://blockr-org.github.io/webr-repos")
library(blockr)
stack <- new_stack(
    data_block,
    select_block
)

serve_stack(stack)

to the Posit shinylive React app editor (https://shinylive.io/r/examples/) and export the encoded url (click on sharing the app button top right corner) after code= for instance what I get with the above R code: NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAdzgCMAnRRASwgGdSoAbbgCgA6YOtyIEA1gyG4ABAzioi7GQF4ZQgBalSqdogD0+kWMkBaIgwDmGSy1IaArnQwsi+2o1PzF7IQEoBCG4WRigGAE8+YwkGAI4uCRkAHlMZCDhqAH1OKAlBCBlCmQATKC5M6PFcQKKZdjhuOAJSCtEJQLjA+oYANzhshPE+HIk-MABfAF0gA which you pass to app_code param. You'll also need a #nolint statement.

JohnCoene commented 9 months ago

I understand that it just seems a bit complicated to update the documentation, if we want to deploy an updated version of the app we have to change link/code in many places.

DivadNojnarg commented 9 months ago

Yes. You also currently have to update the custom wasm repo each time blockr is updated.

That's why this would be much better https://github.com/DivadNojnarg/shinylivePkgdown2 as it would automatically export all apps as soon as you update the code.

DivadNojnarg commented 9 months ago

ccing @schloerke :) for another usecase

parmsam-pfizer commented 1 month ago

{roxy.shinylive} created by @pawelru and built on top of {lzstring} might help solve for this. Hopefully, encode/decode functions will be in {shinylive} soon too: https://github.com/posit-dev/r-shinylive/pull/92