-
Notifications
You must be signed in to change notification settings - Fork 18
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
Remove ts-ignores annotations #110
base: main
Are you sure you want to change the base?
Conversation
41debdc
to
1f4608c
Compare
Oops, it looks like I'm going to have to put a little more time into this. |
@SGrondin I wonder if you could export the types for |
@gr2m @SGrondin I made a PR in bottleneck to export types for |
@copperwall as SGrondin/bottleneck#160 shipped now, could you update the PR? |
Oh sure thing, I'll get back on this |
@gr2m I've pushed up a commit that removes the extra types I added to this repo, but it looks like the changes in bottleneck haven't made it into a release yet. |
Ah sorry, I I'll ping @SGrondin ☝🏼 |
This would be really nice to merge. Since the bottleneck repo hasn't seen activity in a while, I propose that we just don't apply typings for bottleneck, or we vendor in the file ourselves in the repo. What are your thoughts? @octokit/js |
I'm -1 on vendoring if we can avoid it, which if the issue is missing types we 100% should be able to by providing the types ourselves here. I agree it's less than ideal to be using a library that isn't being actively maintained anymore - does anyone know of a possible alternative? |
Yeah I'd add the types ourselves.
I do not know of any. But things do tend to pop up if a library like bottleneck becomes stale. I'd get this pr unblocked in the simplest way possible, and then look for a bottleneck alternative. |
Add this point I suggest we cut our own release of bottleneck. It doesn't look like any new changes are coming, and it's been nearly 3 years. I would release our own |
@ollie-iterators We would need to find an alternative that does check our boxes. We need a library that works in all modern JS environments and optionally supports clustering using Redis. I did some research but couldn't find one that would work yet. |
Ok, good luck. |
This removes existing
ts-ignore
annotations fromplugin-retry.js
. I did my best to use existing types from@octokit/types
and@octokit/core
instead of creating new types or interfaces in this project.I did have some trouble getting rid of the type errors in
wrap_request.ts
on thebottleneck/light
import. Thebottleneck
package does specify typings, but it looks like by using thelight
import, TypeScript can't relate those types to the exports frombottleneck/light
.I also tried placing
in a local
bottleneck.d.ts
file to import the Bottleneck namespace from the module and export it under thebottleneck/light
module to appease TypeScript, but I got an error about how those types couldn't be applied tobottleneck/light
import. The only thing that seemed to work was copying the type definitions into the library.I'm open to looking for more solutions other than copying 1000+ lines of another modules types into this one, but this is the solution I've found so far.
Closes #43