Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: detect mutation to values of reactive vars #595

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 11, 2024

  1. feat: detect mutation to values of reactive vars

    A common source of error is mutation of values in reactive vars.
    The reactive var cannot notice a change in its value (e.g. a list)
    if the list is mutated in place.
    
    A user can be mislead that it is working correctly, when another
    reactive variable triggers a rerender, teaching bad habits.
    
    Detecting mutations in Python without using proxies can be done by
    making a deepcopy of the object, and comparing the reference to the
    deepcopy.
    
    This comes at the cost of performance and memory usage, therefore we
    should enabled this by default in development mode, so app builders
    are aware of mistakes while developing.
    In production mode we can disable the mutation checks and behave as
    before.
    maartenbreddels committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    a6b1a62 View commit details
    Browse the repository at this point in the history