From bc21ccd4baf93317a70ab8ef26978fcb8adb245d Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 12:11:39 -0300 Subject: [PATCH 1/6] fix typo in server-side vignette --- vignettes/tutorial/server-side-processing.rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/tutorial/server-side-processing.rmd b/vignettes/tutorial/server-side-processing.rmd index fbcdbbf..7e4b342 100644 --- a/vignettes/tutorial/server-side-processing.rmd +++ b/vignettes/tutorial/server-side-processing.rmd @@ -11,7 +11,7 @@ Rendering a `reactable` with a lot of data can be inefficient. The initial loadi A more efficient approach is to render only the data that is needed to be displayed. -`reactable_extras_ui()` and `reactalbe_extras_server()` is a wrapper for `reactable::reactableOutput()` and `reactable::renderReactable({reactable(...)})`. It renders only a subset of a large data in the server memory. This almost instantly renders the desired page and keeps the amount of memory used in the browser minimal. +`reactable_extras_ui()` and `reactable_extras_server()` is a wrapper for `reactable::reactableOutput()` and `reactable::renderReactable({reactable(...)})`. It renders only a subset of a large data in the server memory. This almost instantly renders the desired page and keeps the amount of memory used in the browser minimal. Consider this example data: From cc379a9115df8f59250716e05840840745a179fa Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 12:13:43 -0300 Subject: [PATCH 2/6] add deprecated message in docstring and vignette --- R/reactable-server.R | 7 ++++++- vignettes/tutorial/server-side-processing.rmd | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/R/reactable-server.R b/R/reactable-server.R index b37ff5e..a3ee4bd 100644 --- a/R/reactable-server.R +++ b/R/reactable-server.R @@ -178,7 +178,7 @@ get_data_on_page <- function(data, page_number, total_pages) { dplyr::select(!dplyr::any_of("reactable_data_page")) } -#' Create reactable UI with server-side processing +#' [Deprecated] Create reactable UI with server-side processing #' #' @param id element id #' @param width,height CSS unit (`"100%"`, `"400px"`, or `"auto"`), numeric for number of pixels @@ -219,6 +219,11 @@ get_data_on_page <- function(data, page_number, total_pages) { #' ) #' } reactable_extras_ui <- function(id, width = "auto", height = "auto") { + .Deprecated( + new = "reactable::reactable", + msg = "`reactable::reactable` now has a `server = TRUE` argument. Please use 'reactable' directly instead of this module." + ) + checkmate::assert_character(id, len = 1) ns <- shiny::NS(id) diff --git a/vignettes/tutorial/server-side-processing.rmd b/vignettes/tutorial/server-side-processing.rmd index 7e4b342..42eee60 100644 --- a/vignettes/tutorial/server-side-processing.rmd +++ b/vignettes/tutorial/server-side-processing.rmd @@ -11,6 +11,10 @@ Rendering a `reactable` with a lot of data can be inefficient. The initial loadi A more efficient approach is to render only the data that is needed to be displayed. +

