Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving off deprecated dependencies #1985

Closed
arnfaldur opened this issue Feb 17, 2024 · 10 comments · Fixed by #1989
Closed

Moving off deprecated dependencies #1985

arnfaldur opened this issue Feb 17, 2024 · 10 comments · Fixed by #1989

Comments

@arnfaldur
Copy link

This repository uses tslint which has been deprecated for 5 years https://palantir.github.io/tslint/
It also uses dtslint directly which has been deprecated and moved to a monorepo which has a disclaimer not to depend on any of the tools https://github.com/microsoft/DefinitelyTyped-tools/blob/main/README.md#disclaimer

The tslint maintainers point to typescript-eslint as a replacement and both https://github.com/tsdjs/tsd and https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type provide the linting capabilities of dtslint as they are used in the immutable-js project.

Would you be interested in a pull request with a migration that replaces tslint and dtslint with eslint plugins?

@jdeniau
Copy link
Member

jdeniau commented Feb 17, 2024

Hi @arnfaldur !

You are totally right, and tslint has been adressed in #1979 (targeting immutable 5)

If you would like to work on migration from dtslint to tsd, it would be great.
I wanted to advance on it but did not have the time for the moment.

You should target the 5.x branch though, as there is a lot of typescript-related changes in 5.x

@arnfaldur
Copy link
Author

Hey there :)
I missed that PR, good to see it's already done.
Thanks for the briefing, I'll take a look at the dtslint -> tsd migration on that branch and make a PR if I get it working.

@jdeniau
Copy link
Member

jdeniau commented Feb 17, 2024

Cool! Let me know if you need help 👍

if you advance, or if you drop the subject tell me too, to know what to expect on my side 😉

@mrazauskas
Copy link

mrazauskas commented Feb 18, 2024

Did you consider using TSTyche for type testing? It is a new tool, which I was developing for two years. The main motivation was to build a library which would work at any scale.

For some time I was contributing type tests to Jest repo (tsd was used as a runner). There are ca. 1500 assertions . It is a pain to debug, if something breaks during development of new features.

TSTyche's API is similar to what we are used to in JavaScript testing. It has test helpers like test() and describe(), with .only and .skip modifiers. Also similar to dtslint it can test on specified versions of TypeScript:

tstyche --target 4.8,latest

Similar to tsd it compares types programatically, but the rest is different. I was trying to improve tsd by maintaining a fork, but its architecture is very limited. As an example, TSTyche can capture exact error message or code. tsd has predefined list and users must open PRs to add missing errors.

Current TSTyche is rc. Stable release is coming out on Tuesday.

If that sounds interesting, I would be happy to help migrating type tests to TSTyche. I think it would shine here.

RedwoodJS, Jest (migration is in progress) and several smaller libraries are using it.

@jdeniau
Copy link
Member

jdeniau commented Feb 18, 2024

Hi @mrazauskas

Thanks for the link, I didn't knew TSTyche before.
Regarding your documentation, I do personally like the fact that you can mixup tests and type testing, and the fact that you did inspire yourself with powerfull DX tools like .only.
The API seems nice, and you put a real effort on the documentation 👍 .

On the other hand, tsd is mature and still maintained.
If it were me, I would possibly try TSTyche to compare with tsd that I already use.

But, @arnfaldur is working on that one, and did start migrating to tsd in #1986.

What is you opinion on TSTyche @arnfaldur ? Do you want to try it to compare ?

@arnfaldur
Copy link
Author

tsd is an improvement to dtslint but not a massive one in my eyes.

The TSTyche library looks much nicer to me at a glance. I encountered some minor issues with tsd like there being no idiomatic way (that I could find) to assert type equality. It's also not very configurable and the documentation is frugal. I have finished the tsd migration but the only objection to the tests being moved to TSTyche I have is that it's very new. Maturity and longevity are important but not absolute so checking TSTyche out sounds good to me.

I have however been working at this for some time now and want to work on something else for a while. But @mrazauskas can of course take a look at that. I might also be willing to check it out next weekend or something.

@jdeniau
Copy link
Member

jdeniau commented Feb 18, 2024

Thanks for your work @arnfaldur, I will check this soon (in particular the modified tests).

@mrazauskas
Copy link

This is your project, so decision is yours.

For my eye tsd looks more like an abandoned project. This happens in open source, unfortunately. For instance:

  • nobody is responding to issues (not even simple cases);
  • they are landing PRs without requiring to add tests (given that tsd is a testing tool, that is very ironic );
  • there are long standing problems where positive and negative assertion is passing with the same input. This was fixed in my fork, but still ignored in tsd (they know I have a fixed it);
  • finally tsd is still in zero releases. There was an idea to push out v1 (Towards v1.0.0 tsdjs/tsd#196), but nobody has interest to work on it.

The last bullet says it all. There is nobody excited about the project anymore. It is left to drift. This is a sad story.

@jdeniau
Copy link
Member

jdeniau commented Feb 21, 2024

Hi @mrazauskas , it seems that you know a lot about the subject (probably way more that me at least 😅 ), and that you are really motivated on TSTyche.
I followed your path from tsd-lite to TSTyche.

For immutablejs, it's not a really risky deal as it does change runtime, we could fallback to tsd if you ever abandon TSTyche.
Furthermore, I like the API that you implemented.

If you are willing to migrate immutable the type testing code-base, I will accept a PR 👍 (to be honest, if you don't I may try it myself, but it might be less perfect).

@mrazauskas
Copy link

Thanks for encouragement. This morning I started to prepare a sample PR with two test files. So we could see the difference.

Also big thanks for @arnfaldur for all the job. I came here just because of the issue he opened in the tsd repo. Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants