Skip to content

Deprecate Evented and @ember/object/events per RFC 1111 - #21542

Open
NullVoxPopuli wants to merge 1 commit into
mainfrom
deprecate-evented
Open

Deprecate Evented and @ember/object/events per RFC 1111#21542
NullVoxPopuli wants to merge 1 commit into
mainfrom
deprecate-evented

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

RFC advancement PR: emberjs/rfcs#1139

Supersedes:

I haven't been able to get the deprecations to show -- which I feel like is a workflow / skill issue on my part.

my apps also don't use any of the deprecated apis I think.

I did test router/router-service, and there are no deprecations there, which is good

Deprecation Guide


PR Description from #21491

Implements RFC 1111: Deprecating Ember.Evented and @ember/object/events.

This finishes the work started in #20970 (the squashed original work is preserved with @wagenet as author; a follow-up commit rebases it onto current main and resolves the open questions).

What this deprecates

All under the single id deprecate-evented (since: { available: '7.3.0' }, until: '8.0.0', staged as available only since the RFC is at the Accepted stage):

  • Applying the Evented mixin (via a new internal mixin-deprecation mechanism: setDeprecation/findDeprecation fire in Mixin#reopen when a deprecated mixin — or a mixin containing one — is applied, DEBUG-only)
  • Calling the Evented methods on/one/off/trigger/has (including on framework classes like classic Component, Route, and EmberRouter)
  • addListener/removeListener/sendEvent imported from @ember/object/events (deprecating wrappers; the internal @ember/-internals/metal implementations remain silent)
  • The on() event decorator from @ember/object/evented

RouterService exemption

Per the RFC, RouterService's event methods are not deprecated: it no longer extends Evented and instead implements on/one/off/trigger/has directly on top of the internal (non-deprecating) listener functions, with routeWillChange/routeDidChange documented types.

Framework internals fire no deprecations

  • Internal mixin applications (CoreView, Route, EmberRouter) are wrapped in disableDeprecations()
  • Classic component lifecycle events (didInsertElement, willRender, …) and EventDispatcher dispatch now go through new internal sendCoreViewEvent/hasCoreViewListener helpers instead of view.trigger()/view.has()
  • Route activate/deactivate and EmberRouter routeWillChange/routeDidChange use internal sendEvent directly
  • Mixin observer/listener bookkeeping uses the internal addListener/removeListener

This is proven by the ALL_DEPRECATIONS_ENABLED=true suite run: any unexpected deprecation fails a test, and all 9427 tests pass.

Differences from #20970

  • Deprecation id settled as deprecate-evented (was placeholder ember-evented), versions updated from 6.12.0 to 7.3.0; the guide in Add deprecation guide for Ember.Evented and @ember/object/events ember-learn/deprecation-app#1404 (evented.md) should be renamed to deprecate-evented.md and its versions updated to match
  • Rebased onto current main: deep-path imports (ember-local/no-barrel-imports), the removed packages/ember barrel, and the reorganized glimmer internals
  • The previously failing smoke tests and Node.js tests pass (failures appear to have been staleness of the old branch)

Verified locally

  • Browser suite in all four variants: default, ALL_DEPRECATIONS_ENABLED=true, OVERRIDE_DEPRECATION_VERSION=15.0.0, production — 0 failures
  • All 7 smoke-test scenarios (classic, embroider webpack/vite, strict resolver, node), plus classic-basics with OVERRIDE_DEPRECATION_VERSION=15.0.0
  • type-check:internals, type-check:types, eslint, prettier, node tests, docs coverage

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

📊 Size report

Tarball size1.2 MB1.2 MB

dist/dev   0.4%↑

File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 5.3 kB / 1.6 kB 4%↑5.5 kB / 2%↑1.6 kB
./packages/@ember/-internals/views/lib/views/core_view.js 2.3 kB / 826 B 8%↑2.5 kB / 3%↑850 B
./packages/@ember/-internals/views/lib/views/core-view-utils.js 461 B / 207 B
./packages/@ember/-internals/views/lib/views/states.js 3.2 kB / 973 B 4%↑3.3 kB / 5%↑1 kB
./packages/@ember/application/instance.js 15.9 kB / 4.4 kB 0.8%↑16 kB / 1%↑4.5 kB
./packages/@ember/object/evented.js 1.6 kB / 542 B -89.9%↓159 B / -80.3%↓107 B
./packages/@ember/object/events.js 112 B / 96 B 918%↑1.1 kB / 238%↑324 B
./packages/@ember/routing/route.js 60.3 kB / 13.4 kB 1%↑61.1 kB / 2%↑13.6 kB
./packages/@ember/routing/router-service.js 25.2 kB / 5.3 kB 9%↑27.6 kB / 8%↑5.8 kB
./packages/@ember/routing/router.js 52 kB / 11.7 kB 2%↑52.8 kB / 2%↑11.9 kB
./packages/shared-chunks/curly-{hash}.js 21.5 kB / 5.1 kB 1%↑21.8 kB / 0.3%↑5.1 kB
./packages/shared-chunks/evented-zEehJUti.js 3.2 kB / 820 B
./packages/shared-chunks/events-{hash}.js 5.7 kB / 1.5 kB 6%↑6 kB / 7%↑1.6 kB
./packages/shared-chunks/setup-{hash}.js 33.1 kB / 8.7 kB 0.4%↑33.2 kB / 0.2%↑8.7 kB
Total (Includes all files) 2 MB / 489.8 kB 0.4%↑2.1 MB / 0.4%↑491.8 kB

dist/prod   0.5%↑

File Before (Size / Brotli) After (Size / Brotli)
./packages/@ember/-internals/deprecations/index.js 5 kB / 1.5 kB 5%↑5.2 kB / 2%↑1.5 kB
./packages/@ember/-internals/views/lib/views/core_view.js 2.3 kB / 827 B 8%↑2.5 kB / 3%↑853 B
./packages/@ember/-internals/views/lib/views/core-view-utils.js 461 B / 208 B
./packages/@ember/-internals/views/lib/views/states.js 2.4 kB / 749 B 6%↑2.6 kB / 5%↑784 B
./packages/@ember/object/evented.js 1.6 kB / 530 B -89.9%↓159 B / -80.6%↓103 B
./packages/@ember/object/events.js 112 B / 100 B 918%↑1.1 kB / 227%↑327 B
./packages/@ember/routing/route.js 54.8 kB / 12.1 kB 2%↑55.7 kB / 2%↑12.3 kB
./packages/@ember/routing/router-service.js 24 kB / 5.1 kB 10%↑26.4 kB / 8%↑5.5 kB
./packages/@ember/routing/router.js 44.1 kB / 10.2 kB 2%↑44.9 kB / 2%↑10.5 kB
./packages/shared-chunks/curly-{hash}.js 17.2 kB / 4.3 kB 1%↑17.5 kB / 0.6%↑4.4 kB
./packages/shared-chunks/evented-BDD1ZNtO.js 3.2 kB / 820 B
./packages/shared-chunks/events-{hash}.js 4.7 kB / 1.4 kB 7%↑5 kB / 8%↑1.5 kB
./packages/shared-chunks/setup-{hash}.js 28.7 kB / 7.6 kB 0.4%↑28.8 kB / 0.5%↑7.7 kB
Total (Includes all files) 1.9 MB / 447.2 kB 0.5%↑1.9 MB / 0.5%↑449.2 kB

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

File Before (Size / Brotli) After (Size / Brotli)
./assets/api-{hash}.js 288.5 kB / 77.8 kB 0.6%↑290.2 kB / 0.3%↑78 kB
./assets/modules-{hash}.js 29.4 kB / 9.2 kB 0.5%↑29.6 kB / 0.3%↑9.2 kB
Total (Includes all files) 340.6 kB / 94.8 kB 0.5%↑342.5 kB / 0.2%↑95 kB

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

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 132.4 kB / 37 kB 0%↑132.4 kB / 0.05%↑37 kB

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

@NullVoxPopuli-ai-agent

NullVoxPopuli-ai-agent commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Where each RFC 1111 deprecation is handled:

Follow-ups outside this repo: ember-learn/deprecation-app#1404 needs evented.mddeprecate-evented.md + version bump; since.enabled gets added once the RFC is Ready for Release.

}

[`@test (new) lifecycle hooks during component append`](assert) {
[`${testUnless(DEPRECATIONS.DEPRECATE_EVENTED.isRemoved)} @test (new) lifecycle hooks during component append`](

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 test continue to exist after the deprecation is removed? It sounds like it is testing more than the deprecated behavior

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.

ya, -- this'll be removed with the ember/component deprecation later

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.

yup, fixed

}).create();
if (!DEPRECATIONS.DEPRECATE_EVENTED.isRemoved) {
moduleFor(
'Syntax test: {{#each}} with array proxies, content is updated after init',

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.

This test also doesn't seem dependent upon the deprecated behavior?

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.

it uses on -- and observers use Evented

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.

Are you saying that deprecating Evented soft-deprecates observers?

I meant that I felt this test should continue to exist after the removal of Evented. But that's going from the title of the test. init continues to exist without on

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.

not exactly -- it's specifically the on decorator from @ember/object/evented that is deprecated, and since that's used in the test, I suppose we could just define init rather than use the event for init -- I'll update to that so tha test can stay around (or rather, have a more precise deprecation later, since I think emberA is supposed to be deprecated, but that deprecation is not shipped)

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.

👍 exactly what I was trying to say

Comment thread packages/@ember/object/tests/evented_test.js Outdated
@NullVoxPopuli
NullVoxPopuli force-pushed the deprecate-evented branch 3 times, most recently from 2078983 to f7e5b7f Compare August 13, 2026 20:39
}

[`@test lifecycle hooks during component append`](assert) {
[`${testUnless(DEPRECATIONS.DEPRECATE_EVENTED.isRemoved)} @test lifecycle hooks during component append`](

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 test remain even after this deprecation is removed?

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.

yes, thank you

}).create();
if (!DEPRECATIONS.DEPRECATE_EVENTED.isRemoved) {
moduleFor(
'Syntax test: {{#each}} with array proxies, content is updated after init',

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.

Are you saying that deprecating Evented soft-deprecates observers?

I meant that I felt this test should continue to exist after the removal of Evented. But that's going from the title of the test. init continues to exist without on

Squashed from PR #20970 by Peter Wagenet, rebased onto current main.

Co-authored-by: Peter Wagenet <peter@wagenet.us>

Finish RFC 1111 implementation: id/versions, deep imports, main compatibility

- Register the deprecation as `deprecate-evented` (since 7.3.0, until 8.0.0),
  matching the current DEPRECATIONS id conventions
- Use deep module imports per current main conventions
- Drop the resurrected packages/ember/barrel.ts (deleted on main)
- Drop the mixin-deprecation re-exports from the eager utils barrel

Teach the side-effect probe that setDeprecation is metadata association

setDeprecation(mixin, value) only writes onto its first argument, so when
the mixin is file-local (as in @ember/object/evented) the association is
unobservable unless the module's bindings are imported — same category as
setClassicDecorator and friends.

Restore Function-based signatures in internal event plumbing

The Function -> ((...args: any[]) => void) narrowing in metal/meta only
served the internal signatures and forced casts at every call site. Keep
the this-aware overloads on the public deprecated surface
(@ember/object/events, RouterService) and leave the internal plumbing
typed as it was on main, so the diff only carries the deprecation work.

Inline Evented methods on framework classes instead of applying the mixin

CoreView, Route, and EmberRouter now define on/one/off/trigger/has as
native class methods delegating to shared standalone implementations
(metal/lib/evented-methods), the same shape RouterService already uses.
The framework no longer applies the deprecated Evented mixin anywhere,
which removes the machinery that existed only to silence internal
applications:

- utils/lib/mixin-deprecation.ts (setDeprecation/findDeprecation/
  disableDeprecations) and the Mixin#reopen DEBUG hook are gone;
  the deprecation is communicated by the methods themselves.
- CoreView's init-time trigger/has swap hack is unnecessary now that
  the overrides are ordinary class methods.
- @ember/object/evented no longer has a top-level setDeprecation call,
  so the module is side-effect free again and the tree-shakability
  probe no longer needs to know about setDeprecation.

Tests that expected the definition-time "Evented is deprecated" warning
now create their objects without a wrapper; method-call deprecations are
unchanged.

Keep Evented.detect true for framework classes

CoreView, Route, and EmberRouter no longer apply the Evented mixin, but
their instances still provide its methods. Record Evented in each
prototype's meta from a class static block so Mixin#detect keeps
answering true for instances and subclasses, exactly as it did when the
mixin was applied.
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.

4 participants