tc39 / proposal-await-dictionary

A proposal to add Promise.ownProperties(), Promise.fromEntries() to ECMAScript
MIT License
86 stars 4 forks source link

Moving to Stage 1? #8

Closed ajvincent closed 1 year ago

ajvincent commented 3 years ago

So, what do we need to do to move this along to stage 1 at TC39? Is there anything, other than preparing a talk, that we really should iron out?

I'm still very interested in this proposal, and I note the deadline for the August 2021 meeting is coming up in three weeks.

ljharb commented 3 years ago

Preparing a talk should come after ensuring the readme (i haven’t looked at it in awhile, so pardon if it’s already fine) thoroughly covers the problem being solved and the use cases before discussing a potential solution; then prior art; then the potential solutions we’re envisioning.

I’m on board with either or both of us presenting it at the next meeting!

ajvincent commented 3 years ago

Could I schedule some time this week or weekend to review this on Zoom?

ljharb commented 3 years ago

Tomorrow or Friday works best for me; ping me on email or twitter and we can find a time.

ajvincent commented 3 years ago

This proposal may die before it gets to TC39. Jordan and I just talked and realized we don't have a strong enough use case to warrant a proposal.

The problem is that this is really easy to do by educating developers:

const [shape, color, mass] = await Promise.all([shapeP, colorP, massP]);
return {shape, color, mass};

Two lines is not significantly worse than one line.

One possible argument is if you have multiple levels to your object:

const outer = await Promise.ownProperties({
  inner1: Promise.ownProperties({
    a1: a1P,
    a2: a2P,
  }),

  inner2: Promise.ownProperties({
    b1: b1P,
    b2: b2P,
  }),
});

While this is compact, is it a realistic scenario?

Promise.fromEntries() has other problems as well, discussed in other issues.

acutmore commented 1 year ago

A use case for this: I have seen code passing 8 different promises to Promise.all and it is difficult to see which result in the destructured array maps to which promise. Named destructuring avoids this ordinal overhead when reading and verifying code.

ajvincent commented 1 year ago

@acutmore I notice you're a TC39 contributor. If you want to take over this proposal, I have zero objection to that. I am very skeptical, though, that this is novel enough to go into ECMA-262.

acutmore commented 1 year ago

Hi @ajvincent, that would be great. I'll fork this repo and see if I can put some slides together before tomorrow's deadline for the next meeting agenda.

acutmore commented 1 year ago

@ljharb @rwaldron, would you be interested in staying on as champions?

ajvincent commented 1 year ago

@acutmore in your fork, please at least link back from the fork to this repository's issues, or copy them into yours. I'm willing to transfer ownership of this repostiory to you also, to maintain the single source.

To keep things clean, you could make a pull request for me to approve and merge, and then I transfer ownership to you.

I personally would like to see a dry run of your presentation at the next SES strategy meeting, which takes place before the next TC39 plenary.

ljharb commented 1 year ago

@acutmore yes, and i'd love to chat prior to plenary to ensure we have a compelling case for stage 1.

acutmore commented 1 year ago

I personally would like to see a dry run of your presentation at the next SES strategy meeting, which takes place before the next TC39 plenary.

Sure! I can see it's already been added to the SES agenda, thanks. I've put it in my calendar.

ajvincent commented 1 year ago

@acutmore I've merged your pull request, but GitHub won't let me transfer ownership to you until you delete your fork, at least. It's a naming conflict.

acutmore commented 1 year ago

Ok, I've deleted the fork now. So will hopefully work this time.