Deprecate TargetActionSupport, ActionHandler#send, and ActionSupport#send (RFC 1041)#21490
Conversation
Implements emberjs/rfcs#1041: deprecates TargetActionSupport#triggerAction, ActionHandler#send, and ActionSupport#send under the single deprecation id deprecate-target-action-support, staged as available (not yet enabled) since the RFC is at the Accepted stage. Co-authored-by: Peter Wagenet <peter@wagenet.us>
|
It turns out that this PR is actually pretty small -- most of the changes are tests. Step next: see if our smoke tests throw deprecations (hopefully not?) @kategengler or @mansona do we have a way to run the tutorial ci against an ember.js PR? (if not, this would be immensely helpful for the slew of deprecations we need to ship in v7) |
kategengler
left a comment
There was a problem hiding this comment.
Just took a quick look since it is past my bedtime.
I think this is broader than TargetActionSupport which is fine since I think most of it is vestigial, but we should update the RFC.
I think the deprecation messages could use some work.
I'm suspicious of the tests in some of test files that do not have expectDeprecation -- should including the mixin also throw a deprecation ala the deprecation for the Comparable mixin?
ember.js/packages/@ember/-internals/runtime/lib/mixins/comparable.ts
Lines 41 to 47 in ce5b156
Implements RFC 1041: Deprecate TargetActionSupport.
This finishes the work started in #20969 (the original commit is preserved with @wagenet as author; a follow-up commit replaces the placeholder ids/messages).
What this does
Deprecates the three APIs listed in the RFC's detailed design:
TargetActionSupport#triggerActionActionHandler#sendActionSupport#send(classic componentsend)All three emit under a single deprecation id,
deprecate-target-action-support, matching the guide added in ember-learn/deprecation-app#1410.Design decisions (answering the open questions from #20969)
deprecate-target-action-support, registered in theDEPRECATIONSobject in@ember/-internals/deprecationsand emitted viadeprecateUntil, likedeprecate-comparable-mixin.since: { available: '7.3.0' },until: '8.0.0'. Per the deprecation-staging convention documented in@ember/-internals/deprecations,enabledis intentionally not set because RFC 1041 is at the Accepted stage, not Ready for Release — so by default the deprecation is staged as available only. (The guide in Add Target Action Support deprecation guide ember-learn/deprecation-app#1410 still sayssince: 6.8.0/until: 7.0.0and will need the same version bump.)Route#sendis untouched: it has its own implementation and is not in the RFC's list; router-internal event dispatch (triggerEvent) never goes through these mixin methods, so framework internals do not trigger the deprecation.Tests
Tests exercising the deprecated APIs now use the
expectDeprecation(matcher, DEPRECATIONS.DEPRECATE_TARGET_ACTION_SUPPORT.isEnabled)+testUnless(...isRemoved)pattern so they pass in every CI variant. Routing tests that only usedsendincidentally were migrated off it (e.g.router.refresh()/ direct method calls).Verified locally:
ALL_DEPRECATIONS_ENABLED=true,OVERRIDE_DEPRECATION_VERSION=15.0.0, and production build — 0 failurestype-check:internals,type-check:types, eslint, prettier, node tests, and docs coverage🤖 Generated with Claude Code