4 ms·
Typescript is SUPERSET of JavaScript, not subset...
by tanilama 6y ago
Typescript is SUPERSET of JavaScript, not subset...
- timdaub 6y agoRight. I think it should be fixed soon.
- legerdemain 6y agoWhat needs fixing is not just replacing the word "subset" with the word "superset," but the entire argument in the paragraph. Your argument is based on your misunderstanding. Valid TS in not necessarily valid JS. No informed person will claim that you can just drop TS into a JS project the same way you can drop JS into TS. Also, no one is publishing TS to NPM, and certainly not for the (mistaken) reason you describe.
- timdaub 6y agoI think there may be a misunderstanding. I too know that nobody published TypeScript packages directly in NPM, but they always include a transpiled version. Nevertheless it'd consider it a "TypeScript package (that was transpiled to JS and then published to NPM)". Edit: To make sure this misunderstanding is avoided, I've adjusted a section in the blog post to make it super clear.
- legerdemain 6y agoIf your claim is that it's impossible to contribute to a package written in TS without writing TS, even if the authors publish a JS version to NPM, I completely agree. I also agree that this creates a divide between authors who write TS/publish JS, and those who write JS directly.
- timdaub 6y agoOK. Then I guess we're on the same page.
- lhorie 6y agoTechnically, it's neither. `a<b,c>(d)` is valid JS, but it means something different in TS.