Koa: Dive into typescript

Created on 24 Sep 2016  路  6Comments  路  Source: koajs/koa

Is there any plan write koa with typescript in the next major release v3.
As everyone knows, typescript is a strong type language.It means we can take few mistakes.
It also means we can write simple but easy understand code thanks to the type hint provide by typescript.

Most helpful comment

@xialvjun Throwing a new language at that problem isn't practical. If you feel like ts is helping you, then there's nothing stopping you. Koa itself is pretty lean.

All 6 comments

nope sorry, I don't see a point here, Koa is really simple as-is and any mistakes must be covered by tests anyway.

there has been a lot of discussion on typescript lately. the consensus of maintainers seems to be not do do it (as is also my personal opinion), you can read up on everything here: https://github.com/koajs/koa/issues?utf8=%E2%9C%93&q=typescript.

Closing for now.

You can just install the type files using npm i -D @types/koa and you'll have the type hints you need.

Well, "Koa is simple and mistakes must be covered by tests anyway" indeed. But Koa with a lot of middlewares is not simple anymore. It's time for nodejs to scale now and it's time for the whole nodejs community to consider further.

@tj at you because this issue was closed.

@xialvjun Throwing a new language at that problem isn't practical. If you feel like ts is helping you, then there's nothing stopping you. Koa itself is pretty lean.

Was this page helpful?
0 / 5 - 0 ratings