ember-realworld
ember-realworld copied to clipboard
Can ember-concurrency be removed?
Ember.js is often called out on having a large filesize. I'm wondering if ember-concurrency
can be removed in order to reduce the vendor.js
filesize.
I understand that it's useful for dropping tasks to prevent multiple executes of a task when a task is already being performed. Perhaps there's an alternative to using a task that can be leveraged?
Maybe we can just use async await? I like showcasing Ember Concurrency as its an amazing addon though
If we are actually using any async actions then we should not drop ember-concurrency. You can get yourself into a lot of trouble using async/await for actions and ember-concurrency is currently the most idiomatic way to do this in the Ember ecosystem 👍
@mansona What troubles? I use async actions all the time 😅
@Alonski common troublesome pattern without ember concurrency:
// some component
async function() {
let val = await this.doSomething();
this.set('someProp', val);
}
If the component is destroyed during this.doSomething()
the call to set
will raise.
That's a great example @jherdman 🎉
I've also had some issues with testing and timing that cause tests to be a bit intermittent. Most of these issues can be solved by just converting any async actions to Ember Concurrency tasks 👍