@jonmcalder (Jon Calder) posted a new topic, subject "Best practice: devtools vs r-lib packages". It read:

   In general, is it likely that most functions which have been moved to `rlib` packages e.g. `withr`, `callr`, `remotes`, `usethis` etc will be eventually be deprecated from `devtools`? If not, what is the overall strategy? For example, could these packages end up going the way of the `tidyverse`, with `devtools` becoming a metapackage which contains them?
    
    Other than keeping an eye on actively maintained RStudio packages (e.g. those in the `tidyverse`) and closely following the NEWS.md updates for the various `r-lib` projects, what are the good ways to keep in touch with best practice for package development in R and the way the tooling is headed?

To which @Gabor (Gábor Csárdi) replied

    jonmcalder:
    
    > In general, is it likely that most functions which have been moved to `rlib` packages e.g. `withr`, `callr`, `remotes`, `usethis` etc will be eventually be deprecated from `devtools`? If not, what is the overall strategy? For example, could these packages end up going the way of the `tidyverse`, with `devtools` becoming a metapackage which contains them?
    
    They will not be deprecated from `devtools`, but `devtools` will just be a wrapper to these packages. This way the individual packages can be used by other packages/projects, and their maintenance is also easier.
    
    > Other than keeping an eye on actively maintained RStudio packages (e.g. those in the `tidyverse`) and closely following the NEWS.md updates for the various `r-lib` projects, what are the good ways to keep in touch with best practice for package development in R and the way the tooling is headed?
    
    I think we will have blog posts, as soon as some of the packages get stable, and make their way to CRAN.

After which, @jonmcalder (Jon Calder) added

    Ok cool. Thanks Gabor!

After which, @ildi.czeller (Ildi Czeller) added

    I became curios regarding the uncoupling of devtools. From this blogpost
    
    > devtools will remain the primary package developers will interact with when writing R packages; it will just rely on these other packages internally for most of the functionality.
    
    my impression was that you can use `devtools` as before but internally `devtools` uses other packages like `usethis`. However, I got a deprecation warning. I got interested about the reasoning and future plans.
    [code] 
        utils8b7c:f320:99b9:690f:4595:cd17:293a:c069packageVersion("devtools")
        #> '2.0.1'
        devtools8b7c:f320:99b9:690f:4595:cd17:293a:c069use_package("tibble", type = "Suggests")
        #> Setting active project to ...
        #> ✔ Adding 'tibble' to Suggests field in DESCRIPTION
        #> ● Use `requireNamespace("tibble", quietly = TRUE)` to test if package is installed
        #> ● Then use `tibbl8b7c:f320:99b9:690f:4595:cd17:293a:c069fun()` to refer to functions.
        #> Warning message:
        #> 'devtools8b7c:f320:99b9:690f:4595:cd17:293a:c069use_package' is deprecated.
        #> Use 'usethis8b7c:f320:99b9:690f:4595:cd17:293a:c069use_package()' instead.
        #> See help("Deprecated") and help("devtools-deprecated"). 
        
    [/code]
    
    This function in the code: https://github.com/r-lib/devtools/blob/b72cf4a3a5d5efe1452e44abbb4bf2b87e98b691/R/infrastructure.R#L78
    
    Is this only happening to usethis functions and other (sessioninfo, pkgload etc) won't be deprecated? Related new item: https://github.com/r-lib/devtools/blame/master/NEWS.md#L87
    
    Any comment is much appreciated!

@maelle (Maëlle Salmon) replied

    Maybe the thread below can help?
    
    github.com/r-lib/devtools
    
    #### Issue: Clarification re: usethis functions
    
    opened by jennybc on 2018-01-21
    
    closed by jennybc on 2018-01-21
    [code] 
        The Diaspora section of the README says:
        Generally, you should not need to worry about these different packages, because devtools installs them...
    [/code]

So @ildi.czeller (Ildi Czeller) replied

    thank you! this is exactly what I was looking for.

So @jimhester (Jim Hester) replied

    So this deprecation message was mainly so we could catch people using `devtools8b7c:f320:99b9:690f:4595:cd17:293a:c069use_xyz()` in _package_ code, as we wanted those packages to instead import usethis directly rather than devtools.
    
    For interactive use you can attach devtools (e.g. `library(devtools)`) then call the function without qualification `use_package()`, this will call the usethis function directly and there will be no deprecation message. You don't have to separately attach usethis, but of course it is fine if you do.


{'source': 'discourse', 'url': 'https://community.rstudio.com/t/best-practice-devtools-vs-r-lib-packages/427', 'title': 'Best practice: devtools vs r-lib packages', 'views': 1664, 'has_accepted_answer': False, 'word_count': 589, 'like_count': 29, 'reply_count': 4, 'participant_count': 5, 'posts': 7, 'tags': '', 'author': '@jonmcalder (Jon Calder)', 'participants': '@jonmcalder (Jon Calder), @Gabor (Gábor Csárdi), @ildi.czeller (Ildi Czeller), @maelle (Maëlle Salmon), @jimhester (Jim Hester)', 'image_url': [None], 'created_at': '2017-09-15T00:57:52.866Z', 'last_posted_at': '2019-04-08T18:45:56.999Z'}