Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Refactor polaris-button to ES6 class #358

Merged
merged 8 commits into from
Aug 8, 2019

Conversation

vladucu
Copy link
Member

@vladucu vladucu commented Aug 7, 2019

What's here

  • refactors to ES6 class
  • template-only components
  • angle-bracket syntax
  • deprecates externalClasses - going forward an HTML class attribute can be used

NOTE

Tests are failing on beta & canary, likely related to ember-decorators/ember-decorators#451

@vladucu vladucu self-assigned this Aug 7, 2019
addon/components/polaris-button.js Outdated Show resolved Hide resolved
addon/components/polaris-button.js Outdated Show resolved Hide resolved
addon/components/polaris-button.js Show resolved Hide resolved
ariaExpandedValue: computed('ariaExpanded', function() {
let ariaExpanded = this.get('ariaExpanded');
@computed('ariaExpanded')
get ariaExpandedValue() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this could probably go directly on the template. If an attribute is empty, it won't be rendered anyway.


@computed('submit')
get type() {
return this.submit === true ? 'submit' : 'button';
Copy link
Contributor

Choose a reason for hiding this comment

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

how do you feel about moving this to the template to help shorten this class?

* button element's event object as the first parameter.
*/
@action
invokeMouseAction(actionName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never realised that we don't send back the event. What if someone wants the event? (to prevent bubbling)

@vladucu
Copy link
Member Author

vladucu commented Aug 8, 2019

good feedback Siva...updated

@vladucu vladucu merged commit 38a7398 into refactor/es6-classes Aug 8, 2019
@vladucu vladucu deleted the refactor/es6-polaris-button branch August 8, 2019 11:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants