Skip to content

Deprecate Evented#20970

Draft
wagenet wants to merge 10 commits intoemberjs:mainfrom
wagenet:deprecate-evented
Draft

Deprecate Evented#20970
wagenet wants to merge 10 commits intoemberjs:mainfrom
wagenet:deprecate-evented

Conversation

@wagenet
Copy link
Member

@wagenet wagenet commented Sep 4, 2025

We still need to figure out correct deprecation ids.

ember-learn/deprecation-app#1404

@wagenet
Copy link
Member Author

wagenet commented Sep 5, 2025

I just realized that the approach of two mixins may not work with detect. We might be able to do what we want with a Proxy.

EDIT: A Proxy won't easily work either because we look for whether it's in a Set and the Proxy-wrapped version is not identical to the original. As annoying as this is, the best approach is probably just to have a way to temporarily disable the deprecation when used in Ember internals.

EDIT 2: I've reworked this and it should work as expected now.

@wagenet wagenet force-pushed the deprecate-evented branch 2 times, most recently from 4a66206 to 6a955a2 Compare September 5, 2025 04:52
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Estimated Asset Sizes

Diff

--- main/out.txt	2026-02-17 19:37:18.000000000 +0000
+++ pr/./pr-22161890309/out.txt	2026-02-18 23:29:44.000000000 +0000
@@ -1,46 +1,46 @@
 ╔═══════╤═══════════╤═══════════╗
 ║       │ Min       │ Gzip      ║
 ╟───────┼───────────┼───────────╢
-║ Total │ 351.99 KB │ 203.84 KB ║
+║ Total │ 357.48 KB │ 206.31 KB ║
 ╚═══════╧═══════════╧═══════════╝
 
 ╔══════════════════════╤═══════════╤═══════════╗
 ║ @ember/*             │ Min       │ Gzip      ║
 ╟──────────────────────┼───────────┼───────────╢
-║ Total                │ 313.39 KB │ 181.91 KB ║
+║ Total                │ 318.77 KB │ 184.35 KB ║
 ╟──────────────────────┼───────────┼───────────╢
-║ -internals           │ 36.65 KB  │ 26.22 KB  ║
-║ application          │ 13.23 KB  │ 8.05 KB   ║
-║ array                │ 13.01 KB  │ 7.46 KB   ║
+║ -internals           │ 38.42 KB  │ 27.26 KB  ║
+║ application          │ 13.35 KB  │ 8.09 KB   ║
+║ array                │ 13.1 KB   │ 7.55 KB   ║
 ║ canary-features      │ 304 B     │ 389 B     ║
-║ component            │ 2.05 KB   │ 1.64 KB   ║
-║ controller           │ 1.96 KB   │ 1.41 KB   ║
-║ debug                │ 11.69 KB  │ 8.12 KB   ║
+║ component            │ 2.05 KB   │ 1.59 KB   ║
+║ controller           │ 2.01 KB   │ 1.45 KB   ║
+║ debug                │ 11.77 KB  │ 8.16 KB   ║
 ║ deprecated-features  │ 31 B      │ 77 B      ║
 ║ destroyable          │ 561 B     │ 383 B     ║
 ║ enumerable           │ 259 B     │ 387 B     ║
-║ helper               │ 1.08 KB   │ 811 B     ║
+║ helper               │ 1.08 KB   │ 814 B     ║
 ║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
-║ modifier             │ 1.22 KB   │ 965 B     ║
-║ object               │ 35.94 KB  │ 22.16 KB  ║
+║ modifier             │ 1.22 KB   │ 964 B     ║
+║ object               │ 38.38 KB  │ 23.11 KB  ║
 ║ owner                │ 159 B     │ 178 B     ║
-║ renderer             │ 630 B     │ 487 B     ║
-║ routing              │ 59.3 KB   │ 34.12 KB  ║
-║ runloop              │ 2.36 KB   │ 1.5 KB    ║
-║ service              │ 1 KB      │ 845 B     ║
-║ template             │ 654 B     │ 541 B     ║
+║ renderer             │ 630 B     │ 478 B     ║
+║ routing              │ 60.03 KB  │ 34.36 KB  ║
+║ runloop              │ 2.41 KB   │ 1.52 KB   ║
+║ service              │ 1 KB      │ 832 B     ║
+║ template             │ 654 B     │ 523 B     ║
 ║ template-compilation │ 429 B     │ 366 B     ║
 ║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
 ║ template-factory     │ 370 B     │ 374 B     ║
 ║ test                 │ 923 B     │ 627 B     ║
-║ utils                │ 4.11 KB   │ 3.6 KB    ║
+║ utils                │ 4.15 KB   │ 3.65 KB   ║
 ║ version              │ 55 B      │ 131 B     ║
 ╚══════════════════════╧═══════════╧═══════════╝
 
 ╔═════════════════╤══════════╤══════════╗
 ║ @glimmer/*      │ Min      │ Gzip     ║
 ╟─────────────────┼──────────┼──────────╢
-║ Total           │ 38.6 KB  │ 21.94 KB ║
+║ Total           │ 38.71 KB │ 21.96 KB ║
 ╟─────────────────┼──────────┼──────────╢
 ║ destroyable     │ 2.77 KB  │ 1.39 KB  ║
 ║ encoder         │ 81 B     │ 171 B    ║
@@ -53,7 +53,7 @@
 ║ program         │ 252 B    │ 301 B    ║
 ║ reference       │ 548 B    │ 531 B    ║
 ║ runtime         │ 10.32 KB │ 5.32 KB  ║
-║ tracking        │ 1.34 KB  │ 1.16 KB  ║
+║ tracking        │ 1.45 KB  │ 1.19 KB  ║
 ║ util            │ 1.94 KB  │ 1.68 KB  ║
 ║ validator       │ 15.75 KB │ 6.96 KB  ║
 ║ vm              │ 495 B    │ 569 B    ║

Details

This PRmain
╔═══════╤═══════════╤═══════════╗
║       │ Min       │ Gzip      ║
╟───────┼───────────┼───────────╢
║ Total │ 357.48 KB │ 206.31 KB ║
╚═══════╧═══════════╧═══════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 318.77 KB │ 184.35 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 38.42 KB  │ 27.26 KB  ║
║ application          │ 13.35 KB  │ 8.09 KB   ║
║ array                │ 13.1 KB   │ 7.55 KB   ║
║ canary-features      │ 304 B     │ 389 B     ║
║ component            │ 2.05 KB   │ 1.59 KB   ║
║ controller           │ 2.01 KB   │ 1.45 KB   ║
║ debug                │ 11.77 KB  │ 8.16 KB   ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 814 B     ║
║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
║ modifier             │ 1.22 KB   │ 964 B     ║
║ object               │ 38.38 KB  │ 23.11 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 630 B     │ 478 B     ║
║ routing              │ 60.03 KB  │ 34.36 KB  ║
║ runloop              │ 2.41 KB   │ 1.52 KB   ║
║ service              │ 1 KB      │ 832 B     ║
║ template             │ 654 B     │ 523 B     ║
║ template-compilation │ 429 B     │ 366 B     ║
║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
║ template-factory     │ 370 B     │ 374 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.15 KB   │ 3.65 KB   ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 38.71 KB │ 21.96 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 2.77 KB  │ 1.39 KB  ║
║ encoder         │ 81 B     │ 171 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 886 B    │ 545 B    ║
║ manager         │ 977 B    │ 608 B    ║
║ node            │ 175 B    │ 260 B    ║
║ opcode-compiler │ 1.11 KB  │ 894 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 252 B    │ 301 B    ║
║ reference       │ 548 B    │ 531 B    ║
║ runtime         │ 10.32 KB │ 5.32 KB  ║
║ tracking        │ 1.45 KB  │ 1.19 KB  ║
║ util            │ 1.94 KB  │ 1.68 KB  ║
║ validator       │ 15.75 KB │ 6.96 KB  ║
║ vm              │ 495 B    │ 569 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝
╔═══════╤═══════════╤═══════════╗
║       │ Min       │ Gzip      ║
╟───────┼───────────┼───────────╢
║ Total │ 351.99 KB │ 203.84 KB ║
╚═══════╧═══════════╧═══════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 313.39 KB │ 181.91 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 36.65 KB  │ 26.22 KB  ║
║ application          │ 13.23 KB  │ 8.05 KB   ║
║ array                │ 13.01 KB  │ 7.46 KB   ║
║ canary-features      │ 304 B     │ 389 B     ║
║ component            │ 2.05 KB   │ 1.64 KB   ║
║ controller           │ 1.96 KB   │ 1.41 KB   ║
║ debug                │ 11.69 KB  │ 8.12 KB   ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 811 B     ║
║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
║ modifier             │ 1.22 KB   │ 965 B     ║
║ object               │ 35.94 KB  │ 22.16 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 630 B     │ 487 B     ║
║ routing              │ 59.3 KB   │ 34.12 KB  ║
║ runloop              │ 2.36 KB   │ 1.5 KB    ║
║ service              │ 1 KB      │ 845 B     ║
║ template             │ 654 B     │ 541 B     ║
║ template-compilation │ 429 B     │ 366 B     ║
║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
║ template-factory     │ 370 B     │ 374 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.11 KB   │ 3.6 KB    ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 38.6 KB  │ 21.94 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 2.77 KB  │ 1.39 KB  ║
║ encoder         │ 81 B     │ 171 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 886 B    │ 545 B    ║
║ manager         │ 977 B    │ 608 B    ║
║ node            │ 175 B    │ 260 B    ║
║ opcode-compiler │ 1.11 KB  │ 894 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 252 B    │ 301 B    ║
║ reference       │ 548 B    │ 531 B    ║
║ runtime         │ 10.32 KB │ 5.32 KB  ║
║ tracking        │ 1.34 KB  │ 1.16 KB  ║
║ util            │ 1.94 KB  │ 1.68 KB  ║
║ validator       │ 15.75 KB │ 6.96 KB  ║
║ vm              │ 495 B    │ 569 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝

Copy link
Contributor

Choose a reason for hiding this comment

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

Notes from RFC discussion: this file might have been unintentionally included.

wagenet and others added 4 commits February 16, 2026 21:38
- Add DEPRECATE_EVENTED to centralized deprecations registry
- Consolidate all deprecation IDs to single 'ember-evented' ID
- Switch all deprecate() calls to deprecateUntil() pattern
- Update mixin deprecation infrastructure for DeprecationObject
- Fix deprecation messages for consistency
- Remove internal Evented copy from runtime package
- Update all test files to use DEPRECATIONS.DEPRECATE_EVENTED.isEnabled
- Revert unrelated barrel.ts onerror doc change

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
wagenet and others added 6 commits February 16, 2026 22:31
- Fix regex mismatch in each-test.js (/`on` is/ -> /`on()` event decorator/)
- Add missing DEPRECATIONS.DEPRECATE_EVENTED.isEnabled argument
- Fix 'actaully' typo in router-service.ts (3 instances)
- Fix triple-asterisk JSDoc comment in mixin.ts

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove unused expectDeprecation import and fix eslint-disable directives for duplicate class members. Apply prettier formatting to test files.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Export mixin-deprecation utilities from @ember/-internals/utils
- Update imports to use package exports instead of deep imports
- Add type assertions for observer and listener methods
- Restore function overloads for addListener/removeListener exports
- Add specific on() overload for route events to properly type transition callbacks
- Change trigger() return type from any to boolean (matches sendEvent behavior)
- Format observer.ts with prettier

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…DE_DEPRECATION_VERSION variants

- Wrap EmberObject.extend(Evented).create() calls in expectDeprecation in events_test.js,
  since the mixin-level deprecation fires at class creation time
- Add testUnless(DEPRECATIONS.DEPRECATE_EVENTED.isRemoved) guards to tests that use on(),
  Evented methods, or the on() event decorator, so they skip when the API is removed
- Guard the 'each with array proxies' moduleFor with if (!isRemoved) since createList()
  uses on() and can't run at all when the API is removed at OVERRIDE_DEPRECATION_VERSION=15.0.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wagenet wagenet changed the title [WIP] Deprecate Evented Deprecate Evented Feb 18, 2026
DEPRECATE_EVENTED: deprecation({
id: 'ember-evented',
for: 'ember-source',
since: { available: '6.12.0' },
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
since: { available: '6.12.0' },
since: { available: '7.1.0' },

If you really need the original behavior:

`import { getOnerror, setOnerror } from '@ember/-internals/error-handling';`
A function may be assigned to `Ember.onerror` to be called when Ember
Copy link
Member

Choose a reason for hiding this comment

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

This reverts some docs changes

# couple of the files. Once it is, we can switch this over to just ignoring
# `types/stable` entirely.
types/stable
.puppeteer-cache/
Copy link
Member

Choose a reason for hiding this comment

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

This was removed intentionally -- we no longer use puppeteer

@kategengler
Copy link
Member

Do you think you could split this into a few PRs?

  • Replacing the API on router
  • Replacing internal usages
  • Deprecating evented

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.

3 participants