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] Allow computeds to have cycles in their deps #19178

Merged
merged 1 commit into from Oct 5, 2020

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Oct 1, 2020

The bugfix for disallowed cycles in tracked props in #19138 attempted
to also narrow the number of cycles that are allowed in general. Cycles
should only be allowed for computed property deps, for legacy support
reasons. The logic to allow cycles for these tags in particular was
mistakenly added to setup, which runs on the prototype of the class.
This meant that instance computed props were not allowed to have
cycles, and this was causing failures in the ecosystem.

Added a test that failed and is fixed with this change. I also attempted
to create a cycle with @alias since it uses a different
implementation, but I wasn't able to create one which didn't result in
a Maximum Callstack style recursion error, so I think it's just not
possible at all anyways, since @alias is eager always and never
caches.

The bugfix for disallowed cycles in tracked props in #19138 attempted
to also narrow the number of cycles that are allowed in general. Cycles
should only be allowed for computed property deps, for legacy support
reasons. The logic to allow cycles for these tags in particular was
mistakenly added to `setup`, which runs on the _prototype_ of the class.
This meant that _instance_ computed props were not allowed to have
cycles, and this was causing failures in the ecosystem.

Added a test that failed and is fixed with this change. I also attempted
to create a cycle with `@alias` since it uses a different
implementation, but I wasn't able to create one which didn't result in
a Maximum Callstack style recursion error, so I think it's just not
possible at all anyways, since `@alias` is eager always and never
caches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants