-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix: plugin types compatibility issue with ctx.has #268
Conversation
This PR fixes the issue that resulted in typescript error being thrown when extending However, it features additive implementation of I think that this caveat is minor compared to the original issue. If we are unable to come up with a better alternative, this should be merged until we either find a better solution or split The original problem is very serious as it breaks numerous plugins |
src/filter.ts
Outdated
@@ -433,6 +433,10 @@ type Combine<U, K extends string> = U extends unknown | |||
? U & Partial<Record<Exclude<K, keyof U>, undefined>> | |||
: never; | |||
|
|||
export type FilterE<Q extends FilterQuery> = PerformQueryE< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great PQ, I'd just love to have a better suffix than E
. What does it stand for, extension maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I agree :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me throw a bunch of random names at you:
- FilterExtension
- FilterCore
- FilterAddition
- FilterCasing
- FilterShell
- FilterCover
- FilterSide
- FilterWing
- FilterAugmentation
- FilterEnhancement
- FilterAppendix
- FilterAttachment
- FilterAddendum
I think I prefer FilterCore
. Which one do you like best?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FilterCore
, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's rename then. Can you take care of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about exports and typedoc comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think we need to export the *Core
types. I see no reason to do this, as userland code would likely always want to use the full types. If there's ever demand for this, we can still export it in the future.
JSDoc comments are only necessary for exported stuff. Internal stuff may or may not have it, I'm mostly only doing this when things are hard to understand without comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Then it's done
Codecov Report
@@ Coverage Diff @@
## main #268 +/- ##
==========================================
+ Coverage 37.24% 37.27% +0.02%
==========================================
Files 17 17
Lines 4331 4333 +2
Branches 157 157
==========================================
+ Hits 1613 1615 +2
Misses 2716 2716
Partials 2 2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@EdJoPaTo should we wait for your review? |
Co-authored-by: Kirill Loskutov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!
This fix will be shipped alongside Bot API 6.2 support.
@Loskir please consider signing your commits. I'll merge anyway now, but this would be nice to have for future contributions :) |
Fixes #263