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

Revert hash to bi-modal behavior #1323

Merged
merged 1 commit into from
Jun 29, 2021
Merged

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented Jun 22, 2021

This PR reverts hash to it's bi-modal behavior prior to Ember ~3.22.
Hash will now:

  1. Eagerly produce an object whenever used in JS, which consumes all
    references and autotracks them. Whenever one reference changes, the
    hash will dirty and produce a new object.
  2. Lazily allow access to child paths in templates, e.g. {{hash.foo}}
    will not access any other references on the hash.

These behaviors have some quirks, but the quirks existed before 3.22 and
were primarily related to the fact that the object produced in 1 is
mutable and can diverge from the values in 2. Since setting values on a
hash object is deprecated, this should not be an issue in the near
future.

This PR reverts hash to it's bi-modal behavior prior to Ember ~3.22.
Hash will now:

1. Eagerly produce an object whenever used in JS, which consumes all
   references and autotracks them. Whenever one reference changes, the
   hash will dirty and produce a new object.
2. Lazily allow access to child paths in templates, e.g. `{{hash.foo}}`
   will _not_ access any other references on the hash.

These behaviors have some quirks, but the quirks existed before 3.22 and
were primarily related to the fact that the object produced in 1 is
mutable and can diverge from the values in 2. Since setting values on a
hash object is deprecated, this should not be an issue in the near
future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants