Compare commits

..

1 Commits

Author SHA1 Message Date
Barret Schloerke
7c71c369a0 Only do logic if there is SOMETHING, not NOTHING 2021-08-02 22:17:14 -04:00
43 changed files with 200 additions and 273 deletions

View File

@@ -1,73 +1,37 @@
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
name: R-CMD-check
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
- rc-v**
name: R-CMD-check
jobs:
rversions:
name: R Versions
runs-on: ubuntu-latest
outputs:
devel: ${{ steps.devel.outputs.installed-r-version }}
release: ${{ steps.release.outputs.installed-r-version }}
oldrel1: ${{ steps.oldrel1.outputs.installed-r-version }}
oldrel2: ${{ steps.oldrel2.outputs.installed-r-version }}
oldrel3: ${{ steps.oldrel3.outputs.installed-r-version }}
oldrel4: ${{ steps.oldrel4.outputs.installed-r-version }}
steps:
- { name: devel, uses: r-lib/actions/setup-r@master, id: devel, with: { r-version: devel, install-r: false }}
- { name: release, uses: r-lib/actions/setup-r@master, id: release, with: { r-version: release, install-r: false }}
- { name: oldrel/1, uses: r-lib/actions/setup-r@master, id: oldrel1, with: { r-version: oldrel/1, install-r: false }}
- { name: oldrel/2, uses: r-lib/actions/setup-r@master, id: oldrel2, with: { r-version: oldrel/2, install-r: false }}
- { name: oldrel/3, uses: r-lib/actions/setup-r@master, id: oldrel3, with: { r-version: oldrel/3, install-r: false }}
- { name: oldrel/4, uses: r-lib/actions/setup-r@master, id: oldrel4, with: { r-version: oldrel/4, install-r: false }}
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
needs:
- rversions
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: '${{ needs.rversions.outputs.release }}'}
- {os: windows-latest, r: '${{ needs.rversions.outputs.release }}'}
- {os: windows-latest, r: '3.6'}
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.devel }}', http-user-agent: "release" }
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.release }}'}
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel1 }}'}
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel2 }}'}
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel3 }}'}
- {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel4 }}'}
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.devel }}', http-user-agent: "release" }
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.release }}'}
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel1 }}'}
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel2 }}'}
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel3 }}'}
- {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel4 }}'}
- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: '4.0'}
- {os: windows-latest, r: '4.0'}
- {os: ubuntu-16.04, r: '4.0', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
env:
_R_CHECK_FORCE_SUGGESTS_: false
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
@@ -80,18 +44,38 @@ jobs:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@master
id: install-r
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-r-dependencies@v1
- name: Install pak and query dependencies
shell: Rscript {0}
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds")
- name: Cache R packages
uses: actions/cache@v2
with:
extra-packages: rcmdcheck
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
- name: Install system dependencies
if: runner.os == 'Linux'
shell: Rscript {0}
run: |
pak::local_system_requirements(execute = TRUE)
# https://stackoverflow.com/a/66568545/591574
#> fatal error: 'X11/Intrinsic.h' file not found
- name: Install Cairo macOS R devel dependency
if: runner.os == 'macOS' && matrix.config.r == 'devel'
run: |
brew install libxt
# xquartz and cairo are needed for Cairo package.
# harfbuzz and fribidi are needed for textshaping package.
@@ -102,6 +86,20 @@ jobs:
brew install cairo
brew install harfbuzz fribidi
# Use a shorter temp directory for pak installations, due to filename
# length issues on Windows. https://github.com/r-lib/pak/issues/252
- name: Windows temp dir
if: runner.os == 'Windows'
run: |
New-Item -Path "C:\" -Name "tmp" -ItemType Directory
echo "TMPDIR=c:\tmp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("rcmdcheck")
shell: Rscript {0}
- name: Find PhantomJS path
id: phantomjs
run: |
@@ -117,13 +115,18 @@ jobs:
Rscript
-e "if (!shinytest::dependenciesInstalled()) shinytest::installDependencies()"
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: ${{ matrix.config.r != 'devel' }}
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
@@ -133,7 +136,15 @@ jobs:
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
path: check
- name: Fix path for Windows caching
if: runner.os == 'Windows'
# This is needed because if you use the default tar at this stage,
# C:/Rtools/bin/tar.exe, it will say that it can't find gzip.exe. So
# we'll just set the path so that the original tar that would be
# found, will be found.
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH

View File

@@ -12,14 +12,15 @@ name: Rituals
jobs:
rituals:
name: Rituals
# if: false
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-20.04, r: 'release', node: "14.x", rspm: "https://packagemanager.rstudio.com/all/__linux__/focal/latest"}
- { os: ubuntu-16.04, r: '4.0', node: "14.x", rspm: "https://packagemanager.rstudio.com/all/__linux__/xenial/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
@@ -158,7 +159,7 @@ jobs:
if: github.event_name == 'push'
run: |
# Can't push to a protected branch
if [ -n "`git cherry origin/master`" ]; then
if [ -n "`git cherry origin/master`"]; then
echo "Un-pushed commits:"
git cherry -v origin/master
echo "\nCan not push to a protected branch. Exiting"

2
.gitignore vendored
View File

@@ -12,7 +12,7 @@ README.html
tools/yarn-error.log
# TypeScript / yarn
/node_modules/
node_modules/
.cache
.yarn/*
!.yarn/releases

View File

@@ -1,7 +1,7 @@
Package: shiny
Type: Package
Title: Web Application Framework for R
Version: 1.7.1
Version: 1.6.0.9022
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "winston@rstudio.com", comment = c(ORCID = "0000-0002-1576-2126")),
person("Joe", "Cheng", role = "aut", email = "joe@rstudio.com"),
@@ -79,7 +79,7 @@ Imports:
jsonlite (>= 0.9.16),
xtable,
fontawesome (>= 0.2.1),
htmltools (>= 0.5.2),
htmltools (>= 0.5.1.9003),
R6 (>= 2.0),
sourcetools,
later (>= 1.0.0),
@@ -91,7 +91,7 @@ Imports:
withr,
commonmark (>= 1.7),
glue (>= 1.3.2),
bslib (>= 0.3.0),
bslib (>= 0.2.5.9002),
cachem,
ellipsis,
lifecycle (>= 0.2.0)
@@ -112,6 +112,10 @@ Suggests:
ragg,
showtext,
sass
Remotes:
r-lib/rlang,
rstudio/bslib,
rstudio/htmltools
URL: https://shiny.rstudio.com/
BugReports: https://github.com/rstudio/shiny/issues
Collate:
@@ -201,7 +205,7 @@ Collate:
'version_selectize.R'
'version_strftime.R'
'viewer.R'
RoxygenNote: 7.1.2
RoxygenNote: 7.1.1
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RdMacros: lifecycle

24
NEWS.md
View File

@@ -1,15 +1,5 @@
shiny 1.7.1
===========
## Bug Fixes
* Closed #3516: Fix regression in repeated calls to `appendTab()` when `navbarMenu()` is already present within a `tabsetPanel()`/`navbarPage()`. (#3518)
* Re-arranged conditions for testthat 1.0.0 compatibility. (#3512)
shiny 1.7.0
===========
shiny 1.6.0.9000
================
## Full changelog
@@ -28,7 +18,7 @@ shiny 1.7.0
* All uses of `list(...)` have been replaced with `rlang::list2(...)`. This means that you can use trailing `,` without error and use rlang's `!!!` operator to "splice" a list of argument values into `...`. We think this'll be particularly useful for passing a list of `tabPanel()` to their consumers (i.e., `tabsetPanel()`, `navbarPage()`, etc). For example, `tabs <- list(tabPanel("A", "a"), tabPanel("B", "b")); navbarPage(!!!tabs)`. (#3315 and #3328)
* `installExprFunction()` and `exprToFunction()` are now able to handle quosures when `quoted = TRUE`. So `render`-functions which call these functions (such as with `htmlwidgets`) can now understand quosures. Users can also use `rlang::inject()` to unquote a quosure for evaluation. This also means that `render` function no longer need `env` and `quoted` parameters; that information can be embedded into a quosure which is then passed to the `render` function. Better documentation was added for how to create `render` functions. (#3472)
* `installExprFunction()` and `exprToFunction()` are now able to handle quosures, so `render`-functions which call these functions can now understand quosures, when they are called using `rlang::inject()`. This also means that `render` function no longer need `env` and `quoted` parameters; that information can be embedded into a quosure which is then passed to the `render` function. Additionally, the `getQuosure()` function was added, which makes it easier for developers to create `render` functions which understand quosures. Better documentation was added for how to create `render` functions. (#3462, #3466)
* `icon(lib="fontawesome")` is now powered by the `{fontawesome}` package, which will make it easier to use the latest FA icons in the future (by updating the `{fontawesome}` package). (#3302)
@@ -54,12 +44,10 @@ shiny 1.7.0
* Fixed [#2666](https://github.com/rstudio/shiny/issues/2666) and [#2670](https://github.com/rstudio/shiny/issues/2670): `nearPoints()` and `brushedPoints()` weren't properly account for missing values (#2666 was introduced in v1.4.0). ([#2668](https://github.com/rstudio/shiny/pull/2668))
* 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)
* 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)
* Exported `register_devmode_option()`. This method was described in the documentation for `devmode()` but was never exported. See `?devmode()` for more details on how to register Shiny Developer options using `register_devmode_option()`. (#3364)
* Closed #3484: In the RStudio IDE on Mac 11.5, selected checkboxes and radio buttons were not visible. (#3485)
### Library updates
* Closed #3286: Updated to Font-Awesome 5.15.2. (#3288)
@@ -73,7 +61,7 @@ This release focuses on improvements in three main areas:
1. Better theming (and Bootstrap 4) support:
* The `theme` argument of `fluidPage()`, `navbarPage()`, and `bootstrapPage()` all now understand `bslib::bs_theme()` objects, which can be used to opt-into Bootstrap 4, use any Bootswatch theme, and/or implement custom themes without writing any CSS.
* The `session` object now includes `$setCurrentTheme()` and `$getCurrentTheme()` methods to dynamically update (or obtain) the page's `theme` after initial load, which is useful for things such as [adding a dark mode switch to an app](https://rstudio.github.io/bslib/articles/bslib.html#dynamic) or some other "real-time" theming tool like `bslib::bs_themer()`.
* The `session` object now includes `$setCurrentTheme()` and `$getCurrentTheme()` methods to dynamically update (or obtain) the page's `theme` after initial load, which is useful for things such as [adding a dark mode switch to an app](https://rstudio.github.io/bslib/articles/theming.html#dynamic-shiny) or some other "real-time" theming tool like `bslib::bs_themer()`.
* For more details, see [`{bslib}`'s website](https://rstudio.github.io/bslib/)
2. Caching of `reactive()` and `render*()` (e.g. `renderText()`, `renderTable()`, etc) expressions.
@@ -195,7 +183,7 @@ shiny 1.5.0
* The new `moduleServer` function provides a simpler interface for creating and using modules. (#2773)
* Resolved #2732: `markdown()` is a new function for writing Markdown with Github extensions directly in Shiny UIs. Markdown rendering is performed by the [commonmark](https://github.com/r-lib/commonmark) package. (#2737)
* Resolved #2732: `markdown()` is a new function for writing Markdown with Github extensions directly in Shiny UIs. Markdown rendering is performed by the [commonmark](https://github.com/jeroen/commonmark) package. (#2737)
* The `getCurrentOutputInfo()` function can now return the background color (`bg`), foreground color (`fg`), `accent` (i.e., hyperlink) color, and `font` information of the output's HTML container. This information is reported by `plotOutput()`, `imageOutput()`, and any other output bindings containing a class of `.shiny-report-theme`. This feature allows developers to style an output's contents based on the container's CSS styling. (#2740)

View File

@@ -255,7 +255,7 @@ utils::globalVariables(".GenericCallEnv", add = TRUE)
#' the cache.
#'
#' You may need to provide a `cacheHint` to [createRenderFunction()] (or
#' `htmlwidgets::shinyRenderWidget()`, if you've authored an htmlwidget) in
#' [htmlwidgets::shinyRenderWidget()], if you've authored an htmlwidget) in
#' order for `bindCache()` to correctly compute a cache key.
#'
#' The potential problem is a cache collision. Consider the following:

View File

@@ -1,6 +1,6 @@
####
# Generated by `./tools/documentation/updateReexports.R`: do not edit by hand
# Please call `source('tools/documentation/updateReexports.R')` from the root folder to update`
# Generated by `./tools/updateReexports.R`: do not edit by hand
# Please call `source('tools/updateReexports.R') from the root folder to update`
####
@@ -90,20 +90,17 @@ htmltools::em
#' @export
htmltools::hr
# htmltools tag.Rd -------------------------------------------------------------
#' @importFrom htmltools tag
#' @export
htmltools::tag
# htmltools tagList.Rd ---------------------------------------------------------
#' @importFrom htmltools tagList
#' @export
htmltools::tagList
# htmltools tagAppendAttributes.Rd ---------------------------------------------
#' @importFrom htmltools tagAppendAttributes
#' @export
htmltools::tagAppendAttributes
@@ -116,9 +113,6 @@ htmltools::tagHasAttribute
#' @export
htmltools::tagGetAttribute
# htmltools tagAppendChild.Rd --------------------------------------------------
#' @importFrom htmltools tagAppendChild
#' @export
htmltools::tagAppendChild

View File

@@ -181,7 +181,7 @@
#' # At the top of app.R, this set the application-scoped cache to be a disk
#' # cache that can be shared among multiple concurrent R processes, and is
#' # deleted when the system reboots.
#' shinyOptions(cache = cachem::cache_disk(file.path(dirname(tempdir()), "myapp-cache")))
#' shinyOptions(cache = cachem::cache_disk(file.path(dirname(tempdir()), "myapp-cache"))
#'
#' # At the top of app.R, this set the application-scoped cache to be a disk
#' # cache that can be shared among multiple concurrent R processes, and

View File

@@ -41,9 +41,9 @@ inputHandlers <- Map$new()
#' })
#'
#' ## On the Javascript side, the associated input binding must have a corresponding getType method:
#' # getType: function(el) {
#' # return "mypackage.validint";
#' # }
#' getType: function(el) {
#' return "mypackage.validint";
#' }
#'
#' }
#' @seealso [removeInputHandler()] [applyInputHandlers()]

View File

@@ -822,9 +822,7 @@ downloadHandler <- function(filename, content, contentType=NA, outputArgs=list()
#' Table output with the JavaScript DataTables library
#'
#' @description
#' `r lifecycle::badge("superseded")` Please use
#' \href{https://rstudio.github.io/DT/shiny.html}{\code{DT::renderDataTable()}}.
#' (Shiny 0.11.1)
#' `r lifecycle::badge("superseded")` Please use [`DT::renderDataTable()`]. (Shiny 0.11.1)
#'
#' Makes a reactive version of the given function that returns a data frame (or
#' matrix), which will be rendered with the [DataTables](https://datatables.net)

View File

@@ -1,3 +1,3 @@
/*! shiny 1.7.0 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.6.0.9022 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
(function(){var t="ws:";window.location.protocol==="https:"&&(t="wss:");var o=window.location.pathname;/\/$/.test(o)||(o+="/");o+="autoreload/";var n=new WebSocket(t+"//"+window.location.host+o);n.onmessage=function(a){a.data==="autoreload"&&window.location.reload()};})();
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjdHMvZXh0cmFzL3NoaW55LWF1dG9yZWxvYWQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qIGVzbGludC1kaXNhYmxlIHVuaWNvcm4vZmlsZW5hbWUtY2FzZSAqL1xudmFyIHByb3RvY29sID0gXCJ3czpcIjtcbmlmICh3aW5kb3cubG9jYXRpb24ucHJvdG9jb2wgPT09IFwiaHR0cHM6XCIpIHByb3RvY29sID0gXCJ3c3M6XCI7XG52YXIgZGVmYXVsdFBhdGggPSB3aW5kb3cubG9jYXRpb24ucGF0aG5hbWU7XG5pZiAoIS9cXC8kLy50ZXN0KGRlZmF1bHRQYXRoKSkgZGVmYXVsdFBhdGggKz0gXCIvXCI7XG5kZWZhdWx0UGF0aCArPSBcImF1dG9yZWxvYWQvXCI7XG52YXIgd3MgPSBuZXcgV2ViU29ja2V0KHByb3RvY29sICsgXCIvL1wiICsgd2luZG93LmxvY2F0aW9uLmhvc3QgKyBkZWZhdWx0UGF0aCk7XG5cbndzLm9ubWVzc2FnZSA9IGZ1bmN0aW9uIChldmVudCkge1xuICBpZiAoZXZlbnQuZGF0YSA9PT0gXCJhdXRvcmVsb2FkXCIpIHtcbiAgICB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCk7XG4gIH1cbn07XG5cbmV4cG9ydCB7fTsiXSwKICAibWFwcGluZ3MiOiAiO1lBQ0EsR0FBSSxHQUFXLE1BQ2YsQUFBSSxPQUFPLFNBQVMsV0FBYSxVQUFVLEdBQVcsUUFDdEQsR0FBSSxHQUFjLE9BQU8sU0FBUyxTQUNsQyxBQUFLLE1BQU0sS0FBSyxJQUFjLElBQWUsS0FDN0MsR0FBZSxjQUNmLEdBQUksR0FBSyxHQUFJLFdBQVUsRUFBVyxLQUFPLE9BQU8sU0FBUyxLQUFPLEdBRWhFLEVBQUcsVUFBWSxTQUFVLEVBQU8sQ0FDOUIsQUFBSSxFQUFNLE9BQVMsY0FDakIsT0FBTyxTQUFTIiwKICAibmFtZXMiOiBbXQp9Cg==

View File

@@ -1,2 +1,2 @@
/*! shiny 1.7.0 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.6.0.9022 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
#showcase-well{border-radius:0}.shiny-code{background-color:#fff;margin-bottom:0}.shiny-code code{font-family:Menlo,Consolas,"Courier New",monospace}.shiny-code-container{margin-top:20px;clear:both}.shiny-code-container h3{display:inline;margin-right:15px}.showcase-header{font-size:16px;font-weight:normal}.showcase-code-link{text-align:right;padding:15px}#showcase-app-container{vertical-align:top}#showcase-code-tabs{margin-right:15px}#showcase-code-tabs pre{border:none;line-height:1em}#showcase-code-tabs .nav{margin-bottom:0}#showcase-code-tabs ul{margin-bottom:0}#showcase-code-tabs .tab-content{border-style:solid;border-color:#e5e5e5;border-width:0px 1px 1px 1px;overflow:auto;border-bottom-right-radius:4px;border-bottom-left-radius:4px}#showcase-app-code{width:100%}#showcase-code-position-toggle{float:right}#showcase-sxs-code{padding-top:20px;vertical-align:top}.showcase-code-license{display:block;text-align:right}#showcase-code-content pre{background-color:#fff}

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
/*! shiny 1.7.0 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.6.0.9022 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
(function(){var a=eval;window.addEventListener("message",function(i){var e=i.data;e.code&&a(e.code)});})();
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjdHMvc3JjL3V0aWxzL2V2YWwudHMiLCAiLi4vLi4vLi4vc3JjdHMvZXh0cmFzL3NoaW55LXRlc3Rtb2RlLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvL2VzYnVpbGQuZ2l0aHViLmlvL2NvbnRlbnQtdHlwZXMvI2RpcmVjdC1ldmFsXG4vL3RsL2RyO1xuLy8gKiBEaXJlY3QgdXNhZ2Ugb2YgYGV2YWwoXCJ4XCIpYCBpcyBiYWQgd2l0aCBidW5kbGVkIGNvZGUuXG4vLyAqIEluc3RlYWQsIHVzZSBpbmRpcmVjdCBjYWxscyB0byBgZXZhbGAgc3VjaCBhcyBgaW5kaXJlY3RFdmFsKFwieFwiKWBcbi8vICAgKiBFdmVuIGp1c3QgcmVuYW1pbmcgdGhlIGZ1bmN0aW9uIHdvcmtzIHdlbGwgZW5vdWdoLlxuLy8gPiBUaGlzIGlzIGtub3duIGFzIFwiaW5kaXJlY3QgZXZhbFwiIGJlY2F1c2UgZXZhbCBpcyBub3QgYmVpbmcgY2FsbGVkIGRpcmVjdGx5LCBhbmQgc28gZG9lcyBub3QgdHJpZ2dlciB0aGUgZ3JhbW1hdGljYWwgc3BlY2lhbCBjYXNlIGZvciBkaXJlY3QgZXZhbCBpbiB0aGUgSmF2YVNjcmlwdCBWTS4gWW91IGNhbiBjYWxsIGluZGlyZWN0IGV2YWwgdXNpbmcgYW55IHN5bnRheCBhdCBhbGwgZXhjZXB0IGZvciBhbiBleHByZXNzaW9uIG9mIHRoZSBleGFjdCBmb3JtIGV2YWwoJ3gnKS4gRm9yIGV4YW1wbGUsIHZhciBldmFsMiA9IGV2YWw7IGV2YWwyKCd4JykgYW5kIFtldmFsXVswXSgneCcpIGFuZCB3aW5kb3cuZXZhbCgneCcpIGFyZSBhbGwgaW5kaXJlY3QgZXZhbCBjYWxscy5cbi8vID4gV2hlbiB5b3UgdXNlIGluZGlyZWN0IGV2YWwsIHRoZSBjb2RlIGlzIGV2YWx1YXRlZCBpbiB0aGUgZ2xvYmFsIHNjb3BlIGluc3RlYWQgb2YgaW4gdGhlIGlubGluZSBzY29wZSBvZiB0aGUgY2FsbGVyLlxudmFyIGluZGlyZWN0RXZhbCA9IGV2YWw7XG5leHBvcnQgeyBpbmRpcmVjdEV2YWwgfTsiLCAiLyogZXNsaW50LWRpc2FibGUgdW5pY29ybi9maWxlbmFtZS1jYXNlICovXG5pbXBvcnQgeyBpbmRpcmVjdEV2YWwgfSBmcm9tIFwiLi4vc3JjL3V0aWxzL2V2YWxcIjsgLy8gTGlzdGVuIGZvciBtZXNzYWdlcyBmcm9tIHBhcmVudCBmcmFtZS4gVGhpcyBmaWxlIGlzIG9ubHkgYWRkZWQgd2hlbiB0aGVcbi8vIHNoaW55LnRlc3Rtb2RlIG9wdGlvbiBpcyBUUlVFLlxuXG53aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcihcIm1lc3NhZ2VcIiwgZnVuY3Rpb24gKGUpIHtcbiAgdmFyIG1lc3NhZ2UgPSBlLmRhdGE7XG4gIGlmIChtZXNzYWdlLmNvZGUpIGluZGlyZWN0RXZhbChtZXNzYWdlLmNvZGUpO1xufSk7Il0sCiAgIm1hcHBpbmdzIjogIjtZQU9BLEdBQUksR0FBZSxLQ0huQixPQUFPLGlCQUFpQixVQUFXLFNBQVUsRUFBRyxDQUM5QyxHQUFJLEdBQVUsRUFBRSxLQUNoQixBQUFJLEVBQVEsTUFBTSxFQUFhLEVBQVEiLAogICJuYW1lcyI6IFtdCn0K

View File

@@ -1,4 +1,4 @@
/*! shiny 1.7.0 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.6.0.9022 | (c) 2012-2021 RStudio, PBC. | License: GPL-3 | file LICENSE */
(function() {
var __create = Object.create;
var __defProp = Object.defineProperty;
@@ -2877,9 +2877,6 @@
} else {
setIsQt(false);
}
if (/\bQt/.test(userAgent) && /\bMacintosh/.test(userAgent)) {
(0, import_jquery3.default)(document.documentElement).addClass("qtmac");
}
if (/\bQt\/5/.test(userAgent) && /Linux/.test(userAgent)) {
(0, import_jquery3.default)(document.documentElement).addClass("qt5");
}
@@ -12818,8 +12815,8 @@
}
function getTabIndex($tabset2, tabsetId2) {
var existingTabIds = [0];
$tabset2.find("> li").each(function() {
var $tab = (0, import_jquery41.default)(this).find("> a[data-toggle='tab']");
$tabset2.find("a[data-toggle='tab']").each(function() {
var $tab = (0, import_jquery41.default)(this);
if ($tab.length > 0) {
var href = $tab.attr("href").replace(/.*(?=#[^\s]+$)/, "");
var _index = href.replace("#tab-" + tabsetId2 + "-", "");
@@ -13248,6 +13245,7 @@
(0, import_jquery42.default)(document).one("shiny:connected", function() {
initDeferredIframes();
});
window.console.log("Shiny version: ", windowShiny3.version);
}
function initDeferredIframes() {
if (!window.Shiny || !window.Shiny.shinyapp || !window.Shiny.shinyapp.isConnected()) {
@@ -13265,7 +13263,7 @@
var windowShiny2;
function setShiny(windowShiny_) {
windowShiny2 = windowShiny_;
windowShiny2.version = "1.7.0";
windowShiny2.version = "1.6.0.9022";
var _initInputBindings = initInputBindings(), inputBindings = _initInputBindings.inputBindings, fileInputBinding2 = _initInputBindings.fileInputBinding;
var _initOutputBindings = initOutputBindings(), outputBindings = _initOutputBindings.outputBindings;
setFileInputBinding(fileInputBinding2);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -295,15 +295,6 @@ pre.shiny-text-output {
margin-top: 0px;
}
/* Workaround for radio buttons and checkboxes not showing on Qt on Mac.
This occurs in the RStudio IDE on macOS 11.5.
https://github.com/rstudio/shiny/issues/3484
*/
.qtmac input[type="radio"],
.qtmac input[type="checkbox"] {
zoom: 1.0000001;
}
/* consistency with bootstrap.css for selectize.js */
.selectize-control {
margin-bottom: 10px;

View File

@@ -40,7 +40,7 @@ sense, namely:
In the example here, the \code{bindCache()} key consists of \code{input$x} and
\code{input$y} combined, and the value is \code{input$x * input$y}. In this simple
example, for any given key, there is only one possible returned value.\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- reactive(\{ input$x * input$y \}) \%>\%
example, for any given key, there is only one possible returned value.\if{html}{\out{<div class="NA">}}\preformatted{r <- reactive(\{ input$x * input$y \}) \%>\%
bindCache(input$x, input$y)
}\if{html}{\out{</div>}}
@@ -63,7 +63,7 @@ to do some sort of reduction on the data that still captures information
about whether a value can be retrieved from the cache. For example, if you
have a large data set with timestamps, it might make sense to extract the
most recent timestamp and return that. Then, instead of hashing the entire
data object, the cached reactive only needs to hash the timestamp.\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- reactive(\{ compute(bigdata()) \} \%>\%
data object, the cached reactive only needs to hash the timestamp.\if{html}{\out{<div class="NA">}}\preformatted{r <- reactive(\{ compute(bigdata()) \} \%>\%
bindCache(\{ extract_most_recent_time(bigdata()) \})
}\if{html}{\out{</div>}}
@@ -105,7 +105,7 @@ cache key is not too expensive.
Remember that the key is \emph{reactive}, so it is not re-executed every single
time that someone accesses the cached reactive. It is only re-executed if
it has been invalidated by one of the reactives it depends on. For
example, suppose we have this cached reactive:\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- reactive(\{ input$x * input$y \}) \%>\%
example, suppose we have this cached reactive:\if{html}{\out{<div class="NA">}}\preformatted{r <- reactive(\{ input$x * input$y \}) \%>\%
bindCache(input$x, input$y)
}\if{html}{\out{</div>}}
@@ -244,7 +244,7 @@ cache collisions, dealing with internal state that may be set by the,
the cache.
You may need to provide a \code{cacheHint} to \code{\link[=createRenderFunction]{createRenderFunction()}} (or
\code{htmlwidgets::shinyRenderWidget()}, if you've authored an htmlwidget) in
\code{\link[htmlwidgets:htmlwidgets-shiny]{htmlwidgets::shinyRenderWidget()}}, if you've authored an htmlwidget) in
order for \code{bindCache()} to correctly compute a cache key.
The potential problem is a cache collision. Consider the following:\preformatted{output$x1 <- renderText(\{ input$x \}) \%>\% bindCache(input$x)
@@ -258,7 +258,7 @@ this, a \emph{cache hint} is automatically added when \code{\link[=renderText]{r
\code{\link[=createRenderFunction]{createRenderFunction()}}. The cache hint is used as part of the actual
cache key, in addition to the one passed to \code{bindCache()} by the user. The
cache hint can be viewed by calling the internal Shiny function
\code{extractCacheHint()}:\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- renderText(\{ input$x \})
\code{extractCacheHint()}:\if{html}{\out{<div class="NA">}}\preformatted{r <- renderText(\{ input$x \})
shiny:::extractCacheHint(r)
}\if{html}{\out{</div>}}

View File

@@ -171,7 +171,7 @@ user sets both \code{x} and \code{y}, and then clicks on an \link{actionButton}
\code{go}.
To use both caching and events, the object should first be passed to
\code{bindCache()}, then \code{bindEvent()}. For example:\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- reactive(\{
\code{bindCache()}, then \code{bindEvent()}. For example:\if{html}{\out{<div class="NA">}}\preformatted{r <- reactive(\{
Sys.sleep(2) # Pretend this is an expensive computation
input$x * input$y
\}) \%>\%

View File

@@ -101,7 +101,7 @@ displays a message once every 8 hrs (by default)
value and Developer message. This registration method allows package
authors to write one message in a single location.
For example, the following Shiny Developer Mode options are registered:\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Reload the Shiny app when a sourced R file changes
For example, the following Shiny Developer Mode options are registered:\if{html}{\out{<div class="r">}}\preformatted{# Reload the Shiny app when a sourced R file changes
register_devmode_option(
"shiny.autoreload",
"Turning on shiny autoreload. To disable, call `options(shiny.autoreload = FALSE)`",
@@ -126,7 +126,7 @@ register_devmode_option(
Other known, non-Shiny Developer Mode options:
\itemize{
\item Sass:
}\if{html}{\out{<div class="sourceCode r">}}\preformatted{# Display the full stack trace when errors occur during Shiny app execution
}\if{html}{\out{<div class="r">}}\preformatted{# Display the full stack trace when errors occur during Shiny app execution
register_devmode_option(
"sass.cache",
"Turning off sass cache. To use default caching, call `options(sass.cache = TRUE)`",
@@ -165,7 +165,7 @@ re-implementing these two functions:
This function should return \code{TRUE} if \code{getOption("shiny.devmode")} is set.
In addition, we strongly recommend that it also checks to make sure
\code{testthat} is not testing.\if{html}{\out{<div class="sourceCode r">}}\preformatted{in_devmode <- function() \{
\code{testthat} is not testing.\if{html}{\out{<div class="r">}}\preformatted{in_devmode <- function() \{
isTRUE(getOption("shiny.devmode", FALSE)) &&
!identical(Sys.getenv("TESTTHAT"), "true")
\}
@@ -201,7 +201,7 @@ recommend displaying a message (\code{devmode_message}) to \code{stderr()} once
hours using \code{\link[rlang:abort]{rlang::inform()}}. This will keep the author up to date as to
which Dev Mode options are being altered. To allow developers a chance to
disable Dev Mode messages, the message should be skipped if
\code{getOption("shiny.devmode.verbose", TRUE)} is not \code{TRUE}.\if{html}{\out{<div class="sourceCode r">}}\preformatted{get_devmode_option <- function(name, default = NULL, devmode_default, devmode_message) \{
\code{getOption("shiny.devmode.verbose", TRUE)} is not \code{TRUE}.\if{html}{\out{<div class="r">}}\preformatted{get_devmode_option <- function(name, default = NULL, devmode_default, devmode_message) \{
if (!in_devmode()) \{
# Dev Mode disabled, act like `getOption()`
return(getOption(name, default = default))

View File

@@ -51,9 +51,9 @@ registerInputHandler("mypackage.validint", function(x, shinysession, name) {
})
## On the Javascript side, the associated input binding must have a corresponding getType method:
# getType: function(el) {
# return "mypackage.validint";
# }
getType: function(el) {
return "mypackage.validint";
}
}
}

View File

@@ -219,7 +219,7 @@ shinyOptions(cache = cachem::cache_mem(max_size = 20e6, max_age = 3600))
# At the top of app.R, this set the application-scoped cache to be a disk
# cache that can be shared among multiple concurrent R processes, and is
# deleted when the system reboots.
shinyOptions(cache = cachem::cache_disk(file.path(dirname(tempdir()), "myapp-cache")))
shinyOptions(cache = cachem::cache_disk(file.path(dirname(tempdir()), "myapp-cache"))
# At the top of app.R, this set the application-scoped cache to be a disk
# cache that can be shared among multiple concurrent R processes, and

View File

@@ -63,9 +63,7 @@ call to \code{dataTableOutput()} when \code{renderDataTable()} is used
in an interactive R Markdown document.}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} Please use
\href{https://rstudio.github.io/DT/shiny.html}{\code{DT::renderDataTable()}}.
(Shiny 0.11.1)
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} Please use \code{\link[DT:renderDataTable]{DT::renderDataTable()}}. (Shiny 0.11.1)
Makes a reactive version of the given function that returns a data frame (or
matrix), which will be rendered with the \href{https://datatables.net}{DataTables}

View File

@@ -76,10 +76,10 @@ value when it is a single choice input and the empty string is not in the
The resulting server \code{input} value will be returned as:
\itemize{
\item A symbol if \code{multiple = FALSE}. The \code{input} value should be
used with rlang's \code{\link[rlang:nse-force]{rlang::!!()}}. For example,
used with rlang's \code{\link[rlang:bang-bang]{rlang::!!()}}. For example,
\code{ggplot2::aes(!!input$variable)}.
\item A list of symbols if \code{multiple = TRUE}. The \code{input} value
should be used with rlang's \code{\link[rlang:nse-force]{rlang::!!!()}} to expand
should be used with rlang's \code{\link[rlang:bang-bang]{rlang::!!!()}} to expand
the symbol list as individual arguments. For example,
\code{dplyr::select(mtcars, !!!input$variabls)} which is
equivalent to \code{dplyr::select(mtcars, !!input$variabls[[1]], !!input$variabls[[2]], ..., !!input$variabls[[length(input$variabls)]])}.

View File

@@ -3,7 +3,7 @@
"homepage": "https://shiny.rstudio.com",
"repository": "github:rstudio/shiny",
"name": "@types/rstudio-shiny",
"version": "1.7.0",
"version": "1.6.0-alpha.9022",
"license": "GPL-3.0-only",
"main": "",
"browser": "",

View File

@@ -70,7 +70,6 @@ async function build(
incremental: incremental,
watch: watch,
target: "es5",
preserveSymlinks: true,
...opts,
}).then((x) => {
onRebuild();

View File

@@ -37,12 +37,6 @@ function determineBrowserInfo(): void {
setIsQt(false);
}
// For Qt on Mac. Note that the target string as of RStudio 1.4.173
// is "QtWebEngine" and does not have a trailing slash.
if (/\bQt/.test(userAgent) && /\bMacintosh/.test(userAgent)) {
$(document.documentElement).addClass("qtmac");
}
// Enable special treatment for Qt 5 quirks on Linux
if (/\bQt\/5/.test(userAgent) && /Linux/.test(userAgent)) {
$(document.documentElement).addClass("qt5");

View File

@@ -517,7 +517,7 @@ function initShiny(windowShiny: Shiny): void {
initDeferredIframes();
});
// window.console.log("Shiny version: ", windowShiny.version);
window.console.log("Shiny version: ", windowShiny.version);
} // function initShiny()
// Give any deferred iframes a chance to load.

View File

@@ -1112,8 +1112,8 @@ class ShinyApp {
// loop through all existing tabs, find the one with highest id
// (since this is based on a numeric counter), and increment
$tabset.find("> li").each(function () {
const $tab = $(this).find("> a[data-toggle='tab']");
$tabset.find("a[data-toggle='tab']").each(function () {
const $tab = $(this);
if ($tab.length > 0) {
// remove leading url if it exists. (copy of bootstrap url stripper)

View File

@@ -7,7 +7,7 @@ server <- function(input, output, session) {
}
opts <- list(
port = as.numeric(Sys.getenv("SHINY_TESTTHAT_PORT_APP", "8080")),
port = 3030,
launch.browser = FALSE
)

View File

@@ -1,6 +1,6 @@
library(shiny)
op <- options(shiny.port = httpuv::randomPort())
op <- options(shiny.port = 7777)
onStop(function() { options(op) })
stop("boom")

View File

@@ -1,6 +1,6 @@
library(shiny)
op <- options(shiny.port = as.numeric(Sys.getenv("SHINY_TESTTHAT_PORT_OPTION", "8080")))
op <- options(shiny.port = 7777)
onStop(function() { options(op) })
ui <- fluidPage(

View File

@@ -1,6 +1 @@
shinyAppFile(
"wrapped.R",
options = list(
port = as.numeric(Sys.getenv("SHINY_TESTTHAT_PORT_WRAPPED2", "8080"))
)
)
shinyAppFile("wrapped.R", options = list(port = 3032))

View File

@@ -51,7 +51,8 @@ test_that("With ui/server.R, global.R is loaded before R/ helpers and into the r
}
# Temporarily opt-in to R/ file autoloading
withr::local_options(list(shiny.autoload.r=TRUE))
op <- options(shiny.autoload.r=TRUE)
on.exit(options(op), add=TRUE)
# + shinyAppDir_serverR
# +--- sourceUTF8
@@ -107,7 +108,9 @@ test_that("Loading supporting R files is opt-out", {
}
# Temporarily unset autoloading option
withr::local_options(list(shiny.autoload.r = NULL))
orig <- getOption("shiny.autoload.r", NULL)
options(shiny.autoload.r=NULL)
on.exit({options(shiny.autoload.r=orig)}, add=TRUE)
# + shinyAppDir_serverR
# +--- sourceUTF8
@@ -134,7 +137,9 @@ test_that("Disabling supporting R files works", {
}
# Temporarily unset autoloading option
withr::local_options(list(shiny.autoload.r = FALSE))
orig <- getOption("shiny.autoload.r", NULL)
options(shiny.autoload.r=FALSE)
on.exit({options(shiny.autoload.r=orig)}, add=TRUE)
# + shinyAppDir_serverR
# +--- sourceUTF8
@@ -160,7 +165,9 @@ test_that("app.R is loaded after R/ helpers and into the right envs", {
}
# Temporarily opt-in to R/ file autoloading
withr::local_options(list(shiny.autoload.r = TRUE))
orig <- getOption("shiny.autoload.r", NULL)
options(shiny.autoload.r=TRUE)
on.exit({options(shiny.autoload.r=orig)}, add=TRUE)
# + shinyAppDir_serverR
# +--- sourceUTF8
@@ -201,80 +208,54 @@ test_that("global.R and sources in R/ are sourced in the app directory", {
})
test_that("Setting options in various places works", {
withr::local_options(list(shiny.launch.browser = FALSE))
# Use random ports to avoid errors while running revdepcheck in parallel
# https://github.com/rstudio/shiny/pull/3488
# Try up to 100 times to find a unique port
for (i in 1:100) {
test_app_port <- httpuv::randomPort()
test_wrapped2_port <- httpuv::randomPort()
test_option_port <- httpuv::randomPort()
# If all ports are unique, move on
if (length(unique(
c(test_app_port, test_wrapped2_port, test_option_port)
)) == 3) {
break
}
}
# Use system envvars to pass values into the tests
withr::local_envvar(
list(
SHINY_TESTTHAT_PORT_APP = as.character(test_app_port),
SHINY_TESTTHAT_PORT_WRAPPED2 = as.character(test_wrapped2_port),
SHINY_TESTTHAT_PORT_OPTION = as.character(test_option_port)
)
)
op <- options(shiny.launch.browser = FALSE)
on.exit(options(op), add = TRUE)
appDir <- test_path("../test-helpers/app7-port")
withPort <- function(port, expr) {
withr::local_options(list(app7.port = port))
op <- options(app7.port = port)
on.exit(options(op), add = TRUE)
force(expr)
}
expect_port <- function(expr, port) {
later::later(~stopApp(), 0)
testthat::expect_message(expr, paste0("Listening on http://127.0.0.1:", port), fixed = TRUE)
expect_message(expr, paste0("Listening on http://127.0.0.1:", port), fixed = TRUE)
}
expect_port(runApp(appDir), test_app_port)
expect_port(runApp(appDir), 3030)
appObj <- source(file.path(appDir, "app.R"))$value
expect_port(print(appObj), test_app_port)
expect_port(print(appObj), 3030)
appObj <- shinyAppDir(appDir)
expect_port(print(appObj), test_app_port)
expect_port(print(appObj), 3030)
# The outermost call (shinyAppDir) has its options take precedence over the
# options in the inner call (shinyApp in app7-port/app.R).
options_port <- httpuv::randomPort()
appObj <- shinyAppDir(appDir, options = list(port = options_port))
expect_port(print(appObj), options_port)
expect_port(runApp(appObj), options_port)
appObj <- shinyAppDir(appDir, options = list(port = 4040))
expect_port(print(appObj), 4040)
expect_port(runApp(appObj), 4040)
# Options set directly on the runApp call take precedence over everything.
provided_port <- httpuv::randomPort()
expect_port(runApp(appObj, port = provided_port), provided_port)
expect_port(runApp(appObj, port = 5050), 5050)
# wrapped.R calls shinyAppDir("app.R")
expect_port(runApp(file.path(appDir, "wrapped.R")), test_app_port)
expect_port(runApp(file.path(appDir, "wrapped.R")), 3030)
# wrapped2.R calls shinyAppFile("wrapped.R", options = list(port = 3032))
expect_port(runApp(file.path(appDir, "wrapped2.R")), test_wrapped2_port)
expect_port(runApp(file.path(appDir, "wrapped2.R")), 3032)
shiny_port_orig <- getOption("shiny.port")
# Calls to options(shiny.port = xxx) within app.R should also work reliably
expect_port(runApp(file.path(appDir, "option.R")), test_option_port)
expect_port(runApp(file.path(appDir, "option.R")), 7777)
# Ensure that option was unset/restored
expect_identical(getOption("shiny.port"), shiny_port_orig)
# options(shiny.port = xxx) is overrideable
override_port <- httpuv::randomPort()
appObj <- shinyAppFile(file.path(appDir, "option.R"), options = list(port = override_port))
expect_port(print(appObj), override_port)
appObj <- shinyAppFile(file.path(appDir, "option.R"), options = list(port = 8888))
expect_port(print(appObj), 8888)
# onStop still works even if app.R has an error (ensure option was unset)
expect_error(runApp(file.path(appDir, "option-broken.R")), "^boom$")
expect_null(getOption("shiny.port"))
})

View File

@@ -1265,52 +1265,30 @@ test_that("cacheHint to avoid collisions", {
test_that("cacheHint works with quosures", {
# Cache hint ignores environment
my_quo <- local({
a <- 5
rlang::quo({a + 1})
})
ap1 <- rlang::expr({a+1})
plotCacheList <- list(userExpr = ap1, res = 72)
reactiveCacheList <- list(userExpr = ap1)
quoCacheList <- list(q = ap1)
my_quo <- rlang::quo({a + 1})
# render**
# Regular expression, quoted quosure object, injected quosure object
expect_equal(
extractCacheHint(renderPlot({ a + 1 })),
plotCacheList
list(userExpr = rlang::expr({a+1}), res = 72)
)
expect_equal(
extractCacheHint(renderPlot(my_quo, quoted = TRUE)),
plotCacheList
)
expect_equal(
extractCacheHint(inject(renderPlot(!!my_quo))),
plotCacheList
list(userExpr = rlang::expr({a+1}), res = 72)
)
# reactive
# Regular expression, quoted quosure object, injected quosure object
expect_equal(
extractCacheHint(reactive(a + 1)),
reactiveCacheList
list(userExpr = rlang::expr({a+1}))
)
expect_equal(
extractCacheHint(reactive(my_quo, quoted = TRUE)),
reactiveCacheList
)
expect_equal(
extractCacheHint(inject(reactive(!!my_quo))),
reactiveCacheList
list(userExpr = rlang::expr({a+1}))
)
# markRenderFunction handles raw quosure objects as cacheHint
expect_equal(
extractCacheHint(
markRenderFunction(force, force, cacheHint = list(q = my_quo))
),
quoCacheList
list(q = rlang::expr({a+1}))
)
})

View File

@@ -11,10 +11,6 @@ test_that("devmode can not be turned on while testing", {
test_that("devmode can be turned on while _testing_ is disabled and check messages", {
# TODO - Once a stable version of rlang lands with `options(rlib_message_verbosity)` functionality,
# bump the rlang version in DESCRIPTION and remove these skip calls
# Skip if *not* on CI; Inspired from `testthat::skip_on_ci()`
skip_if(!isTRUE(as.logical(Sys.getenv("CI"))), "Not testing in CI")
skip_if_not_installed("rlang", "0.4.11.9000")
# disable all existing options

View File

@@ -216,21 +216,28 @@ test_that("dateYMD works", {
c("2020-01-14", "2019-11-05")
)
expect_warning(val <- dateYMD(""))
expect_identical(val, "")
expect_warning(val <- dateYMD(c(NA)))
expect_identical(val, NA)
expect_warning(val <- dateYMD(c("", NA)))
expect_identical(val, c("", NA))
expect_identical(
expect_warning(dateYMD("")),
""
)
expect_identical(
expect_warning(dateYMD(c(NA))),
NA
)
expect_identical(
expect_warning(dateYMD(c("", NA))),
c("", NA)
)
# If there are any bad values, the entire thing goes through unchanged
expect_warning(val <- dateYMD(c("2019/11/05", NA)))
expect_identical(val, c("2019/11/05", NA))
expect_warning(val <- dateYMD(c("2019/11/05", "")))
expect_identical(val, c("2019/11/05", ""))
expect_identical(
expect_warning(dateYMD(c("2019/11/05", NA))),
c("2019/11/05", NA)
)
expect_identical(
expect_warning(dateYMD(c("2019/11/05", ""))),
c("2019/11/05", "")
)
})
test_that("quoToFunction handles nested quosures", {

View File

@@ -89,9 +89,7 @@ reference:
- HTML
- include
- singleton
- tagList
- tagAppendAttributes
- tagAppendChild
- tag
- validateCssUnit
- withTags
- htmlTemplate

View File

@@ -11,9 +11,7 @@
"repo": "rstudio/htmltools",
"exports": [
{ "file": "builder.Rd", "ignore": "builder" },
{ "file": "tagList.Rd" },
{ "file": "tagAppendAttributes.Rd" },
{ "file": "tagAppendChild.Rd", "ignore": "tagInsertChildren" },
{ "file": "tag.Rd" },
{ "file": "HTML.Rd" },
{ "file": "include.Rd", "ignore": "include" },
{ "file": "singleton.Rd" },

View File

@@ -16,9 +16,6 @@ local({
`%>%` <- magrittr::`%>%`
local_reexports_r_file <- rprojroot::find_package_root_file("R/reexports.R")
unlink(local_reexports_r_file)
# pre document
devtools::document()
@@ -26,6 +23,7 @@ local({
alias_info <- jsonlite::fromJSON(rprojroot::find_package_root_file("tools/documentation/reexports.json"), simplifyDataFrame = FALSE)
local_man_folder <- rprojroot::find_package_root_file("man")
local_reexports_r_file <- rprojroot::find_package_root_file("R/reexports.R")
latest_tag <- memoise::memoise(function(repo) {
# requires a GITHUB_PAT token
@@ -86,8 +84,8 @@ local({
paste0(collapse = "\n\n\n") %>%
paste0(
"####\n",
"# Generated by `./tools/documentation/updateReexports.R`: do not edit by hand\n",
"# Please call `source('tools/documentation/updateReexports.R')` from the root folder to update`\n",
"# Generated by `./tools/updateReexports.R`: do not edit by hand\n",
"# Please call `source('tools/updateReexports.R') from the root folder to update`\n",
"####\n",
"\n",
.