Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can ember-concurrency be removed? #81

Open
GCheung55 opened this issue Aug 29, 2019 · 5 comments
Open

Can ember-concurrency be removed? #81

GCheung55 opened this issue Aug 29, 2019 · 5 comments

Comments

@GCheung55
Copy link
Collaborator

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?

@Alonski
Copy link
Member

Alonski commented Dec 2, 2019

Maybe we can just use async await?
I like showcasing Ember Concurrency as its an amazing addon though

@mansona
Copy link
Collaborator

mansona commented Dec 2, 2019

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 👍

@Alonski
Copy link
Member

Alonski commented Dec 2, 2019

@mansona What troubles? I use async actions all the time 😅

@jherdman
Copy link

@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.

@mansona
Copy link
Collaborator

mansona commented Mar 24, 2020

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants