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

Deprecate Computed Overridability and .readOnly() #369

Merged
merged 5 commits into from
Oct 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions text/0000-deprecate-computed-clobberability.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ functions elsewhere and replace them with a proxy getter and the mandatory
setter assertion, respectively. In the long term, making computeds more
transparent in this way would be ideal, but it is out of scope for this RFC.

## Deprecation Timeline

This change will be a breaking change, which means we will not be able to change
the behavior of `computed` until Ember v4.0.0. Until then, we should provide two
deprecation warnings:

1. When users invoke the default override-setter behavior
2. When users call `.readOnly()` on a computed property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we deprecate this, users have no way of getting a hard error (not a deprecation warning) when they clobber without getting deprecation warnings by using readOnly.

I recommend only deprecating .readOnly() in the 4.x era. Yeah, like I said, this is a pain.


The warnings should explain the deprecation, and recommend that users do not
rely on setter behavior or opting-in to read only behavior.

# How We Teach This

In general, we can teach that computed properties are essentially cached native
Expand Down