Skip to content

Deprecate bootstrap_dependencies() and use bslib as default instead #2154

Description

@apreshill

(to discuss)

@cpsievert After discussion, we are considering adding bslib as a dependency for rmarkdown. Looking at the dependencies, there is a lot of overlap, but we were wondering about the magrittr dependency: https://github.com/rstudio/bslib/blob/master/DESCRIPTION#L28

We didn't see anything clear in the bslib docs on using magrittr with bslib- might that be moved to suggests instead? Or are there other use cases? Thanks!

Activity

  1. cpsievert commented on Jun 3, 2021

    @cpsievert
    Contributor

    Yea, I can likely move magrittr to a suggestion in the next release

  2. cderv commented on Jun 3, 2021

    @cderv
    Collaborator

    I was curious about the relation about rmarkdown and magrittr so I looked it up.
    Let's just know that magrittr is already a package that will be installed with rmarkdown thought the use of stringr. https://github.com/tidyverse/stringr/blob/f030ae09b96e6815e16e257bad69c735530a2479/DESCRIPTION#L26

    > pak::pkg_deps_explain("rmarkdown", "magrittr")
    rmarkdown -> knitr -> stringr -> magrittr                                 
    rmarkdown -> stringr -> magrittr

    But it seems indeed that bslib does not really need magrittr has a hard dependency so it would be best to move it to soft dep if possible.

  3. yihui commented on Jun 3, 2021

    @yihui
    Collaborator

    IMHO infrastructure packages like bslib and stringr shouldn't be so opinionated about users' coding style (to pipe or not). This decision should be left to users (i.e., if they like pipes, they can always load magrittr by themselves), rather than being enforced at the package level (i.e., making magrittr a hard dependency).

    FWIW the dependency on stringr might be removed someday (yihui/knitr#1549).

  4. cderv commented on Jun 3, 2021

    @cderv
    Collaborator

    Same as in bslib, I don't think this is used directly in the package. I believe this reexported by convenience in the tidyverse to have the operator loaded in the session when stringr is loaded without to have to load magrittr explicitly. But this is a low level package with no dependency, so it do no harm to have it available with those package without needing to add library(magrittr) everytime you need the pipe.

    But I see and understand your argument for package outside the tidyverse ecosystem (which itself use the pipe exetensively by design I think)

  5. yihui commented on Jun 3, 2021

    @yihui
    Collaborator

    On one hand, I have no problem with higher-level packages being opinionated. On the other hand, bslib doesn't belong to the tidyverse, hence it doesn't have to be as opinionated as tidyverse in terms of users' coding style. In addition, R has got the new native pipe |> now, so it makes even less sense for bslib to play the role of deciding for users which pipe to use.

  6. apreshill commented on Jul 15, 2021

    @apreshill
    ContributorAuthor

    Adding [TODOs] here:

    1. Deprecation strategy then needed for the existing exported Bootstrap dependency (https://pkgs.rstudio.com/rmarkdown/reference/html-dependencies.html)

      • Deprecate with warning and a message

      • Check for CRAN rev deps

    2. Decision needed: which version of Bootstrap should be the default- 3 or 4?

  7. cderv commented on Sep 8, 2021

    @cderv
    Collaborator

    FWIW bslib version 0.3.0 is out with dependencies removed.

    Deps tree of bslib is now:

    > pak::pkg_deps_tree("bslib")
    bslib 0.3.0 [new]
    +-htmltools 0.5.2 [new]
    | +-digest 0.6.27 [new][dl] (268.58 kB)
    | +-base64enc 0.1-3 [new]
    | +-rlang 0.4.11 [new][dl] (1.19 MB)
    | \-fastmap 1.1.0 [new][dl] (215.42 kB)
    +-jsonlite 1.7.2 [new][dl] (544.22 kB)
    +-sass 0.4.0 [new][dl] (3.64 MB)
    | +-fs 1.5.0 [new][dl] (605.11 kB)
    | +-rlang
    | +-htmltools
    | +-R6 2.5.1 [new][dl] (84.27 kB)
    | \-rappdirs 0.3.3 [new][dl] (58.75 kB)
    +-jquerylib 0.1.4 [new][dl] (525.79 kB)
    | \-htmltools
    \-rlang

    Decision needed: which version of Bootstrap should be the default- 3 or 4?

    Bootstrap 5 will be the default in next bslibrelease probably. So choice will be default to 3 or 5 maybe...

  8. added
    nextto consider for next release
    on Sep 8, 2021
  9. added a commit that references this issue on Sep 14, 2021
  10. moved this from Backlog to Todo in R Markdown Team Projectson Dec 23, 2021
  11. changed the title [-][FR] Consider adding bslib an explicit default dependency[/-] [+]Deprecate `bootstrap_dependencies()` and use bslib as default instead[/+] on Dec 23, 2021
  12. moved this from Todo to Backlog in R Markdown Team Projectson Apr 8, 2022
  13. added a commit that references this issue on May 5, 2022
    51a695e
  14. added a commit that references this issue on May 11, 2026
    a61d7fa
  15. added a commit that references this issue on May 14, 2026
    0949e33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextto consider for next releasetheme: bootstraprelated to bootstrap

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions