rstudio / shiny

Easy interactive web applications with R
https://shiny.posit.co/
Other
5.37k stars 1.86k forks source link

Documentation clarification: is `page_fluid()` now the default recommendation over `fluidPage()`? #4075

Open daattali opened 5 months ago

daattali commented 5 months ago

For many years the default convention for writing a simple shiny app was ui <- fluidPage(...). I've noticed that in the official docs for layout now mention page_fluid() and don't mention fluidPage() https://shiny.posit.co/r/articles/build/layout-guide/

I thought that perhaps this means fluidPage() is being phased out, so I looked at the function documentation for it and there is no mention there. It seems that any new shiny user will learn to use page_fluid(), but as an old shiny user, it's confusing whether I should also be moving to it or not.

Documentation should clarify this.

jcheng5 commented 5 months ago

Good question... the difference is that fluidPage is (still) based on Bootstrap 3.x and we can essentially never change it, nor tons of other UI functions that are built into Shiny, without breaking backwards compatibility. page_fluid is from bslib and defaults to Bootstrap 5.x, and brings in much better, more modern styles. We think people should generally be defaulting to bslib for new apps nowadays, and our docs are just starting to reflect that. But if you have existing apps based on fluidPage or other shiny functions, we don't intend to go breaking or removing those in the foreseeable future.

Thanks for the feedback, if you have other thoughts on this "migration" I'd be happy to hear them.

daattali commented 5 months ago

Thanks Joe, that makes sense. I do have some feedback/thoughts to share about bslib vs shiny, where would be the appropriate forum for me to bring them all up? It doesn't have to be a discussion, it can just be a dump of my thoughts and you guys take whatever you want from it.

On a similar note, I wanted to make some comments about the shiny tutorial and articles but couldn't find a github repo associated with it - where do I bring those issues up?

jcheng5 commented 5 months ago

Feel free to put your thoughts here, or as an issue on the rstudio/bslib repo. Also happy to follow up over email or zoom, if needed.

The Shiny for R doc website isn’t currently public but we’re working on opening it up—should happen pretty soon.

daattali commented 5 months ago

OK, since I got the green light from the CTO himself to spam this issue, here goes :) I recognize that some of these may already be on your radar, and some of these are subjective design decisions that you may have already considered and consciously decided against my opinion. You don't have to respond to any of these, I just want to share all my thoughts.

daattali commented 5 months ago

Documenting the new recommendation of bslib over fluidPage

daattali commented 5 months ago

bslib - generally feels not cohesive, lacks a single clear purpose

daattali commented 5 months ago

bslib - high level functions very visually appealing, but don't feel too well thought out

When I was learning shiny, and for a few years afterwards when functions got added, it always felt very streamlined. Everything fit in together very smoothly, very elegantly. It's hard to pinpoint exactly why, but bslib gives me the opposite feeling.

daattali commented 5 months ago

Shiny tutorial feedback (not related to bslib)

The shiny tutorial doesn't seem to flow like one unified tutorial, it feels like pieces that were stuck together

daattali commented 5 months ago

Shiny tutorial fixes

image

image

jcheng5 commented 5 months ago

Whoa, thanks for the treasure trove of feedback! Lots of actionable stuff for us to go over. Appreciate you taking the time.