Skip to content

Ember 6 Compat: Remove "action", Change to Class Style#74

Closed
ladadeedee wants to merge 2 commits intobtecu:masterfrom
ladadeedee:ember-six
Closed

Ember 6 Compat: Remove "action", Change to Class Style#74
ladadeedee wants to merge 2 commits intobtecu:masterfrom
ladadeedee:ember-six

Conversation

@ladadeedee
Copy link
Copy Markdown
Contributor

@ladadeedee ladadeedee commented Mar 31, 2025

Ember 6 removes support for "action" helper in templates officially, after a long period of deprecation. https://deprecations.emberjs.com/id/template-action/

This PR does two big things and a few minor things:

  1. Replace all uses of action in templates with either direct references or fn helper if currying is needed
  2. Updates JS files to be in class syntax rather than classic syntax
  3. Remove custom handleMouseEnter code on select-dropdown-option, simplifying code
  4. Removes oninput binding on the input element since there was an issue with the order of events fired. Its functionality was moved into the existing keypress handler. This required a minor workaround since the input element's value is not updated until after the key has been handled, requiring us to concat the current value plus the newly-entered key
  5. Remove old IE bug handling in blur()
  6. Renames dropdown handler due to a conflict between the passed-in value (a string, to specify custom dropdown component) and a function
  7. Likewise, removes select from being passed to the dropdown component due to naming conflicts. Use parent.select instead

Basic, functionality appears to be working. I'm opening this as a draft to gather feedback.

super.didReceiveAttrs(...arguments);

// Tree built in extended component
let groups = this.get('list');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this be this.list now?

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.

We can change a lot of these this.get() calls but I don't want to cause too much change in this PR. this.set() is most likely off-limits until we move to Glimmer.

@btecu
Copy link
Copy Markdown
Owner

btecu commented Mar 31, 2025

Excellent work @ladadeedee!

Would it be possible to separate some of the smaller changes into different pull requests?

The one concern I have is about oninput -> keypress conversion.

@ladadeedee
Copy link
Copy Markdown
Contributor Author

Once you finish your cleanup, I'll rebase (painfully) and see where we stand.

@ladadeedee
Copy link
Copy Markdown
Contributor Author

We've manually applied pretty much all of the changes here.

@ladadeedee ladadeedee closed this May 1, 2025
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