tc39 / proposal-optional-chaining

https://tc39.github.io/proposal-optional-chaining/
4.94k stars 75 forks source link

proposal moves forward to stage 3 \o/ #107

Closed bcoe closed 4 years ago

bcoe commented 4 years ago

Amazing work authors @claudepache, @gisenberg, @dustinsavery, and champions @DanielRosenwasser and @jridgewell :tada:.

Mouvedia commented 4 years ago

…after all the issues raised were put to rest by committing 3 lines in the README. ?.[] is inconsistent and a terrible addition to my language.

Not many TC39 proposals have 70 issues closed. That number alone should make you wonder…

Thanks for participating.

Whobeu commented 4 years ago

I hope this can make it into some version of Node 12.x.x. I've used this feature extensively in C# and it would be nice to reduce a lot of null checks in my JS modules.

GaryGSC commented 4 years ago

@Whobeu Unfortunately, that isn't very likely. This proposal would likely need to be implemented in V8, which is used by Node.

According to Node's roadmap, they're planning on stopping at V8 version 7.6 for Node 12, which has already been released and doesn't implement this proposal. 🙁

Basically, Node 12 enters LTS before they'll be able to get to it.

GaryGSC commented 4 years ago

Hey, guess what? Node 12 is ahead of their projected schedule. There's now an in-progress PR to backport V8 7.8 to Node 12, which supports optional chaining behind the V8 flag --harmony-optional-chaining.

Whobeu commented 4 years ago

I wonder if Nullish Coalescing made it in too. There was some work done in one of the 7.8 revs to support it. Great to see Optional Chaining.

gisenberg commented 4 years ago

@Whobeu It looks like nullish coalescing is included in that PR as well.