Add deprecation for old usages of cachable and readOnly in CPs#9489
Conversation
64de7e4 to
c60c5c6
Compare
|
Can you add a test that uses Can you also deprecate passing |
There was a problem hiding this comment.
Needs to be marked as @deprecated also.
|
I'm on it. |
b08e76d to
9f48f03
Compare
|
All done. You mentioned in the former PR that readOnly should be deprecated too. I can deprecate passing opts.readOnly in the constructor, but there is no equivalent of Because you can pass |
|
Forget my last comment. I misread your comment in the last PR. |
packages/ember-metal/lib/computed.js
Outdated
9f48f03 to
3815441
Compare
ComputedProperty.cacheable().|
Added readOnly deprecation too. |
|
There are a few failures, when running with this query-string. |
|
Fixed. Now I invoke Should I rebase? |
|
@krisselden r? |
|
@cibernox - Yes, if you could squash and rebase, that would be great. |
904dfc1 to
c56e38c
Compare
|
Rebased. Done here. |
|
@cibernox - Thank you. I think we are waiting for @krisselden to have a chance to review before merging. |
|
👍 |
|
This seems good to me. @stefanpenner / @krisselden - Any tweaks or objections? |
|
For the record, I have implemented emberjs/rfcs#11 on top of this. |
|
@krisselden / @stefanpenner Ping here. #9527 is done and based on this one. |
c56e38c to
56f1b57
Compare
|
Rebased |
|
so far looks good. @krisselden your eyes would be good |
|
Another ping to @krisselden ! |
|
Thanks! |
packages/ember-metal/lib/computed.js
Outdated
There was a problem hiding this comment.
.volatile is more like manual, it may prevent the internal CP caching, but it has no effect on downstream caching that happens in the view layer for example. It is generally used for properties that are manually notified and delegated, like array.length. It really should be an extremely rare occurrence in an app.
There was a problem hiding this comment.
So what do you suggest then? Not mention volatile at all?
There was a problem hiding this comment.
I suspect he would prefer you don't mention it at all.
There was a problem hiding this comment.
@cibernox lol, i see we have driven you to insanity with our slowness. Sorry, we will not let this happen again.
56f1b57 to
bb8d206
Compare
* Passing opts.cacheable to the constructor of ComputedProperty is deprecated * Passing opts.readOnly to the constructor of ComputedProperty is deprecated * Invoking `cacheable` in a computed property is preprecated. * Invoking `readOnly` with aany params in a computed property is deprecated. * Make InjectedProperty inherit `readOnly` from CPs prototype
bb8d206 to
dd15598
Compare
|
I would say that NOW its ready to merge. |
|
@stefanpenner ping! |
Add deprecation for old usages of cachable and readOnly in CPs
|
👍 sorry, i have meant to review this sooner but i have been sick in bed for the last few days. |
|
Don't worry |




cacheablein a computed property is preprecated.readOnlywith aany params in a computed property is deprecated.-- UPDATE --
After reading #9290 and emberjs/rfcs#12, seems that this PR is the first step to make CP read only by default.
Steps done in this PR:
cacheableorreadOnlyto the constructor. No extrictly necessary, but is not used anywhere in the code since 2012 and simplifies things.cacheable()andreadOnly(). Are the default.Steps pending:
Ember.computed. If is arity <=1, create only a setter. If has arity > 1, assign the same function to getter and setter. Passing an object also works. No deprecations yet.{get, set}instead.writableand/oroverridableand determina default values as explained in the code example above.This steps don't need to happen in this PR. I fact I would merge things one step at a time.