zlacker

[return to "It’s time to free JavaScript (2024)"]
1. wiseow+Xv[view] [source] 2025-12-04 13:19:29
>>pavela+(OP)
1) Put JS in maintenance mode, don’t add any language features, only runtime

2) TS becomes the official mainline, whoever doesn’t like types can just keep writing as they did before, because valid JS is valid TS

Problem solved, it’s not that difficult.

◧◩
2. morshu+Jo1[view] [source] 2025-12-04 18:07:00
>>wiseow+Xv
Valid JS is often not valid TS. Any nontrivial amount of JS copied into TS will generally not work without tweaks. When people say TS is a superset of JS, it's just some academic definition of syntax supersets that isn't practically true.

Non-exhaustive examples:

    let foo = 2
    foo = "foo"  // TS disallows type change
    let bar = {}
    bar.baz = 2  // TS disallows adding property
◧◩◪
3. anemat+DC1[view] [source] 2025-12-04 19:19:31
>>morshu+Jo1
Even syntactically, TS is not a superset of JS: https://anemato.de/blog/js-to-ts
◧◩◪◨
4. morshu+MM1[view] [source] 2025-12-04 20:04:03
>>anemat+DC1
So it's a "sodium chloride" thing. Oh I hit this case too, and even this article looks familiar, probably cause I googled an error message
[go to top]