Skip to content

Deprecate mixins - #21577

Merged
NullVoxPopuli merged 1 commit into
mainfrom
nvp/deprecate-mixin-support
Aug 26, 2026
Merged

NullVoxPopuli merged 1 commit into
mainfrom
nvp/deprecate-mixin-support

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Advancement:

RFC:

The advancement RFC gives a bunch of other mixin-using things that are public that also need to be deprecated, but I'd like to that as a followup -- there are a bunch more things that need to be deprecated as a part of this RFC

In particular, these are not deprecated in this PR:

  • Ember.PromiseProxyMixin
  • Ember.Enumerable
  • Ember.Observable

but will be soon (as the RFC declared they would be)

@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

📊 Size report

Tarball size — 1.2 MB → 1.2 MB

dist/dev   0.1%↑

File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 5.5 kB / 1.6 kB 4%↑5.8 kB / 1%↑1.6 kB
./packages/@ember/array/index.js 17.4 kB / 4.4 kB 0.6%↑17.5 kB / 0.8%↑4.4 kB
./packages/@ember/object/mixin.js 17.8 kB / 4.6 kB -96.6%↓610 B / -95%↓230 B
./packages/shared-chunks/mixin-M88Ghbyw.js — 18.5 kB / 4.8 kB
Total (Includes all files) 2.1 MB / 492.5 kB 0.1%↑2.1 MB / 0.2%↑493.5 kB

dist/prod   0.1%↑

File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 5.2 kB / 1.5 kB 4%↑5.4 kB / 1%↑1.5 kB
./packages/@ember/array/index.js 15.6 kB / 4.1 kB 0.7%↑15.7 kB / 0.6%↑4.1 kB
./packages/@ember/object/mixin.js 16 kB / 4.1 kB -96.9%↓497 B / -95%↓207 B
./packages/shared-chunks/cache-{hash}.js 9.9 kB / 2.8 kB -92.9%↓697 B / -90.7%↓258 B
./packages/shared-chunks/mixin-AGmJaAAY.js — 16.7 kB / 4.4 kB
Total (Includes all files) 1.9 MB / 450 kB 0.1%↑1.9 MB / 0.2%↑450.8 kB

smoke-tests/v2-app-template/dist   0.1%↑

File Before (Size / Brotli) After (Size / Brotli)
./assets/api-{hash}.js 290.5 kB / 78.1 kB 0.1%↑290.8 kB / -0.01%↓78.1 kB
Total (Includes all files) 342.8 kB / 95.1 kB 0.1%↑343.1 kB / 0.03%↑95.2 kB

smoke-tests/v2-app-hello-world-template/dist   1%↑

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 132.4 kB / 37 kB 1%↑134.4 kB / 2%↑37.6 kB
Total (Includes all files) 132.7 kB / 37.1 kB 1%↑134.7 kB / 2%↑37.7 kB

🤖 This report was automatically generated by wyvox/pkg-size

@NullVoxPopuli NullVoxPopuli changed the title Deprecate the mixin module Deprecate mixins Aug 19, 2026
@NullVoxPopuli
NullVoxPopuli force-pushed the nvp/deprecate-mixin-support branch from 762d617 to fdb1a7a Compare August 19, 2026 21:36
});

let baseObject = MyMixin.apply({});
let baseObject = mixin(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mixin was new to me, but it's a private thing for just us to use

}

const ProxyMixin = /*@__PURE__*/ Mixin.create({
const ProxyMixin = /*@__PURE__*/ Mixin[INTERNAL_MIXIN_CREATE]({

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the idea I had for allowing us to keep using mixin (until we get get rid of everything using it) but still throw deprecations on the public api mixin static methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Array deprecations coming soon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(RFC already accepted)

},
});

let BarControllerMixin = Mixin.create({

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mixin usage here was not relevant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

idk if we need this -- it's from a bot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

viewing this file requires hiding invis changes

Image

},

class {
static module(title) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this whole class can be deleted when we remove mixins, which will reduce the duplicate tests 🎉

@NullVoxPopuli
NullVoxPopuli marked this pull request as ready for review August 19, 2026 21:57
bar: 'BAR',
});

let MixinB = MixinA.without('bar');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had forgotten about without

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah...

};

class B extends A.extend(Mixin1, Mixin2) {
class B extends A.extend(classicProps1, classicProps2) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this also be deprecated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this.add(
'controller:parent',
Controller.extend(HasPage, {
Controller.extend(hasPage, {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does passing multiple objects to extend mean if they aren't mixins?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

are plain objects mixins?

do we need a separate RFC for deprecating extend?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's just land the implementation for the RFC for deprecating classic classes soon

@kategengler kategengler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly 👍 but a couple of questions

@NullVoxPopuli
NullVoxPopuli merged commit 26f9724 into main Aug 26, 2026
54 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the nvp/deprecate-mixin-support branch August 26, 2026 21:34
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
NullVoxPopuli-ai-agent pushed a commit to NullVoxPopuli-ai-agent/ember.js that referenced this pull request Aug 26, 2026
Follow-up to emberjs#21577, which deprecated `Mixin.create` itself. The advancement
RFC (emberjs/rfcs#1143) still lists these three public mixins as open work.

Each mixin records its own deprecation notice in a WeakMap through
`deprecatedMixin`. `CoreObject.extend` and both `reopen` methods read that map
and fire the notice for each mixin they are given. `EmberObject` reopens its
`PrototypeMixin` with `Observable` directly, which is what `extend` does
internally, so apps that never name the mixin get no notice.

`MutableEnumerable` shares the `deprecate-enumerable` id, because leaving it
alone would leave an obvious hole in the same module.

The three notices are available but not enabled, so they only fire when
`_ALL_DEPRECATIONS_ENABLED` is set. Test suite is green in the default,
all-deprecations, deprecations-as-errors, optional-features and production
variants.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3ZrBpLnFsT39EKiAe4897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants