Live data from Hacker News

Starting a TypeScript Project in 2021

metachris.com

111–120 of 190 posts

Re: Starting a TypeScript Project in 2021

#111
post #106

Ever since watching Jonathan blows talk "Preventing the collapse of civilisation", I've been mulling over things like this. It feels like we have this defacto set of commands you have to run to start a new Node/Typescript project, without much understand of what it does. Then you get complier or lint errors and then spend ages googling around for the answer that tells you to change a specific flag. This isn't a compl…

I can't even imagine how painful it must be for a curious kid to get started in programming these days. I feel so lucky to have started with a little 8-bit computer with a built-in BASIC interpreter. You turned it on and could start typing your program right away.

It’s about a million times easier today. Open a browser, open dev tools, open console tab, console.log(“hello world”).

It’s even easier than that though.

Open chrome, type “how to write computer programs” and go from there.

Re: Starting a TypeScript Project in 2021

#112

Ever since watching Jonathan blows talk "Preventing the collapse of civilisation", I've been mulling over things like this. It feels like we have this defacto set of commands you have to run to start a new Node/Typescript project, without much understand of what it does. Then you get complier or lint errors and then spend ages googling around for the answer that tells you to change a specific flag. This isn't a compl…

This has also become my biggest issue with Typescript, and a lot of the people I have talked to about it agree this is the biggest pain point. I am not sure what a better system for this would be, but I do hope the Typescript team takes a hard look at this because I could see it being Typescript's Achilles heel.

This is an issue with JavaScript that TypeScript inherited. The many module systems and ES versions that need support are insane.

Re: Starting a TypeScript Project in 2021

#113

Earlier quoted context omitted.

> Is React language or a library? Does it have its own virtual machine? It's a library, but it does provide a runtime. As such it IMO makes sense that it would have it's own debugging tools. This is pretty common for complex frameworks. Other frontend frameworks like Angular and Vue do it. As do backend frameworks like Rails and Laravel. Or as another example you could look at Unity (the game framework). You can stil…

As someone who works on and fixes bugs in databases and filesystems, perhaps we don't look at things the same way.

When you have to debug something in postgres, are you going to communicate with it by using netcat and writing your own TCP messages by hand, or use psql? Both should work, but you wouldn't say postgres is obfuscating things intentionally so that you have to use psql (or some other postgres client). The fact of the matter is that complex tools are much more useful if they also come with tools to pave over (some of) that complexity and provide a more useful interface for developer experience.

You can debug React apps just fine without the React developer extension, but in some situations it will be much harder. And to elaborate, I work on React full-time and just use the javascript console and debug messages for 99% of my debugging.

Re: Starting a TypeScript Project in 2021

#115
post #103

Earlier quoted context omitted.

> I just write JavaScript? This is the tell. If you are able to satisfy your business requirements with "just JavaScript" then you are in a completely different world than the people building production-grade web apps and there's absolutely nothing wrong with that. If you can be productive with "just JavaScript" then that's awesome! However, I'm sure you understand there's a massive difference between simple pages th…

> ...than the people building production-grade web apps... Please don't co-opt the word "production" to mean what you're implying here. Production doesn't mean single-page, reactive, etc. applications, it just means "in production."

Words are given a meaning by society.

Re: Starting a TypeScript Project in 2021

#116
post #2

Nice article, you could also just use https://github.com/formium/tsdx

I'm a pretty unhappy user of tsdx. While it kind of gets the job done, they've broken my project several times with upgrades. As also noted, the project has stalled. If I was doing another project, I'd avoid it if possible.

Re: Starting a TypeScript Project in 2021

#117

Earlier quoted context omitted.

> Is React language or a library? Does it have its own virtual machine? It's a library, but it does provide a runtime. As such it IMO makes sense that it would have it's own debugging tools. This is pretty common for complex frameworks. Other frontend frameworks like Angular and Vue do it. As do backend frameworks like Rails and Laravel. Or as another example you could look at Unity (the game framework). You can stil…

As someone who works on and fixes bugs in databases and filesystems, perhaps we don't look at things the same way.

Maybe you're just not familiar enough with React? The core of it is actually quite simple, it's just a giant while loop tree traversal that gets triggered either imperatively (by calling one of the React.render* functions) or in response to a state change. The VDOM stuff is mostly orthogonal to this, it just improves performance in the browser, but you could technically skip it without losing anything.

Your argument is basically the same as saying you'd rather view HTML as a giant string rather than in a tree view... the devtools basically present something that's linear (the tree traversal) in a tree view, it's not that bad.

Re: Starting a TypeScript Project in 2021

#118
post #15

Ava ( https://github.com/avajs/ava ) gets too little love from the blogging machinery. It's a breeze to use with TS, faster than Jest (YMMV of course), and I love the snapshot output over any other snapshot producing unit test tool. Use with NYC for coverage is a breeze.

Came here to mention how slow and sometimes awkward ts-jest is. I'll have to try out Ava and the others. I think jest is a great asset over mocha/jasmine/sinon/chai but it gets awkward in the typescript realm. Also thinking about how since it really isn't type aware (especially for mocks) that it loses some points compared to the ecosystems like mockito, nsubstitute, etc.

Re: Starting a TypeScript Project in 2021

#119

Ever since watching Jonathan blows talk "Preventing the collapse of civilisation", I've been mulling over things like this. It feels like we have this defacto set of commands you have to run to start a new Node/Typescript project, without much understand of what it does. Then you get complier or lint errors and then spend ages googling around for the answer that tells you to change a specific flag. This isn't a compl…

This has also become my biggest issue with Typescript, and a lot of the people I have talked to about it agree this is the biggest pain point. I am not sure what a better system for this would be, but I do hope the Typescript team takes a hard look at this because I could see it being Typescript's Achilles heel.

You don't actually need to do any of this stuff to run typescript. You could use Deno, ts-node, etc. to run code outside of a browser without a separate build step. And there's nothing wrong with using tsc to compile your code to JS for browsers, it's just slower for big projects.

If you have an existing JS project that's being converted to TS, you likely have bundling, linting, and CI handled already; for the most part, you just add `preset: typescript` to your existing Babel config and you're done.

Re: Starting a TypeScript Project in 2021

#120

Earlier quoted context omitted.

> ...than the people building production-grade web apps... Please don't co-opt the word "production" to mean what you're implying here. Production doesn't mean single-page, reactive, etc. applications, it just means "in production."

Words are given a meaning by society.

Obviously? And a society needs to correct misuses if it wants its words to keep meaning things.
Post reply on HN