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

Repo: drop dependency on tsutils #5552

Closed
bradzacher opened this issue Aug 26, 2022 · 6 comments
Closed

Repo: drop dependency on tsutils #5552

bradzacher opened this issue Aug 26, 2022 · 6 comments
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue dependencies Issue about dependencies of the package repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@bradzacher
Copy link
Member

bradzacher commented Aug 26, 2022

Suggestion

tsutils hasn't had a release (or even a commit) in well over a year (march 2021).

It seems like it's a dead package at this point, sadly - there are a number of issues going unanswered and PRs unreviewed. I guess that the owner has moved on to other things, and unfortunately they were the single point of failure.

This hasn't been a problem thus far, but with TS4.8 one of the types is now wrong and required a local patch to work around (#5551).
There are also some known issues caused by the package, which we cannot address without upstream patches (#5458, #3405).

I see three paths forward:

  1. fork the package and release it under our namespace.
  2. attempt to take ownership of the package and updated it.
  3. bring the relevant utils internal into our type-utils package and drop the dependency.

(1) really conflicts with our type-utils package, so it seems immediately dead in the water.
(2) could work, but I personally don't have time to maintain it as a separate project - so we'd be relying on someone else for it (which doesn't really change our predicament - just shifts it). Also it would rely on the current owner being responsive or would rely on npm support passing ownership (which takes time).

IMO just dropping the dependency entirely and bringing the relevant utils into our type-utils package is the best course of action as it allows us to control the code that we so heavily rely on, which makes it easier for us to maintain everything. Given that we publish them as a package, the open-source community still benefits from our maintained versions.

@bradzacher bradzacher added dependencies Issue about dependencies of the package repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue labels Aug 26, 2022
@JoshuaKGoldberg
Copy link
Member

I'd actually be interested in taking on tsutils - it's a pretty useful package and I use it in TypeStat. I've tried emailing the maintainer before but haven't heard from them in a bit. Regardless of what we decide here, I'll try to get that conversation started...

@bradzacher
Copy link
Member Author

If you can get yourself added as a maintainer with full privileges so you needn't depend on the current owner, then that would work great! I'm confident you'll be sticking around for the forseeable future.


In case we do want to drop it as a dep, these are the functions that we use from the package:

  • getWellKnownSymbolPropertyOfType
  • hasModifier
  • isAssignmentKind
  • isBinaryExpression
  • isBooleanLiteralType
  • isCallExpression
  • isCompilerOptionEnabled
  • isConditionalType
  • isIdentifier
  • isIntersectionType
  • isJsxExpression
  • isModifierFlagSet
  • isNewExpression
  • isObjectFlagSet
  • isObjectType
  • isParameterDeclaration
  • isPropertyAssignment
  • isPropertyDeclaration
  • isPropertyReadonlyInType
  • isStrictCompilerOptionEnabled
  • isSymbolFlagSet
  • isThenableType
  • isTypeFlagSet
  • isTypeReference
  • isUnionOrIntersectionType
  • isUnionType
  • isValidPropertyAccess
  • isVariableDeclaration
  • unionTypeParts

A lot of these are pretty light-weight, small functions so there's nothing major or complicated that we depend on.

@aaditmshah
Copy link

Hey folks, I'm also facing the #3405 issue in my project. I'm glad to see that you're working towards resolving the tsutils issue. Thank you so much. I know it's not much but if you need any help then I'll be glad to do so. I have the bandwidth to work on other projects right now. However, it'll take me a while to get up to speed.

@varwasabi
Copy link

varwasabi commented Sep 25, 2022

If you can get yourself added as a maintainer with full privileges so you needn't depend on the current owner, then that would work great! I'm confident you'll be sticking around for the forseeable future.

In case we do want to drop it as a dep, these are the functions that we use from the package:

  • getWellKnownSymbolPropertyOfType
  • hasModifier
  • isAssignmentKind
  • isBinaryExpression
  • isBooleanLiteralType
  • isCallExpression
  • isCompilerOptionEnabled
  • isConditionalType
  • isIdentifier
  • isIntersectionType
  • isJsxExpression
  • isModifierFlagSet
  • isNewExpression
  • isObjectFlagSet
  • isObjectType
  • isParameterDeclaration
  • isPropertyAssignment
  • isPropertyDeclaration
  • isPropertyReadonlyInType
  • isStrictCompilerOptionEnabled
  • isSymbolFlagSet
  • isThenableType
  • isTypeFlagSet
  • isTypeReference
  • isUnionOrIntersectionType
  • isUnionType
  • isValidPropertyAccess
  • isVariableDeclaration
  • unionTypeParts

A lot of these are pretty light-weight, small functions so there's nothing major or complicated that we depend on.

I'll open a PR that has the tsutils functions listed, added to type-utils, update the usage throughout and remove the tsutils as a project dependency where needed.

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Feb 6, 2023

Bringing in #5689 (comment) here: I ended up forking tsutils into ts-api-tools. Hence #6428.

@JoshuaKGoldberg
Copy link
Member

#6428 was merged into the v6 branch (PR: #5886) and so will be released as part of our v6 major version. Cheers!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue dependencies Issue about dependencies of the package repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants