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

[BUGFIX lts] Fix tag cycles in query parameters #19138

Merged
merged 1 commit into from Sep 30, 2020

Commits on Sep 30, 2020

  1. [BUGFIX lts] Fix tag cycles in query parameters

    Currently, we wrap query parameters with @dependentKeyCompat manually
    to ensure they work with the legacy router setup, which watches QPs
    using observers. When a QP value is labeled as @Tracked, we don't need
    to replace it with @dependentKeyCompat, but since it's just a plain
    native getter (from the decorator) we do anyways. This results in a tag
    cycle being created, which can result in a negative performance impact,
    as every render pass will be invalidated by the cycle and require a
    subsequent full revalidation.
    
    This bug would have been caught by our ALLOW_CYCLES logic, but that
    logic was faulty - it was allowing too many cycles, anything that was
    accessed via get. It should only have allowed cycles from computeds
    themselves.
    
    This PR fixes the bug with ALLOW_CYCLES, and the subsequent bug with
    @Tracked by only wrapping with @dependentKeyCompat if the value is
    not @Tracked. It also adds an assertion to prevent users from using
    @dependentKeyCompat with @computed or @Tracked.
    
    Verified that the test failed after fixing ALLOW_CYCLES, and passed
    again after the fix.
    Chris Garrett authored and rwjblue committed Sep 30, 2020
    Copy the full SHA
    57a2044 View commit details
    Browse the repository at this point in the history