arthurfiorette / proposal-safe-assignment-operator

Draft for ECMAScript Error Safe Assignment Operator
https://arthur.run/proposal-safe-assignment-operator/
MIT License
1.23k stars 14 forks source link

Runtime implementation and its availability #50

Open thodnev opened 3 days ago

thodnev commented 3 days ago

First, I would like to thank you for a brilliant idea that allows to largely simplify the asynchronous logic.

However, as I've understood after reading the Polyfilling section, currently there is no runtime support available for the feature, only for the Symbol.result. Which is a little sad, because I like the feature (as well as >1.2k other people, according to GitHub stars). And would like to use it in my code right away the same way, for example, Symbol.dispose can be used.

From the TC acceptance/rejection point of view, it would also be great to allow the developers to test the proposed feature, and get a bit used to it. This would allow it to gain more popularity and appreciation, and increase chances of its actual incorporation into future standards.

So, are there any plans on introducing the runtime needed into JS transpilers/bundlers like esbuild, Babel, etc ?

ljharb commented 3 days ago

@thodnev no language proposal should be used in production until stage 2.7 at a minimum, and this one hasn't even been presented to the committee yet.

thodnev commented 3 days ago

@thodnev no language proposal should be used in production until stage 2.7 at a minimum, and this one hasn't even been presented to the committee yet.

Yes, if we take an opinionated point of view. At the same time we see Stage 1 proposals getting into core-js with proper and functionally complete polyfills. It is one of the reasons of having transpilers in the first place, isn't it?

ljharb commented 3 days ago

@thodnev no, it's not, and the position of the committee is that that shouldn't happen - TC39 doesn't control everyone else, but neither does any arbitrary person's actions change whether they're appropriate or not.

thodnev commented 3 days ago

@thodnev no, it's not, and the position of the committee is that that shouldn't happen - TC39 doesn't control everyone else, but neither does any arbitrary person's actions change whether they're appropriate or not.

Thank you for your response. I would like to hear from the original author of the proposal

ljharb commented 3 days ago

Sure, that’s fine - but it’s not actually a proposal until it has a TC39 delegate champion.

arthurfiorette commented 3 days ago

I do not plan to actually at a "official polyfil" until we actually decide on the first format of it and present to TC39, following their rules is the best way to actually achieve something.

In the meantime, there's a lot of packages on npm that already solves them, my own tuple-it is one of them.

Regarding championing, @ljharb, first of all, much thanks to reply and interact with this proposal, i plan to rewrite this first "wrongly" idea of Symbol.result to the agreed try expressions + feedback from the community, would you like to champion us? Or maybe knows someone who would like?

ljharb commented 3 days ago

My personal plate's a bit full at the moment, but I will keep it in mind.