Skip to content

Commit

Permalink
runExample is now deprecated, use shiny::runExample instead; fixes #127
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Jun 1, 2024
1 parent 64f5a08 commit 943a992
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyjs
Title: Easily Improve the User Experience of Your Shiny Apps in Seconds
Version: 2.1.0.9005
Version: 2.1.0.9006
Authors@R: person("Dean", "Attali",
email = "daattali@gmail.com",
role = c("aut", "cre"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased version

- **BREAKING CHANGE** The `useShinyjs()` function no longer accepts any parameters. The `rmd` and `html` arguments are not needed (they are now detected automatically). The `debug` argument is now set using R options: `options("shinyjs.debug" = TRUE)`.
- **DEPRECATION NOTICE** The `runExample()` function is no longer required since {shiny} version 1.8.1 (March 2024). You can now use `shiny::runExample("demo", package = "shinyjs")` instead of `shinyjs::runExample("demo")`.
- Fix bug: `hidden()` and `disabled()` now work with tags that have a `htmlDependency()` (#252)
- Fix bug: `hidden()` and `disabled()` now return a `tagList()` instead of a `list()` when appropriate
- Fix bug: `disable()` now works with file inputs (#249)
Expand Down
14 changes: 10 additions & 4 deletions R/runExample.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#' Run shinyjs examples
#' Run shinyjs examples \[DEPRECATED\]
#'
#' Launch a \code{shinyjs} example Shiny app that shows how to
#' easily use \code{shinyjs} in an app.\cr\cr
#' Run without any arguments to see a list of available example apps.
#' The "demo" example is also
#' \href{https://daattali.com/shiny/shinyjs-demo/}{available online}
#' to experiment with.
#' to experiment with.\cr\cr
#' **Deprecation Notice:** This function is no longer required since Shiny version
#' 1.8.1 (March 2024). This function will be removed in a future release of \{shinyjs\}.
#' You can use `shiny::runExample("demo", package = "shinyjs")` instead of
#' `shinyjs::runExample("demo")`.
#'
#' @param example The app to launch
#' @examples
Expand All @@ -19,11 +23,13 @@
#' }
#' @export
runExample <- function(example) {
message("WARNING: `shinyjs::runExample()` is deprecated. Please upgrade to {shiny} version 1.8.1 ",
"and use `shiny::runExample(package = \"shinyjs\")` instead.\n")

validExamples <-
paste0(
'Valid examples are: "',
paste(list.files(system.file("examples", package = "shinyjs")),
paste(list.files(system.file("examples-shiny", package = "shinyjs")),
collapse = '", "'),
'"')

Expand All @@ -34,7 +40,7 @@ runExample <- function(example) {
return(invisible(NULL))
}

appDir <- system.file("examples", example,
appDir <- system.file("examples-shiny", example,
package = "shinyjs")
if (appDir == "") {
errMsg(sprintf("could not find example app `%s`\n%s",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
8 changes: 6 additions & 2 deletions man/runExample.Rd

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

0 comments on commit 943a992

Please sign in to comment.