RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
449 stars 78 forks source link

Don't statically copy `shiny::tabPanel` and `shiny::renderUI` at build time #151

Closed wch closed 2 years ago

wch commented 2 years ago

With the upcoming Shiny 1.7.0 release candidate, the old previous code caused the following error in R CMD check:

W  checking dependencies in R code (509ms)
   '::' or ':::' import not declared from: 'bslib'

This is because the following line copies the function directly from the installed version of Shiny, and in Shiny 1.7.0, that function contains a call to bslib::nav():

controlbarItem <- shiny::tabPanel

There are additional reasons that it is dangerous to copy objects from another package at build time, which is what that line does. It means that the object will be copied from the version of Shiny installed when shinydashboardPlus was built, but if the version of Shiny is later update, then shinydashboardPlus will still have the old version of the function copied from the old version of Shiny.

Please read https://r-pkgs.org/r.html#aliasing-a-function for more information about possible problems from copying functions at package build time.

If you could please merge and release a new version as soon as possible, we would appreciate it, as this is a blocker for the upcoming Shiny 1.7.0.

DivadNojnarg commented 2 years ago

Thanks @wch. I'll merge today and re-submit.

DivadNojnarg commented 2 years ago

@wch : I have to align {bs4Dash} as well

wch commented 2 years ago

Thank you for the quick response!

DivadNojnarg commented 2 years ago

shinydashboardPlus, shinyMobile and bs4Dash are all updated and on CRAN.

Dear maintainer,

thanks, package bs4Dash_2.0.3.tar.gz is on its way to CRAN.

Best regards, CRAN teams' auto-check service

Afficher le message d’origine Package check result: OK

No changes to worse in reverse depends.

sanjmeh commented 2 years ago

The error persists ! I get Error in get_quosure: could not find function "get_quosure" every time I launch my shiny app. My working shiny app that used shinydashboardPlus started giving above error with no other changes made. I have resinstalled shinydashboardPlus as well as bs4Dash as recommended above. But the error persists. As my shinyapp that is used by many users URGENT HELP REQUESTED. Here are the steps I have done after the upgrade of shiny to 1.7.0 Screen Shot 2021-09-28 at 9 39 08 AM Is there a way I can roll back to old shiny version as a workaround?

sanjmeh commented 2 years ago

@wch : I have to align {bs4Dash} as well

Was this done?

sanjmeh commented 2 years ago

I have rolled back to shiny 1.6.0 and my app is UP. So the problem was surely because of 1.7.0.

DivadNojnarg commented 2 years ago

Maybe somenthing else is missing. I have to re-check.

DivadNojnarg commented 2 years ago

Something unclear: is your app using bs4Dash and shinydashboardPlus at the same time? From you log I can't say.

ismirsehregal commented 2 years ago

I can reproduce this (using the latest CRAN versions) with the ?renderMenu example from shinydashboard:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic sidebar"),
  dashboardSidebar(
    sidebarMenuOutput("menu")
  ),
  dashboardBody()
)

server <- function(input, output) {
  output$menu <- renderMenu({
    sidebarMenu(
      menuItem("Menu item", icon = icon("calendar"))
    )
  })
}

shinyApp(ui, server)

results in:

Listening on http://127.0.0.1:4923
Warning: Error in get_quosure: could not find function "get_quosure"
  51: renderMenu
  50: server [~/.active-rstudio-document#16]
Error in get_quosure(expr, env, quoted) : 
  could not find function "get_quosure"

However, I'm not sure if this is still library(shinydashboardPlus) related.

Edit: No, this seems to be a library(shinydashboard) issue.

DivadNojnarg commented 2 years ago

Good catch! Thx

sanjmeh commented 2 years ago

@DivadNojnarg : I am not explicitly using bs4Dash just updated the package (thinking there may be a dependency). Now it seems it is established that it is a shinydashboard problem. Waiting for the fix. ThANKS.

FreyGeospatial commented 2 years ago

Please update when this is fixed... in the meantime, are there any workarounds?

DivadNojnarg commented 2 years ago

As reported above, it's not a {shinydashboardPlus} issue. Please update {shinydashboard} to the latest CRAN.