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] Fixes ArrayProxy length reactivity #19111

Merged
merged 1 commit into from Aug 28, 2020
Merged

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Aug 27, 2020

Recent refactors for performance left a gap in the reactivity model,
specifically for the length property of ArrayProxy. We now only use
the CUSTOM_TAG_FOR API when getting chain tags, which is much better
for most get() usages since we don't have to do an extra brand check
that is not very commonly used. However, the length property of
ArrayProxy does not have a normal property tag, and it is a native
getter which does not entangle the value naturally when accessed via
autotracking.

This PR sets up the length tag eagerly whenever the content of the
ArrayProxy changes, and consumes it when the length property is
accessed. It also does the same thing for the arrTag, though that is
only used for chain tags. Normally, when the array tag is accessed, it
tracks things properly through the objectAt API.

Fixes #19105

Recent refactors for performance left a gap in the reactivity model,
specifically for the `length` property of ArrayProxy. We now only use
the `CUSTOM_TAG_FOR` API when getting chain tags, which is much better
for most `get()` usages since we don't have to do an extra brand check
that is not very commonly used. However, the `length` property of
ArrayProxy does not have a normal property tag, and it is a native
getter which does not entangle the value naturally when accessed via
autotracking.

This PR sets up the `length` tag eagerly whenever the content of the
ArrayProxy changes, and consumes it when the `length` property is
accessed. It also does the same thing for the `arrTag`, though that is
only used for chain tags. Normally, when the array tag is accessed, it
tracks things properly through the `objectAt` API.
@wuarmin
Copy link

wuarmin commented Oct 5, 2020

@rwjblue is this fix included in Ember 3.20 LTS?

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.

[Bug] Ember 3.20.4 Does not Update When ED related records are removed
3 participants