Conversation
✅ Deploy Preview for ember-deprecations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
| since: 6.5.0 | ||
| --- | ||
|
|
||
| `Ember.Mixin` is deprecated. This is part of the legacy `@ember/object` API and is not compatible with native classes. Instead of using mixins, you should refactor your code to use class-based patterns. |
There was a problem hiding this comment.
My strategy for removing mixins from a codebase has been to copy the code into the places that mixed in the mixin and then if there is any common state, extract that to a service. From there I refactor to utilities or to the service to clean it up.
There was a problem hiding this comment.
There was a problem hiding this comment.
Clarification: Mixins had shared state 😬
| } | ||
| ``` | ||
|
|
||
| Then, apply the decorator to your class: |
There was a problem hiding this comment.
Showing how to do this with a plain function call rather than decorator syntax might be good.
Especially because we still offer babel-style decorator call signatures, not the standards track stage3 ones.
|
we should recommend ordering relative to other deprecations. Specifically, using the native class codemod to clear the native class deprecation before attempting to refactor away Mixins is probably the easiest path. (Even though the actual removal in Ember would have a dependency in the opposite order -- we can't remove old-style classes without also removing mixins.) |
RFC: emberjs/rfcs#1116