Repository navigation
Deprecate classic classes (RFC 1117) - #21673
Draft
NullVoxPopuli-ai-agent wants to merge 1 commit into
Draft
NullVoxPopuli-ai-agent wants to merge 1 commit into
NullVoxPopuli-ai-agent wants to merge 1 commit into
Conversation
`extend`, `reopen` and `reopenClass` on `CoreObject` now give the `deprecate-classic-classes` deprecation. It is available in 7.5.0 and it is not enabled until the RFC is Ready for Release. Ember still applies framework mixins to its own classes. Those call sites use symbol-keyed methods (`INTERNAL_EXTEND`, `INTERNAL_REOPEN`, `INTERNAL_REOPEN_CLASS`) that do not deprecate. This is the pattern of `INTERNAL_MIXIN_CREATE` from the mixin deprecation. Tests: - Tests of the classic class system use `testUnless(isRemoved)` and the new `expectClassicClassDeprecation()` helper. - Tests of features that stay (router service, query params, locations) now use native classes. - `subclass()` on the application test case replaces a registration with a subclass of it. It replaces `this.router.reopen(...)`. - A quiet expectation in the call tracker adds no assertion on a match. `assert.expect` counts then stay the same in each test run. This continues emberjs#21580. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| id: 'deprecate-classic-classes', | ||
| for: 'ember-source', | ||
| since: { available: '7.5.0' }, | ||
| until: '8.0.0', |
Contributor
There was a problem hiding this comment.
probably needs to move to v9, in coordination with RFC#1234
Contributor
|
NOTE: this impl is now optional (but would be good for deprecation guides) due to RFC #1234 |
This was referenced Oct 8, 2026
This branch has not been deployed
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.
extend,reopenandreopenClassnow give thedeprecate-classic-classesdeprecation (RFC 1117). This PR replaces the draft #21580, which conflicts withmain."Deprecate Classic Classes"to Stage Ready for Release rfcs#1141Blocked by
emberjs/ember-test-helpers#1583 must release first.
@ember/test-helperscallsEmberObject.extend()at import time, so these CI jobs fail here until then:With that fix put into
node_modulesby hand, the first two groups pass locally. I did not run the smoke tests locally.The deprecation
deprecate-classic-classesThese calls deprecate:
SomeClass.extend(...)SomeClass.reopen(...)SomeClass.reopenClass(...)someInstance.reopen(...)Internal use
Ember still applies framework mixins to its own classes, for example
ObservableonEmberObjectandActionHandleronRoute. Those call sites use symbol-keyed methods that do not deprecate:INTERNAL_EXTENDINTERNAL_REOPENINTERNAL_REOPEN_CLASSThis is the pattern of
INTERNAL_MIXIN_CREATEfrom #21577. The symbols live in@ember/-internals/utils/lib/internal-classic-class.ts.#21580 used helper functions in a new module instead. That module needed an entry in
package.json, and it made six more modules fail the tree shaking snapshot. The symbol methods need neither change.Tests
testUnless(DEPRECATIONS.DEPRECATE_CLASSIC_CLASSES.isRemoved)and callexpectClassicClassDeprecation().HistoryLocation,NoneLocation, the router DSL.internal-test-helpers) uses the internal symbols, because it builds classes from property bags (routerOptions, the-top-levelcomponent).Three additions to
internal-test-helpers:expectClassicClassDeprecation()expects the deprecation only while it is enabled.subclass(specifier, build)on the application test case replaces a registration with a subclass of it. It replacesthis.router.reopen(...).expectDeprecationQuietly(message)adds no assertion on a match.expectDeprecationadds one assertion for each message, so 21 tests withassert.expect(n)had a different count when the deprecation was enabled.Local results
All runs have the
@ember/test-helpersfix innode_modules.Also green:
pnpm lint,pnpm type-check,pnpm test:node,pnpm test:node:vitest(tree shaking), andpnpm buildleavespackage.jsonunchanged.Not in this PR
deprecations.emberjs.com.smoke-tests/node-templatestill calls.extend()in its helpers. Those tests run without the deprecation.@classicdecorator. It is in theember-classic-decoratoraddon, not in this repository.🤖 Generated with Claude Code