Skip to content

Deprecate freezeReactiveVal, and freezeReactiveValue for non-inputs #3063

@jcheng5

Description

@jcheng5

Consider getting rid of freezeReactiveVal, and freezeReactiveValue for non-input objects. If you're using these functions and seeing a deprecation message, please add a comment to this issue--we want to know what you're doing!

The need for freezeReactiveValue(input, "x") is clear. When server calls for changes to an input on the client side, via renderUI with inputs inside, or updateXXXInput, or insertUI, it's likely that the input's current value is, temporarily, no longer useful or even dangerous (in that it might be inconsistent with other input state that has already been updated). freezeReactiveValue prevents outputs from rendering an error during this window of time.

The need to use freezeReactiveVal, or freezeReactiveValue with a generic reactiveValues object, is far less clear. I think we implemented it for "consistency" but there's nothing consistent about these use cases, and it's not clear to me that you could effectively use them today if you wanted to (especially, the "automatically thaw on onFlushed" seems wrong to me now).

We could fix the semantics of these functions so they can actually be used, but I'm inclined to proceed cautiously because 1) I'm still not sure what scenario exists where you'd actually want to use it, and 2) in case someone has somehow figured out a way to use the current implementation to do something useful, we'd be breaking them.

I propose we soft-deprecate these uses, and have the deprecation warning message include a link to this issue. If people are actually using these functions then we can consider un-deprecating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions