From c12cd99e2774633c022b386296d90501010202a0 Mon Sep 17 00:00:00 2001 From: Sergey Grechin Date: Fri, 2 Dec 2022 14:22:45 +0100 Subject: [PATCH 1/3] fixed the documentation of `sendBinaryMessage` function. previously, the documentation referred to a non-existent `addBinaryMessageHandler` function to be called on the frontend side. Experimentally, it was found out that the same `addCustomMessageHandler` just works. This is the function used to register handlers of other custom messages. --- NEWS.md | 2 ++ R/shiny.R | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index af4dc865ea..b49e39d978 100644 --- a/NEWS.md +++ b/NEWS.md @@ -69,6 +69,8 @@ shiny 1.7.2 * Closed #2955: Input and output bindings previously attempted to use `el['data-input-id']`, but that never worked. They now use `el.getAttribute('data-input-id')` instead. (#3538) +* fixed the documentation of `sendBinaryMessage` function. + ### Minor improvements * When taking a test snapshot, the sort order of the json keys of the `input`, `output`, and `export` fields is currently sorted using the locale of the machine. This can lead to inconsistent test snapshot results. To opt-in to a consistent ordering of snapshot fields with `{shinytest}`, please set the global option `options(shiny.snapshotsortc = TRUE)`. `{shinytest2}` users do not need to set this value. (#3515) diff --git a/R/shiny.R b/R/shiny.R index ef9f255c77..526158f5b1 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -220,11 +220,11 @@ workerId <- local({ #' `sendCustomMessage` is called on the server. #' } #' \item{sendBinaryMessage(type, message)}{ -#' Similar to `sendCustomMessage`, but the message must be a raw vector -#' and the registration method on the client is -#' \code{Shiny.addBinaryMessageHandler(type, function(message){...})}. The -#' message argument on the client will be a -#' [DataView](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). +#' Similar to sendCustomMessage, but the message must be a raw vector. +#' The registration method on the client is the same as for other custom messages: +#' \code{Shiny.addCustomMessageHandler(type, function(message){...})}. The +#' message argument on the client will be an +#' [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). #' } #' \item{sendInputMessage(inputId, message)}{ #' Sends a message to an input on the session's client web page; if the input From 8b3628096caff80f9e65aae68b8400182510f9f9 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Thu, 12 Jan 2023 11:58:29 -0600 Subject: [PATCH 2/3] Update NEWS.md --- NEWS.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 55973e40b0..aa5abb5fb3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -77,8 +77,6 @@ * Closed #2955: Input and output bindings previously attempted to use `el['data-input-id']`, but that never worked. They now use `el.getAttribute('data-input-id')` instead. (#3538) -* fixed the documentation of `sendBinaryMessage` function. - ### Minor improvements * When taking a test snapshot, the sort order of the json keys of the `input`, `output`, and `export` fields is currently sorted using the locale of the machine. This can lead to inconsistent test snapshot results. To opt-in to a consistent ordering of snapshot fields with `{shinytest}`, please set the global option `options(shiny.snapshotsortc = TRUE)`. `{shinytest2}` users do not need to set this value. (#3515) From 1c9f5cb212592317fa177c4dd9513ba1f94e5281 Mon Sep 17 00:00:00 2001 From: Sergey Grechin Date: Sat, 21 Jan 2023 16:34:13 +0100 Subject: [PATCH 3/3] documentation rebuilt --- man/session.Rd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/session.Rd b/man/session.Rd index 3172ee284a..3626899cf6 100644 --- a/man/session.Rd +++ b/man/session.Rd @@ -130,11 +130,11 @@ as the page loads; the function you provide to \code{sendCustomMessage} is called on the server. } \item{sendBinaryMessage(type, message)}{ -Similar to \code{sendCustomMessage}, but the message must be a raw vector -and the registration method on the client is -\code{Shiny.addBinaryMessageHandler(type, function(message){...})}. The -message argument on the client will be a -\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView}{DataView}. +Similar to sendCustomMessage, but the message must be a raw vector. +The registration method on the client is the same as for other custom messages: +\code{Shiny.addCustomMessageHandler(type, function(message){...})}. The +message argument on the client will be an +\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer}{ArrayBuffer}. } \item{sendInputMessage(inputId, message)}{ Sends a message to an input on the session's client web page; if the input