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

Refactor polaris-button to ES6 class#358

Merged
vladucu merged 8 commits into
refactor/es6-classesfrom
refactor/es6-polaris-button
Aug 8, 2019
Merged

Refactor polaris-button to ES6 class#358
vladucu merged 8 commits into
refactor/es6-classesfrom
refactor/es6-polaris-button

Conversation

@vladucu
Copy link
Copy Markdown
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
Comment thread addon/components/polaris-button.js Outdated
Comment thread addon/components/polaris-button.js Outdated
Comment thread addon/components/polaris-button.js
Comment thread addon/components/polaris-button.js Outdated
ariaExpandedValue: computed('ariaExpanded', function() {
let ariaExpanded = this.get('ariaExpanded');
@computed('ariaExpanded')
get ariaExpandedValue() {
Copy link
Copy Markdown
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.

Comment thread addon/components/polaris-button.js Outdated

@computed('submit')
get type() {
return this.submit === true ? 'submit' : 'button';
Copy link
Copy Markdown
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?

Comment thread addon/components/polaris-button.js Outdated
* button element's event object as the first parameter.
*/
@action
invokeMouseAction(actionName) {
Copy link
Copy Markdown
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
Copy Markdown
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