Skip to content

Conversation

wagenet
Copy link
Contributor

@wagenet wagenet commented Jun 20, 2025

Copy link

netlify bot commented Jun 20, 2025

Deploy Preview for ember-deprecations ready!

Name Link
🔨 Latest commit 3c19ecd
🔍 Latest deploy log https://app.netlify.com/projects/ember-deprecations/deploys/6859812827eb7d00082c7962
😎 Deploy Preview https://deploy-preview-1408--ember-deprecations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Clarification: Mixins had shared state 😬

}
```

Then, apply the decorator to your class:
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@ef4
Copy link
Contributor

ef4 commented Aug 29, 2025

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants