Deprecate Evented and @ember/object/events (RFC 1111)#21491
Open
NullVoxPopuli-ai-agent wants to merge 2 commits into
Open
Deprecate Evented and @ember/object/events (RFC 1111)#21491NullVoxPopuli-ai-agent wants to merge 2 commits into
NullVoxPopuli-ai-agent wants to merge 2 commits into
Conversation
Squashed from PR emberjs#20970 by Peter Wagenet, rebased onto current main. Co-authored-by: Peter Wagenet <peter@wagenet.us>
…tibility - 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
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.
Implements RFC 1111: Deprecating
Ember.Eventedand@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
mainand 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):Eventedmixin (via a new internal mixin-deprecation mechanism:setDeprecation/findDeprecationfire inMixin#reopenwhen a deprecated mixin — or a mixin containing one — is applied,DEBUG-only)Eventedmethodson/one/off/trigger/has(including on framework classes like classicComponent,Route, andEmberRouter)addListener/removeListener/sendEventimported from@ember/object/events(deprecating wrappers; the internal@ember/-internals/metalimplementations remain silent)on()event decorator from@ember/object/eventedRouterService exemption
Per the RFC,
RouterService's event methods are not deprecated: it no longer extendsEventedand instead implementson/one/off/trigger/hasdirectly on top of the internal (non-deprecating) listener functions, withrouteWillChange/routeDidChangedocumented types.Framework internals fire no deprecations
CoreView,Route,EmberRouter) are wrapped indisableDeprecations()didInsertElement,willRender, …) andEventDispatcherdispatch now go through new internalsendCoreViewEvent/hasCoreViewListenerhelpers instead ofview.trigger()/view.has()Routeactivate/deactivateandEmberRouterrouteWillChange/routeDidChangeuse internalsendEventdirectlyaddListener/removeListenerThis is proven by the
ALL_DEPRECATIONS_ENABLED=truesuite run: any unexpected deprecation fails a test, and all 9427 tests pass.Differences from #20970
deprecate-evented(was placeholderember-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 todeprecate-evented.mdand its versions updated to matchmain: deep-path imports (ember-local/no-barrel-imports), the removedpackages/emberbarrel, and the reorganized glimmer internalsVerified locally
ALL_DEPRECATIONS_ENABLED=true,OVERRIDE_DEPRECATION_VERSION=15.0.0, production — 0 failuresOVERRIDE_DEPRECATION_VERSION=15.0.0type-check:internals,type-check:types, eslint, prettier, node tests, docs coverage🤖 Generated with Claude Code