2 ms·
Browsers don't need to understand TypeScript, but just be able to ignore TS-specific syntax like Babel does. Then it's really possible to use TypeScript like a
by Vinnl 6y ago
Browsers don't need to understand TypeScript, but just be able to ignore TS-specific syntax like Babel does. Then it's really possible to use TypeScript like a linter without requiring a bundler.
But of course, that'll add quite a drag on TypeScript development. With Babel, they can just maintain the plugin themselves; with browsers, they'll have to go through the standardisation track for every syntax change they want to make.
- pjmlp 6y agoStrong typing is not only about linting, JSLint already does that. TypeScript also has to go through the same process, after all they need to grow alongside JavaScript and besides typing, there is nothing that gets introduced that isn't JavaScript at its core.
- Vinnl 6y agoSure, but the value of TypeScript is that it warns you about bugs in your editor or at compile time. The value of browsers supporting TypeScript would be that you can serve it up to users without a build step.
- pjmlp 6y agoMy IDE already does that for JavaScript as well, the benefit of strong typing on the browser, besides removing the build step, is that JIT would be able to actually take advantage of the type system instead of guessing and hoping for the best.