-
Notifications
You must be signed in to change notification settings - Fork 20
refactor: transform to native classes via codemod #716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some stylistic things, no need to change as long as it works
@@ -144,15 +149,17 @@ export default Component.extend({ | |||
); | |||
|
|||
yield this["on-save"](attendance); | |||
}).drop(), | |||
}).drop()) | |||
save; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored tasks look really weird
return (get(this, "on-enter-viewport") ?? (() => {}))(); | ||
} | ||
|
||
return this.getWithDefault("on-exit-viewport", () => {})(); | ||
return (get(this, "on-exit-viewport") ?? (() => {}))(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also very weird
@(computed("current").readOnly()) | ||
get direction() { | ||
return getDirection(this.current); | ||
}).readOnly(), | ||
} | ||
|
||
active: computed("current", function() { | ||
@(computed("current").readOnly()) | ||
get active() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the computed with readonly?
name = "duration"; | ||
@tracked min = MIN_SAFE_INTEGER; | ||
max = MAX_SAFE_INTEGER; | ||
maxlength = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 1 tracked?
@@ -87,38 +74,38 @@ export default Component.extend({ | |||
* @property {Number} precision | |||
* @public | |||
*/ | |||
precision: 15, | |||
@tracked precision = 15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why only this property is tracked
?
"on-never"() {} | ||
"on-later"() {} | ||
"on-start"() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are some wild function names...
@@ -41,7 +44,7 @@ export default Service.extend({ | |||
* @return {Object} An object with the parsed metadata | |||
* @public | |||
*/ | |||
fetchSingleRecordMetadata: task(function*(type, id) { | |||
@(task(function* (type, id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick refactor to restartableTask
const duration = moment.duration( | ||
moment().diff(this.get("activity.from")) | ||
); | ||
@task(function* () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move function out of decorator
|
||
/** | ||
* Whether it is the currently selected day | ||
* | ||
* @property {Boolean} active | ||
* @public | ||
*/ | ||
active: false, | ||
active = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for tracked?
Thanks for the feedback! Will incorporate this after the automated codemods are done! |
https://github.com/ember-codemods/ember-no-get-with-default This is a preparation for replacing ember.get
388ee9d
to
567d70b
Compare
Contents:
The contents of this PR start at bfa5eaa
Commits before belong to #715
Info