shiny.fluent icon indicating copy to clipboard operation
shiny.fluent copied to clipboard

Prepare shiny.fluent for CRAN submission

Open kamilzyla opened this issue 3 years ago • 5 comments

Ensure that R CMD check --as-cran passes without any errors, warnings or notes. Update CI to fail on notes (currently it only fails on errors).

kamilzyla avatar May 25 '21 16:05 kamilzyla

R CMD check --as-cran reports:

  • 1 warning, mostly Undocumented arguments in documentation object {Component} and Documented arguments not in \usage in documentation object {Component}
  • 3 notes:
    • package size exceeds allowed 5Mb
      sub-directories of 1Mb or more:
      doc   4.9Mb
      www   4.7Mb
      
    • Unexported object imported by a ':::' call: ‘shiny:::resolve’
    • Multiple: \examples lines wider than 100 characters

jakubsob avatar Nov 18 '21 15:11 jakubsob

When components are generated using shiny.fluent:::component factory the ... argument is not documented which results in e.g. Undocumented arguments in documentation object 'Toggle' ‘...’. It can be resolved using e.g.

# components.R

component <- function(name) {
  function(...) shiny.react::reactElement(
    module = "@fluentui/react", name = name,
    props = shiny.react::asProps(...),
    deps = shinyFluentDependency()
  )
}

#' Ellipsis documentation template
#' @name doc
#' @param ... Props to pass to \code{shiny.react::reactElement}. See allowed props listed below
NULL

#' @rdname Toggle
#' @inheritParams doc
#' @export
Toggle <- component("Toggle")

But then it prepends ellipsis to the list of arguments of every component

Screenshot 2021-11-19 at 16 38 58

This is in line with actual usage of components as every prop needs to be passed as a named argument using ellipsis, but on the other hand documentation is actually "duplicated" as each prop is contained in ellipsis and it may be confusing.

This "See allowed props listed below" comment may do the job IMO, but do you know any other way how to combine those arguments together in docs? @kamilzyla

Similar thing could be applied to create documentation for {Component}.shinyInput and update{Component}.shinyInput (session, value, inputId) arguments. It would get rid of a huge portion of R CMD check notes.

jakubsob avatar Nov 19 '21 15:11 jakubsob

Is it any update about the CRAN submission? I tried to install the package for testing purposes from CRAN and it is yet not available (shiny.react it is).

Many thanks,

Corina

corinabioinformatic avatar Jan 19 '22 13:01 corinabioinformatic

Hi @corinabioinformatic,

submitting the package to CRAN is still in progress, but you can always install the package from GitHub using:

remotes::install_github("Appsilon/shiny.react")
remotes::install_github("Appsilon/shiny.fluent")

jakubsob avatar Jan 19 '22 17:01 jakubsob

To close this issue those must be closed first:

  • [x] #122
  • [x] #128
  • [x] #99

jakubsob avatar May 06 '22 12:05 jakubsob