Sometimes the environment already has promises, but they may be broken/incomplete/bad in some way. Being able to always reference a known-good version of promises to overwrite any built-in badness would be very useful.
Just a naming nit: you mean exposed as m.Promise, right? (The constructor is capitalized.)
@tivac I'm postponing this because a point release is overdue...
Could you please describe issues with promises being "broken/incomplete/bad in some way"?
How could this issue be resolved?
Are these issues also in the next version?
@magikstm About this time last year, Chrome was the only browser that really got Promises right from a stability perspective. Firefox had inconsistent timings, and Edge didn't even schedule resolutions as microtasks (instead, they scheduled them as something that looked like microtasks, and sat between microtasks and macrotasks, but didn't actually work like them - making them useless with IndexedDB promise wrapper libraries). Safari had similar issues themselves with various edge cases, too. It's only recently that promises are actually something you can reliably use.
Oh, and our baseline, IE9/10, doesn't even support them at all, so we still need the polyfill.
@magikstm I mostly work in embedded browser environments these days. Promise support is all over the map there.
Is this point release being ignored for a major release (2.0) ? Because its past a year.
@ohenepee As soon as all these get resolved and merged into v1's repo, I plan to cut a new minor release (v1.2.0)
But the biggest impediment is time.
I'd be happy to make this change, but don't understand its purpose. m.PromisePolyfill already exists:
https://github.com/MithrilJS/mithril.js/blob/next/index.js#L20
https://github.com/MithrilJS/mithril.js/commit/d283b243371ec5e440fb05e9689944b5340663fe
Issue was posted 12/17, but that change happened in 02/18. It didn't exist at the time.
Fixed by https://github.com/MithrilJS/mithril.js/commit/d283b243371ec5e440fb05e9689944b5340663fe.
Most helpful comment
@magikstm I mostly work in embedded browser environments these days. Promise support is all over the map there.