Closed milahu closed 2 years ago
I disagree.
Typescript can be really helpful on more complex projects - and you'll probably agree that a compliment library is something a bit more complex.
Also, maintaining the .d.ts without typescript is a lot more hassle than maintaining the whole library with typescript.
As an example, take chakra-ui - they originally maintained their type definitions separately and it simplified the maintenance when they finally switched to TypeScript.
you can still generate d.ts file from vanilla javascript... And have type safety & IDE autocompletion with spotting error without typescript flavoured syntax... I'm with @milahu on this, 90% pain very little benefits
https://jimmywarting.github.io/you-might-not-need-typescript/
I don't like the disconnect between the types and the code that this method requires. Also, I still don't see what is so painful about TypeScript.
still
no need to merge this
just for sake of completeness
nobody likes wasting time compiling stuff
https://jimmywarting.github.io/you-might-not-need-typescript/
cd $(mktemp -d)
npm init -y
time npm i git+https://github.com/atk/solid-blocks.git
# 100 seconds
cd $(mktemp -d)
npm init -y
time npm i solid-blocks@git+https://github.com/milahu/solid-blocks-vanillajs.git
# 4 seconds
... on my 2x2.4GHz cpu
You're comparing apples and oranges, as your compilation doesn't do strict type checking at all, so you basically lose almost all the advantage from using typescript in the first place. Also, if you use vite during development, you'll hardly notice the compilation at all.
lets just say my solid-blocks-vanillajs repo is a workaround for #4
typescript is 90% pain and 10% profit ... can we please get rid off this hype? the only thing that does make sense are the
*.d.ts
declaration filesno need to merge this, i will just use my solid-blocks-vanillajs fork