-
-
Notifications
You must be signed in to change notification settings - Fork 450
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(core): Implement stricter variable typings on generic #2607
Conversation
🦋 Changeset detectedLatest commit: 9aca906 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
These come from #2608
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
@kitten is the expected pattern to pass empty variables for cases when there are no variables? e.g. becomes:
|
Resolve #2606
Summary
This attempts to introduce a stricter type for variables preventing it from being an optional property or argument (i.e.
variables?: Variables
) in all parts of the codebase. To do this, we also need to make its type a little more strict withAnyVariables
, which explicitly defaults the generic to a type ofvoid | undefined | { ... }
. In case of a generic that's passed in, this also becomes the extension type.This is currently a draft because some methods on
Client
and some utility functions, likecreateRequest
, are affected by this change. We have to check that these behave as expected (as per the change and RFC) and that we don't break them if that isn't necessarySet of changes
AnyVariables
and make genericsVariables extends AnyVariables = AnyVariables
variables
were optionalvariables?:
was used, a special type must be implemented)