[CLEANUP] Deprecate Comparable mixin and remove internal usage#21437
Open
olenderhub wants to merge 1 commit into
Open
[CLEANUP] Deprecate Comparable mixin and remove internal usage#21437olenderhub wants to merge 1 commit into
olenderhub wants to merge 1 commit into
Conversation
Contributor
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:
| import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; | ||
|
|
||
| let data = []; | ||
| let Comp = EmberObject.extend(Comparable); |
Contributor
There was a problem hiding this comment.
this part could be extracted to a separate pr tho ❤️
Contributor
Author
There was a problem hiding this comment.
I’d prefer to keep this here because after adding the deprecation this test fails if it keeps using Comparable - Comp.create() triggers the deprecation.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: