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

Remove deprecated code and parameters #3137

Merged
merged 8 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export(enableBookmarking)
export(eventReactive)
export(exportTestValues)
export(exprToFunction)
export(extractStackTrace)
export(fileInput)
export(fillCol)
export(fillPage)
Expand All @@ -114,7 +113,6 @@ export(fixedRow)
export(flowLayout)
export(fluidPage)
export(fluidRow)
export(formatStackTrace)
export(freezeReactiveVal)
export(freezeReactiveValue)
export(getCurrentOutputInfo)
Expand Down Expand Up @@ -207,13 +205,8 @@ export(radioButtons)
export(reactive)
export(reactiveConsole)
export(reactiveFileReader)
export(reactivePlot)
export(reactivePoll)
export(reactivePrint)
export(reactiveTable)
export(reactiveText)
export(reactiveTimer)
export(reactiveUI)
export(reactiveVal)
export(reactiveValues)
export(reactiveValuesToList)
Expand Down Expand Up @@ -265,7 +258,6 @@ export(shinyUI)
export(showBookmarkUrlModal)
export(showModal)
export(showNotification)
export(showReactLog)
export(showTab)
export(sidebarLayout)
export(sidebarPanel)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ shiny 1.6.0.9000

* Switched from internal `Stack` class to `fastmap::faststack()`, and used `fastmap::fastqueue()`. (#3176)

* Some long-deprecated functions and function parameters were removed. (#3137)

### Bug fixes

* Closed #3374: `quoToFunction()` now works correctly with nested quosures; and as a result, quasi-quotation with rendering function (e.g., `renderPrint()`, `renderPlot()`, etc) now works as expected with nested quosures. (#3373)
Expand Down
29 changes: 2 additions & 27 deletions R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ NULL
#'
#' @param ... The contents of the document body.
#' @param title The browser window title (defaults to the host URL of the page)
#' @param responsive This option is deprecated; it is no longer optional with
#' Bootstrap 3.
#' @param theme One of the following:
#' * `NULL` (the default), which implies a "stock" build of Bootstrap 3.
#' * A [bslib::bs_theme()] object. This can be used to replace a stock
Expand All @@ -33,14 +31,7 @@ NULL
#'
#' @seealso [fluidPage()], [fixedPage()]
#' @export
bootstrapPage <- function(..., title = NULL, responsive = deprecated(), theme = NULL, lang = NULL) {

if (lifecycle::is_present(responsive)) {
shinyDeprecated(
"0.10.2.2", "bootstrapPage(responsive=)",
details = "The 'responsive' argument is no longer used with the latest version of Bootstrap."
)
}
bootstrapPage <- function(..., title = NULL, theme = NULL, lang = NULL) {

args <- list(
jqueryDependency(),
Expand Down Expand Up @@ -387,7 +378,6 @@ collapseSizes <- function(padding) {
#' @param collapsible `TRUE` to automatically collapse the navigation
#' elements into a menu when the width of the browser is less than 940 pixels
#' (useful for viewing on smaller touchscreen device)
#' @param collapsable Deprecated; use `collapsible` instead.
#' @param fluid `TRUE` to use a fluid layout. `FALSE` to use a fixed
#' layout.
#' @param responsive This option is deprecated; it is no longer optional with
Expand Down Expand Up @@ -435,18 +425,12 @@ navbarPage <- function(title,
footer = NULL,
inverse = FALSE,
collapsible = FALSE,
collapsable = deprecated(),
fluid = TRUE,
responsive = deprecated(),
theme = NULL,
windowTitle = title,
lang = NULL) {

if (lifecycle::is_present(collapsable)) {
shinyDeprecated("0.10.2.2", "navbarPage(collapsable =)", "navbarPage(collapsible =)")
collapsible <- collapsable
}

# alias title so we can avoid conflicts w/ title in withTags
pageTitle <- title

Expand Down Expand Up @@ -711,8 +695,6 @@ tabPanelBody <- function(value, ..., icon = NULL) {
#' conjunction with [tabPanelBody()] and [updateTabsetPanel()] to control the
#' active tab via other input controls. (See example below)}
#' }
#' @param position This argument is deprecated; it has been discontinued in
#' Bootstrap 3.
#' @inheritParams navbarPage
#' @return A tabset that can be passed to [mainPanel()]
#'
Expand Down Expand Up @@ -764,14 +746,7 @@ tabsetPanel <- function(...,
selected = NULL,
type = c("tabs", "pills", "hidden"),
header = NULL,
footer = NULL,
position = deprecated()) {
if (lifecycle::is_present(position)) {
shinyDeprecated(
"0.10.2.2", "bootstrapPage(position =)",
details = "The 'position' argument is no longer used with the latest version of Bootstrap."
)
}
footer = NULL) {

if (!is.null(id))
selected <- restoreInput(id = id, default = selected)
Expand Down
113 changes: 0 additions & 113 deletions R/conditions.R
Original file line number Diff line number Diff line change
Expand Up @@ -361,82 +361,6 @@ printStackTrace <- function(cond,
invisible()
}

#' @details `extractStackTrace` takes a list of calls (e.g. as returned
#' from `conditionStackTrace(cond)`) and returns a data frame with one
#' row for each stack frame and the columns `num` (stack frame number),
#' `call` (a function name or similar), and `loc` (source file path
#' and line number, if available). It was deprecated after shiny 1.0.5 because
#' it doesn't support deep stack traces.
#' @rdname stacktrace
#' @export
extractStackTrace <- function(calls,
full = get_devmode_option("shiny.fullstacktrace", FALSE),
offset = getOption("shiny.stacktraceoffset", TRUE)) {

shinyDeprecated(
"1.0.5", "extractStackTrace()",
details = "Please contact the Shiny team if you were using this functionality."
)

srcrefs <- getSrcRefs(calls)
if (offset) {
# Offset calls vs. srcrefs by 1 to make them more intuitive.
# E.g. for "foo [bar.R:10]", line 10 of bar.R will be part of
# the definition of foo().
srcrefs <- c(utils::tail(srcrefs, -1), list(NULL))
}
calls <- setSrcRefs(calls, srcrefs)

callnames <- getCallNames(calls)

# Hide and show parts of the callstack based on ..stacktrace(on|off)..
if (full) {
toShow <- rep.int(TRUE, length(calls))
} else {
# Remove stop(), .handleSimpleError(), and h() calls from the end of
# the calls--they don't add any helpful information. But only remove
# the last *contiguous* block of them, and then, only if they are the
# last thing in the calls list.
hideable <- callnames %in% c("stop", ".handleSimpleError", "h")
# What's the last that *didn't* match stop/.handleSimpleError/h?
lastGoodCall <- max(which(!hideable))
toRemove <- length(calls) - lastGoodCall
# But don't remove more than 5 levels--that's an indication we might
# have gotten it wrong, I guess
if (toRemove > 0 && toRemove < 5) {
calls <- utils::head(calls, -toRemove)
callnames <- utils::head(callnames, -toRemove)
}

# This uses a ref-counting scheme. It might make sense to switch this
# to a toggling scheme, so the most recent ..stacktrace(on|off)..
# directive wins, regardless of what came before it.
# Also explicitly remove ..stacktraceon.. because it can appear with
# score > 0 but still should never be shown.
score <- rep.int(0, length(callnames))
score[callnames == "..stacktraceoff.."] <- -1
score[callnames == "..stacktraceon.."] <- 1
toShow <- (1 + cumsum(score)) > 0 & !(callnames %in% c("..stacktraceon..", "..stacktraceoff..", "..stacktracefloor.."))

# doTryCatch, tryCatchOne, and tryCatchList are not informative--they're
# just internals for tryCatch
toShow <- toShow & !(callnames %in% c("doTryCatch", "tryCatchOne", "tryCatchList"))
}
calls <- calls[toShow]

calls <- rev(calls) # Show in traceback() order
index <- rev(which(toShow))
width <- floor(log10(max(index))) + 1

data.frame(
num = index,
call = getCallNames(calls),
loc = getLocs(calls),
category = getCallCategories(calls),
stringsAsFactors = FALSE
)
}

stripStackTraces <- function(stackTraces, values = FALSE) {
score <- 1L # >=1: show, <=0: hide
lapply(seq_along(stackTraces), function(i) {
Expand Down Expand Up @@ -531,49 +455,12 @@ offsetSrcrefs <- function(calls, offset = TRUE) {
# E.g. for "foo [bar.R:10]", line 10 of bar.R will be part of
# the definition of foo().
srcrefs <- c(utils::tail(srcrefs, -1), list(NULL))

calls <- setSrcRefs(calls, srcrefs)
}

calls
}

#' @details `formatStackTrace` is similar to `extractStackTrace`, but
#' it returns a preformatted character vector instead of a data frame. It was
#' deprecated after shiny 1.0.5 because it doesn't support deep stack traces.
#' @param indent A string to prefix every line of the stack trace.
#' @rdname stacktrace
#' @export
formatStackTrace <- function(calls, indent = " ",
full = get_devmode_option("shiny.fullstacktrace", FALSE),
offset = getOption("shiny.stacktraceoffset", TRUE)) {

shinyDeprecated(
"1.0.5", "formatStackTrace()",
details = "Please contact the Shiny team if you were using this functionality."
)

st <- extractStackTrace(calls, full = full, offset = offset)
if (nrow(st) == 0) {
return(character(0))
}

width <- floor(log10(max(st$num))) + 1
paste0(
indent,
formatC(st$num, width = width),
": ",
mapply(paste0(st$call, st$loc), st$category, FUN = function(name, category) {
if (category == "pkg")
crayon::silver(name)
else if (category == "user")
crayon::blue$bold(name)
else
crayon::white(name)
})
)
}

getSrcRefs <- function(calls) {
lapply(calls, function(call) {
attr(call, "srcref", exact = TRUE)
Expand Down
7 changes: 0 additions & 7 deletions R/graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ reactlogShow <- function(time = TRUE) {
check_reactlog()
reactlog::reactlog_show(reactlog(), time = time)
}
#' @describeIn reactlog This function is deprecated. You should use [reactlogShow()]
#' @export
# legacy purposes
showReactLog <- function(time = TRUE) {
shinyDeprecated("1.2.0", "showReactLog()", "reactlogShow()")

reactlogShow(time = time)
}
#' @describeIn reactlog Resets the entire reactlog stack. Useful for debugging and removing all prior reactive history.
#' @export
reactlogReset <- function() {
Expand Down
12 changes: 0 additions & 12 deletions R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -2127,18 +2127,6 @@ ShinySession <- R6Class(
})
}
}
),
active = list(
session = function() {
shinyDeprecated(
"0.11.1", "shinysession$session",
details = paste0(
"Attempted to access deprecated shinysession$session object. ",
"Please just access the shinysession object directly."
)
)
self
}
)
)

Expand Down
64 changes: 0 additions & 64 deletions R/shinywrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -918,67 +918,3 @@ checkDT9 <- function(options) {
names(options)[i] <- nms10
options
}

# Deprecated functions ------------------------------------------------------

#' Deprecated reactive functions
#'
#' @description \lifecycle{superseded}
#'
#' @name deprecatedReactives
#' @keywords internal
NULL

#' Plot output (deprecated)
#'
#' `reactivePlot` has been replaced by [renderPlot()].
#' @param func A function.
#' @param width Width.
#' @param height Height.
#' @param ... Other arguments to pass on.
#' @rdname deprecatedReactives
#' @export
reactivePlot <- function(func, width='auto', height='auto', ...) {
shinyDeprecated("0.4.0", "reactivePlot()", "renderPlot()")
renderPlot({ func() }, width=width, height=height, ...)
}

#' Table output (deprecated)
#'
#' `reactiveTable` has been replaced by [renderTable()].
#' @rdname deprecatedReactives
#' @export
reactiveTable <- function(func, ...) {
shinyDeprecated("0.4.0", "reactiveTable()", "renderTable()")
renderTable({ func() })
}

#' Print output (deprecated)
#'
#' `reactivePrint` has been replaced by [renderPrint()].
#' @rdname deprecatedReactives
#' @export
reactivePrint <- function(func) {
shinyDeprecated("0.4.0", "reactivePrint()", "renderPrint()")
renderPrint({ func() })
}

#' UI output (deprecated)
#'
#' `reactiveUI` has been replaced by [renderUI()].
#' @rdname deprecatedReactives
#' @export
reactiveUI <- function(func) {
shinyDeprecated("0.4.0", "reactiveUI()", "renderUI()")
renderUI({ func() })
}

#' Text output (deprecated)
#'
#' `reactiveText` has been replaced by [renderText()].
#' @rdname deprecatedReactives
#' @export
reactiveText <- function(func) {
shinyDeprecated("0.4.0", "reactiveText()", "renderText()")
renderText({ func() })
}
11 changes: 1 addition & 10 deletions man/bootstrapPage.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading