Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

wch
Copy link
Contributor

@wch wch commented Sep 14, 2021

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.

@wch wch marked this pull request as ready for review September 14, 2021 21:37
@wch wch changed the title Don't statically copy shiny::tabPanel at build time Don't statically copy shiny::tabPanel and shiny::renderUI at build time Sep 14, 2021
@DivadNojnarg
Copy link
Member

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

@DivadNojnarg
Copy link
Member

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

@wch
Copy link
Contributor Author

wch commented Sep 15, 2021

Thank you for the quick response!

@DivadNojnarg DivadNojnarg merged commit 362cb62 into RinteRface:master Sep 15, 2021
@DivadNojnarg
Copy link
Member

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
Copy link

sanjmeh commented Sep 28, 2021

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
Copy link

sanjmeh commented Sep 28, 2021

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

Was this done?

@sanjmeh
Copy link

sanjmeh commented Sep 28, 2021

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
Copy link
Member

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

@DivadNojnarg
Copy link
Member

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

@ismirsehregal
Copy link
Contributor

ismirsehregal commented Sep 28, 2021

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
Copy link
Member

Good catch! Thx

@sanjmeh
Copy link

sanjmeh commented Sep 28, 2021

@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
Copy link

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

@DivadNojnarg
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants