Upgrade notes for Shiny 1.0.0

Shiny has reached a milestone: version 1.0.0! In the last year, we’ve added two major features that we considered essential for a 1.0.0 release: bookmarking, and support for testing Shiny applications. As usual, this version of Shiny also includes many minor features and bug fixes.

Here are some highlights from this release. For more details, see the full changelog below.

Support for testing Shiny applications

Shiny now supports automated testing of applications, with the shinytest package. Shinytest has not yet been released on CRAN, but will be soon. (#18, #1464)

Debounce/throttle reactives

Now there’s an official way to slow down reactive values and expressions that invalidate too quickly. Pass a reactive expression to the new debounce or throttle function, and get back a modified reactive expression that doesn’t invalidate as often. (#1510)

Full changelog

Breaking changes

  • Added a new placeholder argument to verbatimTextOutput(). The default is FALSE, which means that, if there is no content for this output, no representation of this slot will be made in the UI. Previsouly, even if there was no content, you’d see an empty rectangle in the UI that served as a placeholder. You can set placeholder = TRUE to revert back to that look. (#1480)

New features

  • Added support for testing Shiny applications with the shinytest package. (#18, #1464)

  • Added debounce and throttle functions, to control the rate at which reactive values and expressions invalidate. (#1510)

Minor new features and improvements

  • Addressed #1486 by adding a new argument to observeEvent and eventReactive, called ignoreInit (defaults to FALSE for backwards compatibility). When set to TRUE, the action (i.e. the second argument: handlerExpr and valueExpr, respectively) will not be triggered when the observer/reactive is first created/initialized. In other words, ignoreInit = TRUE ensures that the observeEvent (or eventReactive) is never run right away. For more info, see the documentation (?observeEvent). (#1494)

  • Added a new argument to observeEvent called once. When set to TRUE, it results in the observer being destroyed (stop observing) after the first time that handlerExpr is run (i.e. once = TRUE guarantees that the observer only runs, at most, once). For more info, see the documentation (?observeEvent). (#1494)

  • Addressed #1358: more informative error message when calling runApp() inside of an app’s app.R (or inside ui.R or server.R). (#1482)

  • Added a more descriptive JS warning for insertUI() when the selector argument does not match anything in DOM. (#1488)

  • Added support for injecting JavaScript code when the shiny.testmode option is set to TRUE. This makes it possible to record test events interactively. (#1464)

  • Added ability through arguments to the a tag function called inside downloadButton() and downloadLink(). Closes #986. (#1492)

  • Implemented #1512: added a userData environment to session, for storing arbitrary session-related variables. Generally, session-scoped variables are created just by declaring normal variables that are local to the Shiny server function, but session$userData may be more convenient for some advanced scenarios. (#1513)

Bug fixes

  • Fixed #969: allow navbarPage’s fluid param to control both containers. (#1481)

  • Fixed #1438: unbindAll() should not be called when inserting content with insertUI() (#1449)

  • Fixed bug causing <meta> tags associated with HTML dependencies of Shiny R Markdown files to be rendered incorrectly. (#1463)

  • Fixed #1359: shinyApp() options argument ignored when passed to runApp(). (#1483)

  • Fixed #117: Reactive expressions now release references to cached values as soon as they are invalidated, potentially making those cached values eligible for garbage collection sooner. Previously, this would not occur until the next cached value was calculated and stored. (#1504)

  • Fixed #1013: flushReact should be called after app loads. Observers set up outside of server functions were not running until after the first user connects. (#1503)

  • Fixed #1453: When using a modal dialog with easyClose=TRUE in a Shiny gadget, pressing Esc would close both the modal and the gadget. Now pressing Esc only closes the modal. (#1523)

Library updates