Feature/ember upgrade#153
Conversation
BRAKING CHANGES: upgrade Ember version
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #153 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 7 +1
Lines 82 100 +18
=========================================
+ Hits 82 100 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # README.md # addon/components/modal.js # addon/services/modal.js
BRAKING CHANGE: modal component extends from Glimmer
286ffa5 to
1673529
Compare
BREAKING CHANGE: promise is fulfilled when the modal animation ends
|
|
||
| init() { | ||
| super.init(...arguments); | ||
| get componentName() { |
There was a problem hiding this comment.
This should be inside modal-wrapper and not in the model.
| return () => { | ||
| this.modal | ||
| .open(modalName, options) | ||
| .then(actions.onDone, actions.onFail, 'open-modal helper'); |
| this.trigger('open', model); | ||
|
|
||
| model.promise | ||
| .catch(() => {}) |
| @@ -0,0 +1,3 @@ | |||
| <div role="dialog" data-id={{this.dataId}} data-modal-show={{this.dataModalShow}} {{did-insert this.onDidInsert}}> | |||
| <@model.componentName @model={{@model}} @changeVisibility={{this.changeVisibility}} @element={{this.element}} /> | |||
There was a problem hiding this comment.
@josex2r I may be wrong, but this should not work per emberjs/ember.js#17744
I assume, for embroider compatibility we should use ensure-safe-component helper provided by @embroider/util package like so
see docs https://github.com/embroider-build/embroider/tree/master/packages/util#the-utilities
There was a problem hiding this comment.
my bad, didn't see it's actually being used in model.js.
IMO it's better to do component/template manipulations in the hbs file
There was a problem hiding this comment.
Nice! I didn't read that the helper exists XD
| @tracked isRejected = false; | ||
|
|
||
| @tracked _deferred; | ||
| @tracked _deferred = defer(); |
There was a problem hiding this comment.
_deferred does not change during object lifecycle, maybe we don't need to use @tracked here?
|
|
||
| @action | ||
| resolve(data) { | ||
| this._fullfillmentFn = () => this.model.resolve(data); |
There was a problem hiding this comment.
minor, this may be implemented using destroyable like so
registerDestructor(this, () => this.model.resolve(data));not a big deal at all, but IMO it's easier to follow the code flow
|
|
||
| @isNotDestroyed | ||
| _safeDidOpen() { | ||
| this.didOpen && this.didOpen(); |
There was a problem hiding this comment.
should this be this.args.didOpen?
There was a problem hiding this comment.
No, this function is something like a component life-cycle hook, to notify when the modal is visible.
Was created to extend the modal class and prevent checking if a CSS transition exists and attaching to it using more callbacks:
// components/modal-foo.js
class ModalFoo extends ModalComponent {
didOpen() {
// Something to do here...
}
}There was a problem hiding this comment.
@josex2r got it! Thanks for explanation!
| /.nycrc.json | ||
| /.releaserc | ||
| /greenkeeper.json | ||
| /jsconfig.json |
There was a problem hiding this comment.
jsconfig.json probably should be kept as it should not be published to npm
|
@josex2r Thanks for working on this! |
# Conflicts: # addon/components/modal.js # addon/services/modal.js # package.json # tests/acceptance/modal-component-test.js # tests/dummy/app/components/modal-custom-modal/index.hbs # tests/dummy/app/styles/app.css # tests/integration/services/modal-test.js # yarn.lock
|
@josex2r @xe21500 @adrigzr is there something I can help to push this over the line and get released? I'm happy to help maintaining this addon. If that could help, I can help and split changes proposed in this PR into smaller PRs that are easier to review - if that can help expedite things. In addition to general Ember upgrades and transition to Glimmer component, this addon also great candidate for v2 format conversion |
|
@etarancon, could you help @SergeAstapov with this? 😄 |
|
@josex2r @etarancon @adrigzr would you like to add me as maintainer of the addon as I can get this, general addon upgrades/maintenance and v2 format conversion done |
No description provided.