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

Missing polyfill for Promise.allSettled #354

Open
codeworrior opened this issue Aug 5, 2019 · 7 comments
Open

Missing polyfill for Promise.allSettled #354

codeworrior opened this issue Aug 5, 2019 · 7 comments

Comments

@codeworrior
Copy link
Contributor

Now that Promise.allSettled reached stage 4 of the specification process, would it make sense to add a polyfill for it to this project?

Or would you rather recommend to add a separate shim for it, something like es-shims/Promise.allSettled ? IMO that's less convenient, but creating yet another implementation also sounds wrong.

@andreyvolokitin
Copy link

I just checked the bundle size for es-shims/Promise.allSettled and it's 31.5 kB (es6-promise is 6.2 kB). I'm not sure if it will weight less if reimplemented here, but the bundle size of es-shims/Promise.allSettled was definitely the reason I didn't use it in my project

@stefanpenner
Copy link
Owner

Wow thats pretty large.

@triskweline
Copy link

The reason why es-shims/Promise.allSettled has such a huge bundle size is that they're bundling a lot of dependencies.

Here is a polyfill in 218 bytes.

Would love to see this in es6-promise, which is my favorite promise polyfill ❤️

@stefanpenner
Copy link
Owner

This project is named es6-promise, and es6 doesn't have all-settled, or other new features.

If there is enough demand, we can create a different polyfil. But it is unclear if adding it here, given the name, makes sense.

Thoughts?

@andreyvolokitin
Copy link

I don't think much people rely on the fact that ES2015 doesn't contain allSettled. I personally expect from a polyfill a "full support" (whatever this could mean). But overall can't judge if the name is a deciding factor in this situation. A different polyfill definitely wouldn't hurt, but it could be a split effort for almost same thing.

I guess changing this project name isn't an option?

@triskweline
Copy link

As a long-time user of this package, it never occured to me that it its features could be scoped to ES2015. I guess it's because we've been using "ES6" as an inaccurate alias for "the time when we got new JavaScript features" for so long.

In any case, other packages I use have started to use allSettled, and they rarely make the destinction between ES levels. They just assume window.Promise is supported with the current promise features. If this package would remain scoped to ES2015, I could no longer use it as an effective IE11 polyfill.

@WormGirl
Copy link

WormGirl commented Sep 8, 2021

I implemented this method https://github.com/WormGirl/core-promise

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

No branches or pull requests

5 participants