Skip to content

Deprecate TargetActionSupport, ActionHandler#send, and ActionSupport#send (RFC 1041)#21490

Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli-ai-agent:deprecate-target-action-support
Open

Deprecate TargetActionSupport, ActionHandler#send, and ActionSupport#send (RFC 1041)#21490
NullVoxPopuli-ai-agent wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli-ai-agent:deprecate-target-action-support

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown
Contributor

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#triggerAction
  • ActionHandler#send
  • ActionSupport#send (classic component send)

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)

  • Deprecation id: deprecate-target-action-support, registered in the DEPRECATIONS object in @ember/-internals/deprecations and emitted via deprecateUntil, like deprecate-comparable-mixin.
  • Versions: since: { available: '7.3.0' }, until: '8.0.0'. Per the deprecation-staging convention documented in @ember/-internals/deprecations, enabled is 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 says since: 6.8.0 / until: 7.0.0 and will need the same version bump.)
  • Route#send is 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 used send incidentally were migrated off it (e.g. router.refresh() / direct method calls).

Verified locally:

  • browser suite in all four variants: default, ALL_DEPRECATIONS_ENABLED=true, OVERRIDE_DEPRECATION_VERSION=15.0.0, and production build — 0 failures
  • type-check:internals, type-check:types, eslint, prettier, node tests, and docs coverage

🤖 Generated with Claude Code

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>
@NullVoxPopuli

Copy link
Copy Markdown
Contributor

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 kategengler left a comment

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.

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?

init() {
this._super(...arguments);
deprecateUntil(
'The `Comparable` mixin is deprecated. Implement a `compare` method directly on your class instead.',
DEPRECATIONS.DEPRECATE_COMPARABLE_MIXIN
);
},

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