mushinnoshin•

Getting closer to 3.7. Get hype for null coalescing operator (or whatever the ecmascript folks decided to call it).

50
i_spot_ads•

Do you mean safe traversal operator?

14
mushinnoshin•

They went for "optional chaining".

https://tc39.es/proposal-optional-chaining/

19

That's mightBeUndefined.?property. There's also nullish coalescing, which is const valueOr1 = mightBeUndefined ?? 1.

(The former is the most exciting one, though, IMO.)

8
mushinnoshin•

Ah, it appears I've been calling the c# null conditional operator the null coalescing operator all along. Thanks for the correction.

It's kind of surprising how long I seemed to get away with that.

2
TheScapeQuest•

null(ish) coalescing is something else:

const a = null;
const b = undefined;
const b = false;

console.log(a ?? true); // true
console.log(b ?? true); // true
console.log(c ?? true); // false

In other words, if null/undefined, take the RHS, otherwise take the LHS

https://github.com/tc39/proposal-nullish-coalescing

1
Pavlo100•

So hyped for it, let's hope it isn't extremely hard to implement

5
mushinnoshin•

There's old issues in the tsc github where they've said it's not difficult but they won't implement something unless it's clear it will become standardized. Keeping the "all JavaScript is valid TypeScript" is very important for migration.

14
hutxhy•

Elvis operator is what it is in other languages. Hope they go for that.

1
mushinnoshin•

Wait, why elvis?

3
drewwhis•

?: is a common version and it looks like an emoticon with an Elvis hairdo.

18
BunsOfAluminum•

It's like an emoji. The curl of the question mark is reminiscent of the iconic curl in Elvis' hairdo.

5
hutxhy•

Tbh I'm not sure why.

0†
musical_bear•

Is there another language out there that’s managed like this, with substantial monthly feature updates? I am continually impressed with how quickly TypeScript improves; it is fast becoming one of my favorite programming languages.

25
nsonha•

it's ok at this stage but generally you dont want languages to evolve this quickly once it reaches some level of complexity. Feature bloat is a problem in most mainstream languages.

10
Durdys•

Not sure feature bloat is the issue. Normally the new features bring a more succinct ways of doing the same thing. That's where the IDE/ compiler should be warning against the older way. Unfortunately people tend to ignore those warnings 😅

1
nsonha•

just because there is deprecation warning does not mean you should go out of your way to refactor since there are features that depend on that code (that's not broken). Which means at any point in time there is code that does things the old way(s) coexisting with code that does it the new way. Certain kinds of evolution such as extensions or standard lib are more sustainable than evolving the syntax because for syntaxes there is no way back. Typescript should have opt-in standard libs at this point.

1
mushinnoshin•

If you want language features quickly look into a language that supports extension via macros etc.

That said it can lead to huge increase in perceived complexity. Haskell suffers from this with it's wide selection of extensions.

5
I_Downvote_Cunts•

Rust also evolves pretty quick with monthly updates for new features.

4

I think they transitioned to bimonthly now.

Edit: Can't find anything about a change in the schedule, but their releases are 6-weekly rather than monthly. Maybe it was TypeScript that switched to bimonthly?

Edit 2: It does appear that TypeScript's releases are actually bimonthly, though I can't find the announcement :)

5
orta•

They're every three months, the new site will do a better job explaining but here's the current iteration: https://aka.ms/typescript-schedule

1
NovelLurker0_0•

It's nice to have that improved UX about promises. I wrote an extension a while back for that exact purpose but it wasn't working properly.

3
Heka_FOF•

Does "Stricter Generators" help when using redux-saga with TypeScript?

1
ClutchHunter•

I bloody hope so.

1
Heka_FOF•

Yeah because now after `yield` you always get `any` :(

1
AngularBeginnerOP•

Should at least be unknown. Fuck any.

1
Heka_FOF•

Exactly

1