Open nealrichardson opened 1 year ago
I liked that idea, I'm a bit worried about recommending multiple deployment workflows. We do need to keep the rsconnect
one because that's how people deploy other python applications to Posit Connect and Cloud. Can you say more about the complexity you found with rsconnect
, maybe we can improve that package and have shiny deploy
just be a pass through.
Right, I think shiny deploy
would wrap rsconnect-python
to deploy to the targets that use it.
Can you say more about the complexity you found with
rsconnect
I started reading the docs and gave up without trying. Not to say that I won't give it a try later--I'm just wearing my impatient new user hat on, and when I run into friction, I take it as a sign that we need to reduce friction.
If it's a little app, you can use the shinylive share button, which encodes the app in a URL:
But there are limitations to this, in terms of what kinds of apps will work on shinylive.
Regarding deployment, I agree that it would be great to have super easy app deployment -- I think rsconnect
can be a bit much for new users to figure out.
@wch that's nice, but that only works if I'm already at shinylive.io developing. Suppose shiny deploy shinylive
would generate that link? (is it just b64encoding the app file(s)?)
@nealrichardson I can imagine a workflow like this:
Or, without VS Code:
shinylive watch .
to open the app on shinylive.io and autoreload on save.Other commands for shinylive
could be:
shinylive url myapp
: Get share URL for appshinylive open myapp
: Open app in shinylive.io editor page. (Maybe have an option for opening without the editor)I'm writing this as though these would use the shinylive
command from the Python shinylive package. I think it conceptually makes sense to have the command be there, but on the other hand, that's one more thing the user would have to install, and if it were instead a shiny
command, that would remove one step that the user would need to do.
I think the CLI command is a good idea, but one more thing that might be useful for you now: the shinylive.io editor page has a button to load all files from a directory on disk (works in Chrome only, I think).
The URL encoding is pretty simple. It uses the JS lz-string library to encode a simple data structure. This is where it does the encoding: https://github.com/rstudio/shinylive/blob/a2e4accd496e1db3908ddebedef493a6e4556c84/src/Components/share.ts#L7-L21
And this is the data structure: https://github.com/rstudio/shinylive/blob/a2e4accd496e1db3908ddebedef493a6e4556c84/src/Components/filecontent.ts#L12-L24
I'm writing this as though these would use the
shinylive
command from the Python shinylive package. I think it conceptually makes sense to have the command be there, but on the other hand, that's one more thing the user would have to install
We could put it in shinylive, have shiny depend on shinylive (or does that create a circular dependency problem?), and have shiny deploy shinylive
call out to shinylive to render?
Two recent updates regarding moving from local files to shinylive apps:
shinylive
now supports "deploying" an app to shinylive.io by creating a shinylive.io URL from local files. The command is shinylive url encode
.app.py
or app.R
, run the Create ShinyLive Link from Active File from the command palette with the app file open and active.Both also allow you to go from shinylive URL to local files via shinylive url decode
or the Save App from Shinylive Link in the VS Code extension.
I made a fun little app that I want to share. I want
shiny deploy my-app
to just work. Something along the lines ofquarto publish
. I'd like to have the complexity of configuring rsconnect-python, connecting to shinyapps.io or Posit Connect, or even bundling and pushing to shinylive to be handled for me as much as possible.