Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What's a good TS codebase to learn from?
10 points by jcuenod 2 days ago | hide | past | favorite | 6 comments
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).

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.

Just adding a link for myself: https://github.com/Microsoft/TypeScript

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.)

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...

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/

The ProtonMail client is worth a look. https://github.com/ProtonMail/proton-mail

It's a react frontend build with typescript.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact