Remove ts-ignores annotations#110
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 PR is included in version 8.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This removes existing
ts-ignoreannotations fromplugin-retry.js. I did my best to use existing types from@octokit/typesand@octokit/coreinstead of creating new types or interfaces in this project.I did have some trouble getting rid of the type errors in
wrap_request.tson thebottleneck/lightimport. Thebottleneckpackage does specify typings, but it looks like by using thelightimport, TypeScript can't relate those types to the exports frombottleneck/light.I also tried placing
in a local
bottleneck.d.tsfile to import the Bottleneck namespace from the module and export it under thebottleneck/lightmodule to appease TypeScript, but I got an error about how those types couldn't be applied tobottleneck/lightimport. 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