Dev mode aware client and duplicate input/output ID handling updates #3956
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #3946 and a fix for #3950.
The main contribution is the passing of dev mode status to the client. This is done by injecting a script tag into the head of the app when in dev mode. This script tag adds a global variable to the window that is then used as a signal to the client that dev mode is activated. To avoid awkward global-variable-consuming we provide a helper method on the
Shiny
object:Shiny.inDevMode()
that abstracts this away.This method for relaying dev mode status is inspired by how React does it.
The ability for the client to know about dev mode status is utilized to more explicitly label the passthrough case of duplicated input and output IDs in the code...
... while also flagging this as an error when in dev mode.