+The module `reactable_extras_ui`/`reactable_extras_server` is deprecated. We now recommend using the newest version of `reactable`, where the function `reactable::reactable` has an argument called `server` to enable server-side processing when set to `TRUE`. You can check the docs [here](https://glin.github.io/reactable/reference/reactable.html) and a detailed discussion [here](https://github.com/glin/reactable/issues/22#issuecomment-1475649659). +

+ `reactable_extras_ui()` and `reactable_extras_server()` is a wrapper for `reactable::reactableOutput()` and `reactable::renderReactable({reactable(...)})`. It renders only a subset of a large data in the server memory. This almost instantly renders the desired page and keeps the amount of memory used in the browser minimal. Consider this example data: From 95eb2dffe7af7772e1128f7b6308797ab6f5af4c Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 12:15:24 -0300 Subject: [PATCH 3/6] update docstrings with roxygenise --- DESCRIPTION | 2 +- man/reactable-extras-server.Rd | 4 ++-- reactable.extras.Rproj | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cd13172..1c593c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,4 +40,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/man/reactable-extras-server.Rd b/man/reactable-extras-server.Rd index 990ae60..1d1497d 100644 --- a/man/reactable-extras-server.Rd +++ b/man/reactable-extras-server.Rd @@ -4,7 +4,7 @@ \alias{reactable-extras-server} \alias{reactable_extras_ui} \alias{reactable_extras_server} -\title{Create reactable UI with server-side processing} +\title{\link{Deprecated} Create reactable UI with server-side processing} \usage{ reactable_extras_ui(id, width = "auto", height = "auto") @@ -27,7 +27,7 @@ reactable_extras_server(id, data, total_pages = 4, sortable = TRUE, ...) \code{reactable_extras_ui()} returns a custom UI for a server-side processed reactable } \description{ -Create reactable UI with server-side processing +\link{Deprecated} Create reactable UI with server-side processing } \details{ Arguments passed to \code{\link[reactable:reactable]{reactable::reactable()}} must not contain \code{pagination} or \code{showPagination}. diff --git a/reactable.extras.Rproj b/reactable.extras.Rproj index 497f8bf..842bfe4 100644 --- a/reactable.extras.Rproj +++ b/reactable.extras.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: c1cefcba-92d9-4a94-9553-36fbb0131b66 RestoreWorkspace: Default SaveWorkspace: Default From a8a5b65eee2a639e3c9c8574d6cf453bc39673c1 Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 12:27:21 -0300 Subject: [PATCH 4/6] change symbol around "Deprecated" message --- R/reactable-server.R | 642 ++++++++++++++++----------------- man/reactable-extras-server.Rd | 4 +- 2 files changed, 323 insertions(+), 323 deletions(-) diff --git a/R/reactable-server.R b/R/reactable-server.R index a3ee4bd..85f4836 100644 --- a/R/reactable-server.R +++ b/R/reactable-server.R @@ -1,321 +1,321 @@ -#' Utility function to disable or re-enable navigation buttons -#' -#' @param disable a named logical vector -#' @param session Shiny session object; default to current Shiny session -#' -#' @details `disable` should a logical vector with these exact names: `first_page`, `previous_page`, -#' `next_page`, and `last_page`. The logical vectors indicate if the corresponding button will be -#' enabled or disabled. -#' @keywords internal -#' -toggle_navigation_buttons <- function(disable, session = shiny::getDefaultReactiveDomain()) { - button_ids <- paste0(c("first", "previous", "next", "last"), "_page") - - checkmate::assert( - checkmate::check_logical( - disable, - any.missing = FALSE, - all.missing = FALSE, - len = 4L - ), - checkmate::check_subset( - names(disable), - choices = button_ids, - empty.ok = FALSE - ) - ) - - checkmate::assert( - checkmate::check_r6(session, "ShinySession"), - checkmate::check_class(session, "session_proxy"), - .combine = "or" - ) - - ns <- session$ns # nolint: object_usage_linter - - purrr::walk( - button_ids, - ~ session$sendCustomMessage( - "toggleDisable", - list(id = paste0("#", ns(.x)), disable = disable[[.x]]) - ) - ) -} - -#' Module for reactable page navigation -#' -#' @param id element id -#' @param total_pages total number of pages -#' -#' @name reactable-page-controls -#' -#' @return `reactable_page_controls()` returns a UI for page navigation of a server-side processed -#' [reactable::reactable()] data -#' @keywords internal -reactable_page_controls <- function(id) { - checkmate::assert_character(id, len = 1) - - ns <- shiny::NS(id) - - shiny::div( - class = "pagination-controls", - purrr::map2( - c("first_page", "previous_page", "next_page", "last_page"), - c("angles-left", "angle-left", "angle-right", "angles-right"), - ~ shiny::tagAppendAttributes( - class = "pagination-button", - shiny::actionButton( - inputId = ns(.x), - icon = shiny::icon(.y), label = "" - ) - ) - ), - shiny::div( - class = "pagination-text", - shiny::textOutput( - outputId = ns("page_text"), - inline = TRUE - ) - ) - ) -} - -#' @rdname reactable-page-controls -return_reactable_page <- function(id, total_pages) { - checkmate::assert( - checkmate::check_character(id, len = 1), - checkmate::check_integerish(total_pages, len = 1), - combine = "and" - ) - - shiny::moduleServer(id, function(input, output, session) { - page_number <- shiny::reactiveVal(1) - - shiny::observeEvent(input$first_page, { - page_number(1) - }) - - shiny::observeEvent(input$last_page, { - page_number(total_pages) - }) - - shiny::observeEvent(input$next_page, { - shiny::req(page_number() < total_pages) - page_number(page_number() + 1) - }) - - shiny::observeEvent(input$previous_page, { - shiny::req(page_number() > 1) - page_number(page_number() - 1) - }) - - shiny::observe({ - output$page_text <- shiny::renderText({ - if (page_number() == 1) { - toggle_navigation_buttons( - c( - first_page = TRUE, - previous_page = TRUE, - next_page = FALSE, - last_page = FALSE - ) - ) - } else if (page_number() > 1 && page_number() < total_pages) { - toggle_navigation_buttons( - c( - first_page = FALSE, - previous_page = FALSE, - next_page = FALSE, - last_page = FALSE - ) - ) - } else if (page_number() == total_pages) { - toggle_navigation_buttons( - c( - first_page = FALSE, - previous_page = FALSE, - next_page = TRUE, - last_page = TRUE - ) - ) - } - - paste0(page_number(), " of ", total_pages) - }) - }) - - return(page_number) - }) -} - -#' Get the data on the page -#' -#' @param data data.frame without pages; pagination will be inferred -#' @param page_number page of data to retrieve -#' @param total_pages number of pages in `data`; determines pagination when the data has no pages -#' -#' @return a data.frame -#' @keywords internal -get_data_on_page <- function(data, page_number, total_pages) { - checkmate::assert( - checkmate::check_data_frame(data), - checkmate::check_integerish(page_number, len = 1), - checkmate::check_integerish(total_pages, len = 1), - combine = "and" - ) - - if (page_number > total_pages) - stop("page_number must be less than or equal to total_pages") - - rows_per_page <- ceiling(nrow(data) / total_pages) - - data |> - dplyr::mutate(reactable_data_page = ceiling(dplyr::row_number() / rows_per_page)) |> - # Using page here will trigger a fail in R CMD CHECK - # because there is no global variable binding - # for page. This is a common problem using dplyr. - dplyr::filter(dplyr::if_any("reactable_data_page", ~ .x == page_number)) |> - dplyr::select(!dplyr::any_of("reactable_data_page")) -} - -#' [Deprecated] Create reactable UI with server-side processing -#' -#' @param id element id -#' @param width,height CSS unit (`"100%"`, `"400px"`, or `"auto"`), numeric for number of pixels -#' @param data passed to [reactable::reactable()] -#' @param total_pages number of pages -#' @param sortable allow sorting by columns -#' @param ... other arguments to be passed to [reactable::reactable()] -#' -#' @details -#' Arguments passed to [reactable::reactable()] must not contain `pagination` or `showPagination`. -#' These are set to `FALSE`. Pagination will be handled on the server-side. -#' -#' -#' @name reactable-extras-server -#' -#' @return `reactable_extras_ui()` returns a custom UI for a server-side processed reactable -#' @export -#' -#' @examples -#' if (interactive()) { -#' library(shiny) -#' library(reactable) -#' library(reactable.extras) -#' -#' shinyApp( -#' reactable_extras_ui("big_data"), -#' function(input, output, server) { -#' reactable_extras_server( -#' "big_data", -#' data = mtcars, -#' columns = list( -#' mpg = reactable::colDef(name = "Miles per Gallon"), -#' cyl = reactable::colDef(name = "Cylinders"), -#' disp = reactable::colDef(name = "Displacement") -#' ) -#' ) -#' } -#' ) -#' } -reactable_extras_ui <- function(id, width = "auto", height = "auto") { - .Deprecated( - new = "reactable::reactable", - msg = "`reactable::reactable` now has a `server = TRUE` argument. Please use 'reactable' directly instead of this module." - ) - - checkmate::assert_character(id, len = 1) - - ns <- shiny::NS(id) - - shiny::tagList( - reactable_extras_dependency(), - reactable_page_controls(ns("page_controls")), - reactable::reactableOutput( - outputId = ns("reactable"), - width = width, height = height, inline = FALSE - ) - ) -} - -hide_internal_uuid <- function(args) { - if (is.null(args$columns)) { - args$columns <- list() - } - args$columns[[".internal_uuid"]] <- reactable::colDef(show = FALSE) - return(args) -} - -sort_table <- function(data, column_name, direction) { - column_name <- rlang::sym(column_name) - if (direction == "asc") { - data |> - dplyr::arrange(!!column_name) - } else if (direction == "desc") { - data |> - dplyr::arrange(dplyr::desc(!!column_name)) - } -} - -#' @rdname reactable-extras-server -#' @export -reactable_extras_server <- function(id, data, total_pages = 4, sortable = TRUE, ...) { - - data <- as.data.frame(data, stringsAsFactors = TRUE) |> - dplyr::mutate(.internal_uuid = dplyr::row_number()) - - # Create and clean-up reactable arguments - reactable_args <- hide_internal_uuid(list(...)) - - checkmate::assert( - checkmate::check_character(id, len = 1), - checkmate::check_data_frame(data), - checkmate::check_integerish(total_pages, len = 1), - # Check if arguments can be passed to reactable - checkmate::check_subset( - names(reactable_args), - names(formals(reactable::reactable)), - empty.ok = TRUE - ), - combine = "and" - ) - - # Server-side processing handles pagination, so reactable should not show it - reactable_args$pagination <- FALSE - reactable_args$showPagination <- FALSE - reactable_args$sortable <- sortable - - reactable_data <- shiny::reactiveVal(NULL) - - shiny::moduleServer(id, function(input, output, session) { - reactable_args$data <- - get_data_on_page(data, 1, total_pages = total_pages) - - output$reactable <- reactable::renderReactable({ - do.call(reactable::reactable, args = reactable_args) - }) - - column_sort <- shiny::reactive({ - reactable::getReactableState("reactable", "sorted") - }) - - page_number <- # nolint: object_usage_linter - return_reactable_page(id = "page_controls", total_pages = total_pages) - - shiny::observe({ - if (is.null(column_sort())) { - data |> - get_data_on_page(page_number = page_number(), total_pages = total_pages) |> - reactable_data() - } else { - column_name <- rlang::sym(names(column_sort())) - data |> - get_data_on_page(page_number = page_number(), total_pages = total_pages) |> - sort_table(column_name = column_name, direction = column_sort()[[1]]) |> - reactable_data() - } - - reactable::updateReactable("reactable", data = reactable_data()) - }) - }) -} +#' Utility function to disable or re-enable navigation buttons +#' +#' @param disable a named logical vector +#' @param session Shiny session object; default to current Shiny session +#' +#' @details `disable` should a logical vector with these exact names: `first_page`, `previous_page`, +#' `next_page`, and `last_page`. The logical vectors indicate if the corresponding button will be +#' enabled or disabled. +#' @keywords internal +#' +toggle_navigation_buttons <- function(disable, session = shiny::getDefaultReactiveDomain()) { + button_ids <- paste0(c("first", "previous", "next", "last"), "_page") + + checkmate::assert( + checkmate::check_logical( + disable, + any.missing = FALSE, + all.missing = FALSE, + len = 4L + ), + checkmate::check_subset( + names(disable), + choices = button_ids, + empty.ok = FALSE + ) + ) + + checkmate::assert( + checkmate::check_r6(session, "ShinySession"), + checkmate::check_class(session, "session_proxy"), + .combine = "or" + ) + + ns <- session$ns # nolint: object_usage_linter + + purrr::walk( + button_ids, + ~ session$sendCustomMessage( + "toggleDisable", + list(id = paste0("#", ns(.x)), disable = disable[[.x]]) + ) + ) +} + +#' Module for reactable page navigation +#' +#' @param id element id +#' @param total_pages total number of pages +#' +#' @name reactable-page-controls +#' +#' @return `reactable_page_controls()` returns a UI for page navigation of a server-side processed +#' [reactable::reactable()] data +#' @keywords internal +reactable_page_controls <- function(id) { + checkmate::assert_character(id, len = 1) + + ns <- shiny::NS(id) + + shiny::div( + class = "pagination-controls", + purrr::map2( + c("first_page", "previous_page", "next_page", "last_page"), + c("angles-left", "angle-left", "angle-right", "angles-right"), + ~ shiny::tagAppendAttributes( + class = "pagination-button", + shiny::actionButton( + inputId = ns(.x), + icon = shiny::icon(.y), label = "" + ) + ) + ), + shiny::div( + class = "pagination-text", + shiny::textOutput( + outputId = ns("page_text"), + inline = TRUE + ) + ) + ) +} + +#' @rdname reactable-page-controls +return_reactable_page <- function(id, total_pages) { + checkmate::assert( + checkmate::check_character(id, len = 1), + checkmate::check_integerish(total_pages, len = 1), + combine = "and" + ) + + shiny::moduleServer(id, function(input, output, session) { + page_number <- shiny::reactiveVal(1) + + shiny::observeEvent(input$first_page, { + page_number(1) + }) + + shiny::observeEvent(input$last_page, { + page_number(total_pages) + }) + + shiny::observeEvent(input$next_page, { + shiny::req(page_number() < total_pages) + page_number(page_number() + 1) + }) + + shiny::observeEvent(input$previous_page, { + shiny::req(page_number() > 1) + page_number(page_number() - 1) + }) + + shiny::observe({ + output$page_text <- shiny::renderText({ + if (page_number() == 1) { + toggle_navigation_buttons( + c( + first_page = TRUE, + previous_page = TRUE, + next_page = FALSE, + last_page = FALSE + ) + ) + } else if (page_number() > 1 && page_number() < total_pages) { + toggle_navigation_buttons( + c( + first_page = FALSE, + previous_page = FALSE, + next_page = FALSE, + last_page = FALSE + ) + ) + } else if (page_number() == total_pages) { + toggle_navigation_buttons( + c( + first_page = FALSE, + previous_page = FALSE, + next_page = TRUE, + last_page = TRUE + ) + ) + } + + paste0(page_number(), " of ", total_pages) + }) + }) + + return(page_number) + }) +} + +#' Get the data on the page +#' +#' @param data data.frame without pages; pagination will be inferred +#' @param page_number page of data to retrieve +#' @param total_pages number of pages in `data`; determines pagination when the data has no pages +#' +#' @return a data.frame +#' @keywords internal +get_data_on_page <- function(data, page_number, total_pages) { + checkmate::assert( + checkmate::check_data_frame(data), + checkmate::check_integerish(page_number, len = 1), + checkmate::check_integerish(total_pages, len = 1), + combine = "and" + ) + + if (page_number > total_pages) + stop("page_number must be less than or equal to total_pages") + + rows_per_page <- ceiling(nrow(data) / total_pages) + + data |> + dplyr::mutate(reactable_data_page = ceiling(dplyr::row_number() / rows_per_page)) |> + # Using page here will trigger a fail in R CMD CHECK + # because there is no global variable binding + # for page. This is a common problem using dplyr. + dplyr::filter(dplyr::if_any("reactable_data_page", ~ .x == page_number)) |> + dplyr::select(!dplyr::any_of("reactable_data_page")) +} + +#' (Deprecated) Create reactable UI with server-side processing +#' +#' @param id element id +#' @param width,height CSS unit (`"100%"`, `"400px"`, or `"auto"`), numeric for number of pixels +#' @param data passed to [reactable::reactable()] +#' @param total_pages number of pages +#' @param sortable allow sorting by columns +#' @param ... other arguments to be passed to [reactable::reactable()] +#' +#' @details +#' Arguments passed to [reactable::reactable()] must not contain `pagination` or `showPagination`. +#' These are set to `FALSE`. Pagination will be handled on the server-side. +#' +#' +#' @name reactable-extras-server +#' +#' @return `reactable_extras_ui()` returns a custom UI for a server-side processed reactable +#' @export +#' +#' @examples +#' if (interactive()) { +#' library(shiny) +#' library(reactable) +#' library(reactable.extras) +#' +#' shinyApp( +#' reactable_extras_ui("big_data"), +#' function(input, output, server) { +#' reactable_extras_server( +#' "big_data", +#' data = mtcars, +#' columns = list( +#' mpg = reactable::colDef(name = "Miles per Gallon"), +#' cyl = reactable::colDef(name = "Cylinders"), +#' disp = reactable::colDef(name = "Displacement") +#' ) +#' ) +#' } +#' ) +#' } +reactable_extras_ui <- function(id, width = "auto", height = "auto") { + .Deprecated( + new = "reactable::reactable", + msg = "`reactable::reactable` now has a `server = TRUE` argument. Please use 'reactable' directly instead of this module." + ) + + checkmate::assert_character(id, len = 1) + + ns <- shiny::NS(id) + + shiny::tagList( + reactable_extras_dependency(), + reactable_page_controls(ns("page_controls")), + reactable::reactableOutput( + outputId = ns("reactable"), + width = width, height = height, inline = FALSE + ) + ) +} + +hide_internal_uuid <- function(args) { + if (is.null(args$columns)) { + args$columns <- list() + } + args$columns[[".internal_uuid"]] <- reactable::colDef(show = FALSE) + return(args) +} + +sort_table <- function(data, column_name, direction) { + column_name <- rlang::sym(column_name) + if (direction == "asc") { + data |> + dplyr::arrange(!!column_name) + } else if (direction == "desc") { + data |> + dplyr::arrange(dplyr::desc(!!column_name)) + } +} + +#' @rdname reactable-extras-server +#' @export +reactable_extras_server <- function(id, data, total_pages = 4, sortable = TRUE, ...) { + + data <- as.data.frame(data, stringsAsFactors = TRUE) |> + dplyr::mutate(.internal_uuid = dplyr::row_number()) + + # Create and clean-up reactable arguments + reactable_args <- hide_internal_uuid(list(...)) + + checkmate::assert( + checkmate::check_character(id, len = 1), + checkmate::check_data_frame(data), + checkmate::check_integerish(total_pages, len = 1), + # Check if arguments can be passed to reactable + checkmate::check_subset( + names(reactable_args), + names(formals(reactable::reactable)), + empty.ok = TRUE + ), + combine = "and" + ) + + # Server-side processing handles pagination, so reactable should not show it + reactable_args$pagination <- FALSE + reactable_args$showPagination <- FALSE + reactable_args$sortable <- sortable + + reactable_data <- shiny::reactiveVal(NULL) + + shiny::moduleServer(id, function(input, output, session) { + reactable_args$data <- + get_data_on_page(data, 1, total_pages = total_pages) + + output$reactable <- reactable::renderReactable({ + do.call(reactable::reactable, args = reactable_args) + }) + + column_sort <- shiny::reactive({ + reactable::getReactableState("reactable", "sorted") + }) + + page_number <- # nolint: object_usage_linter + return_reactable_page(id = "page_controls", total_pages = total_pages) + + shiny::observe({ + if (is.null(column_sort())) { + data |> + get_data_on_page(page_number = page_number(), total_pages = total_pages) |> + reactable_data() + } else { + column_name <- rlang::sym(names(column_sort())) + data |> + get_data_on_page(page_number = page_number(), total_pages = total_pages) |> + sort_table(column_name = column_name, direction = column_sort()[[1]]) |> + reactable_data() + } + + reactable::updateReactable("reactable", data = reactable_data()) + }) + }) +} diff --git a/man/reactable-extras-server.Rd b/man/reactable-extras-server.Rd index 1d1497d..6b8ca8c 100644 --- a/man/reactable-extras-server.Rd +++ b/man/reactable-extras-server.Rd @@ -4,7 +4,7 @@ \alias{reactable-extras-server} \alias{reactable_extras_ui} \alias{reactable_extras_server} -\title{\link{Deprecated} Create reactable UI with server-side processing} +\title{(Deprecated) Create reactable UI with server-side processing} \usage{ reactable_extras_ui(id, width = "auto", height = "auto") @@ -27,7 +27,7 @@ reactable_extras_server(id, data, total_pages = 4, sortable = TRUE, ...) \code{reactable_extras_ui()} returns a custom UI for a server-side processed reactable } \description{ -\link{Deprecated} Create reactable UI with server-side processing +(Deprecated) Create reactable UI with server-side processing } \details{ Arguments passed to \code{\link[reactable:reactable]{reactable::reactable()}} must not contain \code{pagination} or \code{showPagination}. From 9e0503ccb84520912f1225a9046fd34ec1b67742 Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 12:56:48 -0300 Subject: [PATCH 5/6] apply lint --- R/reactable-server.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/reactable-server.R b/R/reactable-server.R index 85f4836..3e8df1d 100644 --- a/R/reactable-server.R +++ b/R/reactable-server.R @@ -221,7 +221,8 @@ get_data_on_page <- function(data, page_number, total_pages) { reactable_extras_ui <- function(id, width = "auto", height = "auto") { .Deprecated( new = "reactable::reactable", - msg = "`reactable::reactable` now has a `server = TRUE` argument. Please use 'reactable' directly instead of this module." + msg = "`reactable::reactable` now has a `server = TRUE` argument. + Please use 'reactable' directly instead of this module." ) checkmate::assert_character(id, len = 1) From 492adfa873c4ab271d243cef5796d2782a82214c Mon Sep 17 00:00:00 2001 From: vituri Date: Mon, 10 Feb 2025 13:52:49 -0300 Subject: [PATCH 6/6] update snap to contain warning --- tests/testthat/_snaps/reactable-server.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/testthat/_snaps/reactable-server.md b/tests/testthat/_snaps/reactable-server.md index cf89906..dbf16ff 100644 --- a/tests/testthat/_snaps/reactable-server.md +++ b/tests/testthat/_snaps/reactable-server.md @@ -29,6 +29,10 @@ Code reactable_extras_ui("test") + Condition + Warning in `reactable_extras_ui()`: + `reactable::reactable` now has a `server = TRUE` argument. + Please use 'reactable' directly instead of this module. Output