Tonkpils / ember-sweetalert

Ember CLI addon for SweetAlert2
MIT License
19 stars 10 forks source link

1.0 #10

Closed lindyhopchris closed 5 years ago

lindyhopchris commented 6 years ago

So wanted to write some of my ideas for the things that would be good to sort out to get this package to 1.0. Totally just my ideas and happy to be shot down as needed! Plus would be good to hear any ideas that others have.

Service instead of Mixin

Service would be a more appropriate pattern as it fits with current Ember best-practice. It also will provide an easy way to deliver points 4 and 5 above.

The other thing it will help with is testing. I'm not sure how to deal with SweetAlert in Ember tests because it is all occurring outside the runloop. At the moment, my approach is to import Ember.testing and not use sweet alert if in testing mode. (Would be interested to hear if anyone else has a better approach.) If we implement as a service, then this would provide a way to easily stub out SweetAlert when testing.

injaon commented 6 years ago

Hello, It will be great to have this 1.0 version realease! Since ember no loger needs bower, I think number 1 and 2 are the most imortante issues here,

Tonkpils commented 6 years ago

Thanks for the nice write up and a roadmap to 1.0 @lindyhopchris really appreciate you taking the initiative to move this project forward!

All the points look great and overall a good set of features/requirements to get to 1.0. If there's anything I can contribute to this, I'd be happy to pair with someone on this.

@lindyhopchris I can also add you as a collaborator on the NPM package so you can release a new version any time if I'm not around. Let me know if that's something you'd be interested in.

lindyhopchris commented 6 years ago

Have added a service in so that SweetAlert usage in code (rather than via the component):

I've also added in the SweetAlert methods to the service, ensuring that those that modify the DOM are scheduled on the runloop. Need to add tests for all of these at some point.

lindyhopchris commented 6 years ago

Fyi this means I've removed the export from ember-sweetalert because it really shouldn't be used... the correct usage for this new version would be via the service rather than an import.

lindyhopchris commented 5 years ago

Just published 1.0.0-rc.1