This one, however, does provide a brand new combinatorial - on objects with Promise-valued properties - which seems like something that should have a Promise static method before syntax?
Yes but not exact same thing. So allSettled can be included the spreading fashion await!.. or something similar. race and any cannot handle by spread operator because they are conditional. They should choose only one item from the array of promises.
I have an idea for race and any apart from the spread idea.
I think that no syntax proposal should be combining promises in a way that isn't already possible with .then or Promise static methods, which includes objects with promise-valued properties.
I'm saying that as a prerequisite for adding syntax that can await "an object with Promise values", there must first exist an API for it, just like await, and object spread.
@ljharb's suggestion makes sense. EcmaScript generally has a high syntax bar, they don't like adding new syntax left and right. So one way to "proove" that a particular syntax request is useful enough is to implement that request as a new API and see how strongly the community adopts it.
So, in this scenario, we would add a Promise.spread(), or Promise.allMembers(), or whatever to resolve all of the promises within an object. If it turns out this feature is being used everywhere you look, then they might consider adding a syntactic version to make it easier to read.
For arrays / iterables, i think await.all is more clear, and even then I'm not convinced new syntax is justified given that await Promise.all() works just as well.
For object likes, I agree there should first be an API to do this before considering syntax. When we informally discussed this in the past, it wasn't obvious to me that a plain object is always what's wanted. I've actually used a more verbose but more versatile Promise.allEntries. Promise.allEntries · GitHub
Yeah, I'd say over 90% of my uses have been one of two things:
Starting a relatively small constant number of tasks concurrently and awaiting their results
Iterating an array of tasks and performing all of them maximally parallel without regard for their return value (though I've been doing this less and less lately as it tends to interfere with the throughput of other tasks)
For what it’s worth, there is the Array.fromAsync proposal that would serve as the sequential version of Promise.all. I was imagining that it would set up the machinery for a future await ...x syntax that would be equivalent to ...await Array.fromAsync(x), although the latter would just be a syntactic nicety that perhaps avoids an unnecessary array allocation.