[CLEANUP] Deprecate Comparable mixin and remove internal usage#21437
[CLEANUP] Deprecate Comparable mixin and remove internal usage#21437olenderhub wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
this cant be deleted until after a major after a deprecation lands -- like:
and then at the major we can remove like here:
Keep the Comparable mixin available as deprecated API until v8, while removing Ember's internal dependency on it from compare(). This allows external apps/addons using Comparable to receive a deprecation warning without Ember internals triggering the deprecation themselves. - Add a deprecation for Comparable - Preserve the Comparable mixin API until v8 - Update compare() to use duck-typing instead of Comparable.detect() - Add regression coverage for non-function compare values
552d006 to
ce5b156
Compare
|
@NullVoxPopuli please check changes now. Is this is proper flow of this or I have to change something? |
|
looks, good I think. Do you have a PR ready for the deprecation guides as well? |
| @return {Number} the result of the comparison | ||
| @private | ||
| */ | ||
| init() { |
There was a problem hiding this comment.
@NullVoxPopuli This mixin is marked @private -- do we believe it was public or intimate enough to need the full deprecation? (if not we could make the deprecation until 7.5 (until after next LTS))
There was a problem hiding this comment.
I'm between the two -- based on https://emberobserver.com/code-search?codeQuery=Comparable
but one of those libraries is quite popular, and has a 10, but I think its users know that it's a library they should move away from.
I can always lean towards removing stuff sooner, since the community has had a collective dislike for mixins since i started ember
There was a problem hiding this comment.
I think model fragments is the only legit one there but also it says private and probably has for a long time ...
I think we can change the until to be 7.5
@NullVoxPopuli Created ember-learn/deprecation-app#1432. I kept the versions matching this PR for now, but can update if you decide on the shorter timeline. |
Deprecate the legacy Comparable mixin while keeping it available until v8.
The internal compare() implementation no longer depends on Comparable.detect().
Instead, it uses a local duck-typing check for a function-valued compare method,
so Ember internals do not trigger the Comparable deprecation themselves.
References: