I am shocked to not see a reference to Taylor Swift’s hit song Blank Space anywhere in the article!
ts-blank-space is a fast type-stripping compiler
11–20 of 49 posts
Re: ts-blank-space is a fast type-stripping compiler
#12Am I forgetting any or is it the only feature that actually generates code rather than just being extra annotation?
Re: ts-blank-space is a fast type-stripping compiler
#13Re: ts-blank-space is a fast type-stripping compiler
#14I wish enum was never part of TypeScript. It’s this one odd thing unlike the rest. Am I forgetting any or is it the only feature that actually generates code rather than just being extra annotation?
Re: ts-blank-space is a fast type-stripping compiler
#15> These unsupported TypeScript features already have preferred alternatives:
> Prefix-style type assertions (value) should be replaced with as-style type assertions.
Am I out of date? Does someone know something I don't?
Re: ts-blank-space is a fast type-stripping compiler
#16I wish enum was never part of TypeScript. It’s this one odd thing unlike the rest. Am I forgetting any or is it the only feature that actually generates code rather than just being extra annotation?
`const enums` (beyond enums) are especially odd. They rely on type information to emit code.
* Subsequent to their release in TypeScript, EcmaScript versions now support some of these.
Re: ts-blank-space is a fast type-stripping compiler
#17I'm a little confused about when I'd use this, if I'm quickly iterating on code as I develop it, probably I also want to know whether it type checks, right?
Re: ts-blank-space is a fast type-stripping compiler
#18> We refer to the supported subset as Modern TypeScript because it represents nearly all TypeScript syntax, except for those TypeScript-specific features that may be considered legacy or discouraged in some way > These unsupported TypeScript features already have preferred alternatives: > Prefix-style type assertions ( value) should be replaced with as-style type assertions. Am I out of date? Does someone know someth…
Instead of writing, e.g. `const n = someValueThatYouKnowIsANumber;`, you should write `const n = someValueThatYouKnowIsANumber as number;`
(well, really, you shouldn't write either, casts are bad. But, yknow.)
Re: ts-blank-space is a fast type-stripping compiler
#19I wish enum was never part of TypeScript. It’s this one odd thing unlike the rest. Am I forgetting any or is it the only feature that actually generates code rather than just being extra annotation?
Lots of TypeScript features generate code: namespace, async/await, yield, decorators, object spread, varargs, etc.* `const enums` (beyond enums) are especially odd. They rely on type information to emit code. * Subsequent to their release in TypeScript, EcmaScript versions now support some of these.
Moreover, aside from namespaces and enums (which are discouraged), none of those features were incorporated into TypeScript until they were on track for inclusion into JS. They weren't taken from TypeScript and imported into JS; TypeScript took them from the ECMAScript people.
Being able to compile TypeScript by just stripping types has become a design principle of the language. For better or for worse, the TypeScript team steadfastly refuses to try to innovate on runtime language features at this point.
Re: ts-blank-space is a fast type-stripping compiler
#20I wish enum was never part of TypeScript. It’s this one odd thing unlike the rest. Am I forgetting any or is it the only feature that actually generates code rather than just being extra annotation?