extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
184 stars 27 forks source link

Suggesting or replicating usethis functions #62

Closed malcolmbarrett closed 3 years ago

malcolmbarrett commented 3 years ago

I'm happy to see the emergence of usethis-style functions, e.g. #53 and #60.

I always find it a bit strange, though, when usethis-style functions don't quite behave like usethis (e.g. the UI and other defaults). A simple example is using message() instead of ui_*() or cli.

One solution is to add usethis to Suggests. Another option is to create lighter-weight internal options using cli.

I'd be happy to work on this if it seems like a good idea.

clauswilke commented 3 years ago

That's mostly just my ignorance. Feel free to change. I'd rather have a cli dependency than usethis dependency.

malcolmbarrett commented 3 years ago

Ok, I'll prep a PR exploring that. Thanks!

Ilia-Kosenkov commented 3 years ago

I just want to point out that here https://github.com/r-lib/usethis/issues/956 hadley recommends to use {cli} instead of ui_* (at least that's how I understand his message). I suggest to use {cli} (see some crude examples in #65).

malcolmbarrett commented 3 years ago

Oh, great that you're already planning to import cli. Yes, there's some nice guidance here for writing usethis-like ui: https://cli.r-lib.org/articles/usethis-ui.html. I think limiting to cli makes sense for this use case.

Ilia-Kosenkov commented 3 years ago

Please take into account this set of functions when adding {cli} support https://github.com/extendr/rextendr/blob/main/R/ui.R

malcolmbarrett commented 3 years ago

Thanks! I had intended to that in this PR, so awesome 😎

I might continue waiting on this until #88/#70 are resolved as that directly affects the approach for this small issue

malcolmbarrett commented 3 years ago

FYI Now that this other work has settled, I'll try to get a PR up for this in the next day or two

Ilia-Kosenkov commented 3 years ago

@malcolmbarrett, Should this be closed or are there any other features you think should be implemented?

malcolmbarrett commented 3 years ago

I've got one more PR coming surrounding the way templates are handled that will close this