Skip to content

Conversation

@wagenet
Copy link
Member

@wagenet wagenet commented Jun 20, 2025

Propose Deprecating Classic Classes

Rendered

Summary

This pull request is proposing a new RFC.

To succeed, it will need to pass into the Exploring Stage, followed by the Accepted Stage.

A Proposed or Exploring RFC may also move to the Closed Stage if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.

An FCP is required before merging this PR to advance to Accepted.

Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.

Exploring Stage Description

This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.

An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an Exploring label applied.

An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.

Accepted Stage Description

To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.

If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.

When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.

Checklist to move to Exploring

  • The team believes the concepts described in the RFC should be pursued.
  • The label S-Proposed is removed from the PR and the label S-Exploring is added.
  • The Ember team is willing to work on the proposal to get it to Accepted

Checklist to move to Accepted

  • This PR has had the Final Comment Period label has been added to start the FCP
  • The RFC is announced in #news-and-announcements in the Ember Discord.
  • The RFC has complete prose, is well-specified and ready for implementation.
    • All sections of the RFC are filled out.
    • Any unanswered questions are outlined and expected to be answered before Ready for Release.
    • "How we teach this?" is sufficiently filled out.
  • The RFC has a champion within one of the relevant teams.
  • The RFC has consensus after the FCP period.

@github-actions github-actions bot added the S-Proposed In the Proposed Stage label Jun 20, 2025
@kategengler kategengler added S-Exploring In the Exploring RFC Stage and removed S-Proposed In the Proposed Stage labels Jun 20, 2025
@kategengler
Copy link
Member

This needs a deprecation guide.

@ef4
Copy link
Contributor

ef4 commented Aug 15, 2025

We discussed this one briefly and agreed that this one and #1116 really need to land together to make sense so that people don't refactor to intermediate patterns.


All uses of Classic Classes should be converted to Native Classes. Anything that cannot be converted will be deprecated first, such as [Mixins](https://github.com/emberjs/rfcs/pull/1116) and the [`observer` helper function](https://github.com/emberjs/rfcs/pull/1115).

The `@classic` decorator (and any other APIs or patterns used to enable classic class interop) will also be deprecated as part of this transition. All code should migrate to native class syntax and patterns.
Copy link
Member

Choose a reason for hiding this comment

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

The @classic decorator pretty much does not work at this point. I recommend people remove it because it only had dev-time behavior, anyway.

@apellerano-pw
Copy link

What does migration look like?

  1. Fix all avoid-leaking-state-in-ember-objects lint violations
  2. Remove all Mixins
  3. Run https://github.com/ember-codemods/ember-native-class-codemod
  4. ???

Will @computed and @action decorators continue to work? Leaning on those should help avoid logic rewrites

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Aug 22, 2025

re: @computed:

re: @action:

@computed and @action aren't needed with modern ember 🎉

@kategengler
Copy link
Member

What does migration look like?

  1. Fix all avoid-leaking-state-in-ember-objects lint violations

This is a good first step.

  1. Remove all Mixins

This is not strictly necessary to run the codemod and move to native classes. See https://github.com/ember-learn/ember-api-docs/blob/main/app/controllers/events.js#L5 for an example of what Mixins look like in native classes. I believe the codemod will even do this for you.

This style will work until this deprecation is removed in 7.0. It is a good call out that this also effective deprecates mixins (another RFC #1116) that will likely advance soon. So many of these older APIs are tied up in each other that the difficultly in deprecating them separately has kept us from doing so sooner.

  1. Run ember-codemods/ember-native-class-codemod
  1. ???

Would be to look for uses of reopen and reopenClass.

Will @computed and @action decorators continue to work? Leaning on those should help avoid logic rewrites

The decorators work in native classes and have done so since 3.x. Until computed is deprecated (another open RFC). There is no RFC to deprecate @action but in modern ember it is roughly the equivalent of bind to get the correct this in the action.

@apellerano-pw
Copy link

Thanks, it looks like the Classic Classes deprecation is pretty smooth then for someone with a long-running Ember project. I'm worried about its accomplices, Mixin deprecation and @computed deprecation. Especially @computed deprecation. I'll pick up in those threads.

@ef4 ef4 merged commit 421db8d into emberjs:main Aug 29, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Final Comment Period S-Exploring In the Exploring RFC Stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants