runExample() collides with shiny
and makes importing both difficult:
#' @rawNamespace import(shiny, except = runExample)
#' @rawNamespace import(shinyjs, except = runExample)
Would you consider renaming it to runJsExample()? This looks like a function used mostly interactively, so this change shouldn't introduce downstream problems.
Another one of those dumb mistakes because I didn't imagine anybody would ever use this package. Not as bad as making a show() function that collides with S4 though :)
Yes, I'll change it in the upcoming release which I'm planning on making soon, thanks
there's actually a PR in shiny for this https://github.com/rstudio/shiny/pull/1458
I won't be fixing it as of yet because I want to see if shiny will incorporate it
Looks like {shiny} decided to kill the PR for this, so every other package that also contains runExample() will run into the same issue. That function will probably always be used in interactive settings so I'll be ok living with this.
I see you still want this :) I'm curious, do you actually have a usecase where you are importing the runExample() function? And doing so from multiple packages? My intuition was that this function would only ever be used interactively but I might be wrong
Right now I can't
#' @import shiny
#' @import shinyjs
because of conflicts. The workaround is rather awkward, the alternative is to qualify shinyjs functions everywhere.
I see, that makes sense.
I really hate giving a non satisfactory answer, but in this case I think that's all I have right now. I thought of changing the function name to example but that's a {utils} function. I don't want to change to snake_case because then there'll be inconsistency within the package. runJsExample is an awkward name and implied that we're running javascript, which isn't really true. So out of all the non ideal solutions, I'm leaning to keeping the current, which does mean that {shinyjs} functions will have to be namespaced. If you think you have a good alternative, let me know.
FWIW I always import shiny and namespace any shinyjs functions, not because of this issue but just because shiny functions are way more abundant. I hate telling/forcing someone to "just do it my way" ("just import shiny and namespace shinyjs, because that's how I do it"), but I can't think of a better solution.