News for hackers. Stuff that matters.

Ask HN: What's a good TS codebase to learn from?

I have dipped my toes into Typescript a few times but whenever I've started a project with it I get stuck on things that aren't covered in the basic intros. I'm looking for a couple of codebases that I can dive into to see how things are done (and maybe learn something about structuring projects too).
( 6 comments | 10 points | on HN )
Re:Ask HN: What's a good TS codebase to learn from? by PaulHoule on Thursday June 10, 2021 @10:26AM (#27461161)
The TS compiler itself. It is twice as effective a use of your time because: (1) it is a good high-complexity code base, (2) teaches you about TS internals.
Re:Ask HN: What's a good TS codebase to learn from? by jcuenod on Thursday June 10, 2021 @01:22PM (#27463137)
Just adding a link for myself: https://github.com/Microsoft/TypeScript
Re:Ask HN: What's a good TS codebase to learn from? by ecesena on Thursday June 10, 2021 @12:54PM (#27462832)
I can recommend nestjs.com. Nest (note: not nextjs) is a framework for building webapps/microservices in TS. If you build an app using nest, the framework is going to give you a level of structure that you may like.

In terms of learning by reading nest's source, I don't think it's the most readable code out there - but there's certainly a lot to learn about abstractions. On the opposite spectrum, if you're really starting from 0 maybe find a few apps done in nest that go a little beyond the basics covered by the tutorials.

(I have no affiliations with nest, I'm just using it for my own project and I certainly learned a lot from the framework.)

Re:Ask HN: What's a good TS codebase to learn from? by yarinr on Thursday June 10, 2021 @07:20PM (#27467310)
You could try looking into the VS Code codebase [0]. I wouldn't say it's considered an 'ideal' codebase, but it's definitely a large and well-maintained one.

[0] https://github.com/Microsoft/vscode/

Re:Ask HN: What's a good TS codebase to learn from? by swah on Friday June 11, 2021 @08:27AM (#27472364)
IMO just ask for help on /r/typescript or some Discord server regarding the specific issues. The documentation is pretty good IMO.

What makes things a little bit more complicated is that the language is still changing so some answers on StackOverflow might be outdated.

OTOH, I just use any all the time...

Re:Ask HN: What's a good TS codebase to learn from? by ianpurton on Thursday June 10, 2021 @11:16AM (#27461681)
The ProtonMail client is worth a look. https://github.com/ProtonMail/proton-mail

It's a react frontend build with typescript.