You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two workarounds in blockr.core are now covered by the reactives package, which grew out of #227 and #244:
trim_rv() removes keys from a reactiveValues() object through shiny's internals. destroy_link() uses it on the per-block routing in rv$sources[[id]] (created here), and it is exported because blockr.dock uses it too.
The routing in rv$sources[[id]] becomes a reactives::reactive_vals() collection. Removing a variadic link is src[[id]] <- NULL, and reading a key returns its reactiveVal() or NULL, which upstream_result() calls when present. The reactiveValuesToList(srcs) calls in block_inputs_ready() and block_server() (L354, L447) read the values of all slots instead, which Add helpers for bulk reads, type checks and tests nbenn/reactives#7 plans a helper for.
The variadic ...args becomes a reactives::reactives() collection. Since as.list() returns the slots' reactives, dot_arg_values() calls each one, while block servers keep using names() and length(). The copies of dot_arg_values() in blockr.io and blockr.dm already call elements that are reactives.
The environment of per-block reactiveVal()s in rv$needed_slots, and rv$eval, where removing a block leaves a NULL key behind, can move to collections as well.
The trim_rv() export can be deprecated once blockr.dock no longer uses it.
Tests in blockr.dm, blockr.dplyr, blockr.ggplot and blockr.io build ...args with blockr.core:::reactives() and blockr.core:::append_reactive(), often with plain functions such as function() df1. They would switch to reactives::reactives(), with each slot wrapped in reactive(), since the package only accepts reactives.
This needs a CRAN release of reactives first, since blockr.core is on CRAN. It should also follow nbenn/reactives#4, which creates each key's cell in the session that owns the collection, because blockr.core destroys a block's module session when the block is removed.
Two workarounds in blockr.core are now covered by the reactives package, which grew out of #227 and #244:
trim_rv()removes keys from areactiveValues()object through shiny's internals.destroy_link()uses it on the per-block routing inrv$sources[[id]](created here), and it is exported because blockr.dock uses it too.reactivesclass holds the variadic...args(created here).With the package:
rv$sources[[id]]becomes areactives::reactive_vals()collection. Removing a variadic link issrc[[id]] <- NULL, and reading a key returns itsreactiveVal()orNULL, whichupstream_result()calls when present. ThereactiveValuesToList(srcs)calls inblock_inputs_ready()andblock_server()(L354, L447) read the values of all slots instead, which Add helpers for bulk reads, type checks and tests nbenn/reactives#7 plans a helper for....argsbecomes areactives::reactives()collection. Sinceas.list()returns the slots' reactives,dot_arg_values()calls each one, while block servers keep usingnames()andlength(). The copies ofdot_arg_values()in blockr.io and blockr.dm already call elements that are reactives.reactiveVal()s inrv$needed_slots, andrv$eval, where removing a block leaves aNULLkey behind, can move to collections as well.trim_rv()export can be deprecated once blockr.dock no longer uses it.Tests in blockr.dm, blockr.dplyr, blockr.ggplot and blockr.io build
...argswithblockr.core:::reactives()andblockr.core:::append_reactive(), often with plain functions such asfunction() df1. They would switch toreactives::reactives(), with each slot wrapped inreactive(), since the package only accepts reactives.This needs a CRAN release of reactives first, since blockr.core is on CRAN. It should also follow nbenn/reactives#4, which creates each key's cell in the session that owns the collection, because blockr.core destroys a block's module session when the block is removed.