Skip to content

Deprecate PromiseProxyMixin, Enumerable, and Observable (mixins, RFC#… - #21588

Open
NullVoxPopuli wants to merge 2 commits into
mainfrom
nvp/deprecate-mixin-followups
Open

Deprecate PromiseProxyMixin, Enumerable, and Observable (mixins, RFC#…#21588
NullVoxPopuli wants to merge 2 commits into
mainfrom
nvp/deprecate-mixin-followups

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes:

Advancement:

RFC:

Guides:

Best viewed with:
image

Note

Because of the strategy of this deprecation (internal + public extends + deprecate), our tests don't have a lot of the testUnless stuff. We still need the tests because many of these mixins are still used internally. This makes this deprecation a bit different from the other ones due to how entangled mixins our in the codebase

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 weird, sure, but also trying to deprecate all this stuff, while heavily used internally, and not throwing deprecations on it is difficult -- I'm super looking forward to the cleanup for v8

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

📊 Size report

Tarball size — 1.2 MB → 1.2 MB

dist/dev   0.6%↑

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 2.1 MB / 493.9 kB 0.6%↑2.1 MB / 0.8%↑497.9 kB
Show files (31 files)
File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 6.5 kB / 1.7 kB 44%↑9.3 kB / 11%↑1.9 kB
./packages/@ember/-internals/runtime/lib/mixins/-proxy-internal.js — 4 kB / 1.3 kB
./packages/@ember/-internals/runtime/lib/mixins/-proxy.js 4 kB / 1.3 kB -77.1%↓921 B / -70%↓403 B
./packages/@ember/-internals/runtime/lib/mixins/action_handler-internal.js — 1.6 kB / 639 B
./packages/@ember/-internals/runtime/lib/mixins/action_handler.js 6.2 kB / 1.7 kB -11.5%↓5.5 kB / -14.1%↓1.5 kB
./packages/@ember/-internals/runtime/lib/mixins/container_proxy-internal.js — 990 B / 358 B
./packages/@ember/-internals/runtime/lib/mixins/container_proxy.js 1.2 kB / 422 B -10%↓1.1 kB / -7.82%↓389 B
./packages/@ember/-internals/runtime/lib/mixins/registry_proxy-internal.js — 1.6 kB / 541 B
./packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js 1.6 kB / 566 B -48.1%↓806 B / -45.1%↓311 B
./packages/@ember/-internals/runtime/lib/mixins/target_action_support-internal.js — 2.8 kB / 836 B
./packages/@ember/-internals/runtime/lib/mixins/target_action_support.js 4.9 kB / 1.4 kB -77.9%↓1.1 kB / -68.4%↓427 B
./packages/@ember/-internals/views/lib/mixins/action_support-internal.js — 1.7 kB / 637 B
./packages/@ember/-internals/views/lib/mixins/action_support.js 1.5 kB / 615 B -56%↓680 B / -50.4%↓305 B
./packages/@ember/array/index-internal.js — 15 kB / 3.6 kB
./packages/@ember/array/index.js 17.5 kB / 4.4 kB -76.3%↓4.1 kB / -71.6%↓1.2 kB
./packages/@ember/controller/controller-internal.js — 2.9 kB / 1 kB
./packages/@ember/controller/index.js 4.9 kB / 1.6 kB -43.2%↓2.8 kB / -42.4%↓924 B
./packages/@ember/enumerable/-internal.js — 416 B / 207 B
./packages/@ember/enumerable/index.js 570 B / 281 B 65%↑939 B / 43%↑403 B
./packages/@ember/enumerable/mutable-internal.js — 504 B / 230 B
./packages/@ember/enumerable/mutable.js 623 B / 288 B 57%↑981 B / 39%↑399 B
./packages/@ember/object/mixin-internal.js — 17 kB / 4.5 kB
./packages/@ember/object/mixin.js 610 B / 230 B 340%↑2.7 kB / 252%↑810 B
./packages/@ember/object/observable-internal.js — 4.4 kB / 1.1 kB
./packages/@ember/object/observable.js 6.7 kB / 1.8 kB -54.2%↓3.1 kB / -43%↓1 kB
./packages/shared-chunks/computed-CXIM4Sjc.js 33.9 kB / 7.9 kB —
./packages/shared-chunks/evented-{hash}.js 3.3 kB / 856 B 6%↑3.5 kB / 856 B
./packages/shared-chunks/index-{hash}.js 51.9 kB / 13 kB 20%↑62.6 kB / -3.32%↓12.5 kB
./packages/shared-chunks/mixin-M88Ghbyw.js 18.5 kB / 4.8 kB —
./packages/shared-chunks/properties-B5iTkmNj.js — 33.9 kB / 7.9 kB
./packages/shared-chunks/template-{hash}.js 491 B / 203 B 118%↑1.1 kB / 98%↑401 B

dist/prod   0.7%↑

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 1.9 MB / 451.2 kB 0.7%↑1.9 MB / 0.9%↑455.3 kB
Show files (29 files)
File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 6.2 kB / 1.6 kB 46%↑9 kB / 11%↑1.8 kB
./packages/@ember/-internals/runtime/lib/mixins/-proxy-internal.js — 3.1 kB / 1 kB
./packages/@ember/-internals/runtime/lib/mixins/-proxy.js 3.1 kB / 1 kB -69.9%↓921 B / -60.9%↓403 B
./packages/@ember/-internals/runtime/lib/mixins/action_handler-internal.js — 1.1 kB / 467 B
./packages/@ember/-internals/runtime/lib/mixins/action_handler.js 5.7 kB / 1.6 kB -4.43%↓5.5 kB / -7.24%↓1.5 kB
./packages/@ember/-internals/runtime/lib/mixins/container_proxy-internal.js — 990 B / 358 B
./packages/@ember/-internals/runtime/lib/mixins/container_proxy.js 1.2 kB / 421 B -10%↓1.1 kB / -7.6%↓389 B
./packages/@ember/-internals/runtime/lib/mixins/registry_proxy-internal.js — 1.4 kB / 508 B
./packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js 1.3 kB / 474 B -38.4%↓806 B / -34.4%↓311 B
./packages/@ember/-internals/runtime/lib/mixins/target_action_support-internal.js — 2.5 kB / 760 B
./packages/@ember/-internals/runtime/lib/mixins/target_action_support.js 4.6 kB / 1.3 kB -77.4%↓1 kB / -68%↓411 B
./packages/@ember/-internals/views/lib/mixins/action_support-internal.js — 1.1 kB / 472 B
./packages/@ember/-internals/views/lib/mixins/action_support.js 923 B / 404 B -26.3%↓680 B / -24.5%↓305 B
./packages/@ember/array/index-internal.js — 13.3 kB / 3.3 kB
./packages/@ember/array/index.js 15.7 kB / 4.1 kB -73.7%↓4.1 kB / -69.7%↓1.2 kB
./packages/@ember/controller/controller-internal.js — 2.9 kB / 1.1 kB
./packages/@ember/controller/index.js 4.9 kB / 1.6 kB -43.2%↓2.8 kB / -42.1%↓929 B
./packages/@ember/enumerable/-internal.js — 416 B / 207 B
./packages/@ember/enumerable/index.js 570 B / 281 B 65%↑939 B / 43%↑403 B
./packages/@ember/enumerable/mutable-internal.js — 504 B / 230 B
./packages/@ember/enumerable/mutable.js 623 B / 288 B 57%↑981 B / 39%↑399 B
./packages/@ember/object/mixin-internal.js — 15.3 kB / 4 kB
./packages/@ember/object/mixin.js 497 B / 207 B 440%↑2.7 kB / 291%↑810 B
./packages/@ember/object/observable-internal.js — 3.9 kB / 1 kB
./packages/@ember/object/observable.js 6.2 kB / 1.7 kB -50.4%↓3.1 kB / -39.4%↓1 kB
./packages/shared-chunks/computed-ZvOk7SJQ.js 27.9 kB / 6.5 kB —
./packages/shared-chunks/evented-{hash}.js 3.3 kB / 855 B 6%↑3.5 kB / -0.12%↓854 B
./packages/shared-chunks/mixin-AGmJaAAY.js 16.7 kB / 4.4 kB —
./packages/shared-chunks/properties-D102MiiO.js — 27.9 kB / 6.5 kB

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

File Before (Size / Brotli) After (Size / Brotli)
./assets/api-{hash}.js 291.4 kB / 78.2 kB 0.8%↑293.7 kB / 0.2%↑78.4 kB
./assets/modules-{hash}.js 30.1 kB / 9.3 kB 8%↑32.4 kB / 4%↑9.7 kB
Total (Includes all files) 344.2 kB / 95.3 kB 1%↑348.8 kB / 0.6%↑95.9 kB

smoke-tests/v2-app-hello-world-template/dist   -1.86%↓

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 134.9 kB / 37.6 kB -1.87%↓132.4 kB / -1.43%↓37 kB
Total (Includes all files) 135.2 kB / 37.7 kB -1.86%↓132.7 kB / -1.42%↓37.2 kB

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

Comment thread packages/@ember/object/index.ts Outdated
class EmberObject extends CoreObject {
static {
// `extend(Observable)` would fire the Observable deprecation for every app.
this.PrototypeMixin.reopen(Observable);

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 #1116 deprecates applying Ember's mixins, but Ember's own internals are
built on several of them. Those mixins need to exist twice: an internal copy
that applies silently, and a public copy that emits the deprecation.

This is the mechanical half -- the six mixins under @ember/-internals move to
`-internal` filenames with their contents unchanged, and their importers
follow. The public, deprecating copies are added in the next commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KPGHrcnbnsLd433MgECeM5
@NullVoxPopuli
NullVoxPopuli force-pushed the nvp/deprecate-mixin-followups branch from 384cda3 to d6f0090 Compare September 2, 2026 16:49
Every mixin Ember applies to its own classes now exists twice: the internal
copy applies silently, and the public copy wraps it and emits the deprecation
from `init`. The public copies keep the API documentation; the internal copies
carry the implementation.

`Mixin` itself gets the same treatment -- `InternalMixin` holds the machinery
and `Mixin.create` is the deprecating subclass -- which lets the
`INTERNAL_MIXIN_CREATE` symbol go away entirely.

Because the two copies are distinct objects, `meta.hasMixin` would no longer
match a public mixin against an object that only ever had the internal copy
applied. `DeprecatedMixin` overrides `detect` to look through to the wrapped
copy, so `EmberArray.detect(someArrayProxy)` keeps working while the
deprecation is live.

Ember's own tests that exercise a mixin's behavior now apply the internal copy,
matching what the framework does; tests that specifically cover the deprecation
keep using the public copy. `EmberObject` already applies the internal
`Observable`, so `observable_test` no longer re-applies the public one on top.

The internal copies are kept out of `renamed-modules` so they are not
advertised as importable module paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KPGHrcnbnsLd433MgECeM5
@NullVoxPopuli
NullVoxPopuli force-pushed the nvp/deprecate-mixin-followups branch from d6f0090 to 075a2b2 Compare September 2, 2026 17:09

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.

i'm 🤷 on if these should us the public copies or not

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.

we will be deleting the public code ahead of when we cleanup our own code, so perhaps the way this is is better

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.

for how big this change, I 100% think we should rely on the existing tests as much as we can

send(actionName: string, ...args: unknown[]): void;
}
const ActionSupport = Mixin[INTERNAL_MIXIN_CREATE]({
send(actionName: string, ...args: unknown[]) {

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 deprecation does still exist in the internal copy

@NullVoxPopuli
NullVoxPopuli marked this pull request as draft September 2, 2026 17:38
Comment thread rollup.config.mjs

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.

I didn't want to expose all these new internal files as importable things, so they got filtered out

@NullVoxPopuli
NullVoxPopuli marked this pull request as ready for review September 3, 2026 14:03

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.

I need to add quite a few more deprecation guides, because all of these are technically importable

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.

1 participant