3 ms·
For me the best experience during development is to build ts to js first with something fast like esbuild and check types in parallel without preventing the out
by CapsAdmin 4y ago
For me the best experience during development is to build ts to js first with something fast like esbuild and check types in parallel without preventing the output in any way from running in the browser.
A perfect scenario for me is having all errors in the project caught by vscode. At the moment vscode only checks files that are currently open. I think type checking should only be done when building to some sort of production or realtime in your editor. Templates like "create react app" can report runtime errors but it's somewhat strange that it also report typescript errors. (although understandable given that it wants to be tooling agnostic)
One potential major upside with adding optional type hints to javascript is the ability to run typescript files directly in the browser without needing to strip types in a build step. Advanced type checking could be done the same way we use linters like eslint.
- kuramitropolis 4y ago>At the moment vscode only checks files that are currently open While TSC checks everything by default - even files that are not even part of the dependency graph. That's how great the "great tooling" is in reality. >I think type checking should only be done when building to some sort of production or realtime in your editor. Agreed, that's the lest awful option. The problem is that they had 10 years to think of it, and didn't. >Templates like "create react app" ...are a big part of the problem. "But I don't want to spend a whole day just setting up a project!" You wouldn't have to, if you didn't drink the React kool-aid in the first place.