subugoe / hoad

Deprecated: Please check https://github.com/subugoe/hoaddash
https://github.com/subugoe/hoaddash
GNU Affero General Public License v3.0
15 stars 4 forks source link

consider pre-rendered shiny documents #147

Open maxheld83 opened 4 years ago

maxheld83 commented 4 years ago

this might only be possible for rmarkdown shiny documents, but has the big advantage of loading much faster.

maxheld83 commented 4 years ago

https://rmarkdown.rstudio.com/authoring_shiny_prerendered.html

maxheld83 commented 4 years ago

so as per the above commit/branch, this does work in principle, and may significantly speed up load times, especially the overall html structure would be immediately visible. May get even faster, if we render some plots already in rmarkdown, which might make a lot of sense anyway.

However, this requires significant refactoring first:

  1. The chunks would have to be disentangled by the traditional ui.R and server.R roles; i.e. you can't have both things in one chunk, because then there's no appropriate context=.
  2. By extension, the existing renderPlotly() etc. calls right inside of output chunks have to be split up into a ui.R (plotOutout()) and server.R (renderPlot()) parts.

Then this might work. That's out of scope for now, and probably not worth it given the necessary refactoring of the shiny frontend anyway.

But good to know that this does work, and might be a good middle ground between (fast) static rmarkdown and (slow) interactive shiny.