-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Chris Garrett
committed
Sep 14, 2020
1 parent
e6c38ec
commit 6659046
Showing
6 changed files
with
88 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters