News for hackers. Stuff that matters.
Re:JavaScript Gom Jabbar by vbezhenar on Monday July 03, 2023 @02:28AM (#36569522)
JavaScript tooling it bad. So many half-ready choices. I tried to set up TypeScript project for last few days. It's a major pain. I originally wanted to use multi-module project: 1 node.js server, 1 webapp and shared code. I spent too much time trying to figure out all those things, TypeScript moduleResolutions and whatnot just to throw it all away. To hell with it. Yesterday I tried to understand how would I generate type-safe server code from OpenAPI spec. No way. zod, yup, ajv, wtf, but just dumb simple openapi generator which can generate code even for Ada, but node.js does not exist.

I love TypeScript, I love node, but I so much hate all the associated tooling. It's incredibly terrible. I don't want to make a single choice. I want a single build system which does everything good enough. I want a single "Spring Boot" framework which does everything good enough. I want a single linter, which built into my IDE and does not require me to exclude my dist folder. I don't want to configure my TypeScript compiler, it should be smart enough to configure itself. I don't want to spend days reading about project references, npm workspaces and other stuff. I want to create few folders like I do with maven and it's just works. I don't want to browse 10 different libraries for typings (why is it even needed for typescript???). I want things like JSON parsing and validation to be built into language or stdlib.

I hate go language. But their tooling is so right that I can withstand all those `if err != nil` every second line.

Re:JavaScript Gom Jabbar by kozzz on Monday July 03, 2023 @03:54AM (#36570065)
Re:JavaScript Gom Jabbar by vbezhenar on Monday July 03, 2023 @04:01AM (#36570106)
It is client API. I was talking about server API. For example express.js or fastify-based.
Re:JavaScript Gom Jabbar by kozzz on Monday July 03, 2023 @04:53AM (#36570432)
Re:JavaScript Gom Jabbar by vbezhenar on Monday July 03, 2023 @04:56AM (#36570452)
Thanks for pointers. I'm afraid, that's a bit wrong direction. I'm talking about spec-first development. This project generates spec from sources.

For now I think I'm going to use zod, as it seems popular enough and pragmatic enough.