fix: use iterables instead of generators#2213
Merged
kettanaito merged 3 commits intomswjs:fix/generator-resolverfrom Jul 21, 2024
Merged
fix: use iterables instead of generators#2213kettanaito merged 3 commits intomswjs:fix/generator-resolverfrom
kettanaito merged 3 commits intomswjs:fix/generator-resolverfrom
Conversation
jakebailey
commented
Jul 21, 2024
jakebailey
commented
Jul 21, 2024
| return result | ||
| } | ||
| this.resolverGenerator = | ||
| Symbol.iterator in result |
Contributor
Author
There was a problem hiding this comment.
Reflect.has (used in isIterable) is the same operation as in, except that TS can acutally narrow using in.
kettanaito
reviewed
Jul 21, 2024
| @@ -1,11 +1,20 @@ | |||
| // Redefine these types; the three-parameter forms are only available in TypeScript 5.6 or later. | |||
Member
There was a problem hiding this comment.
Thank you for putting this in! Exactly what I was wondering about.
Contributor
Author
There was a problem hiding this comment.
I can also make these JSDoc comments so they're carried down; whatever you'd prefer.
Member
There was a problem hiding this comment.
I'd mark them as @todo to remove these types once TS 5.6 is the minimal supported version. Not going to happen any time soon but still.
Member
kettanaito
approved these changes
Jul 21, 2024
Member
kettanaito
left a comment
There was a problem hiding this comment.
This looks incredible! 🎉 Thank you so much, @jakebailey. You've made the impossible possible. Local tests are passing, type-compatibility on CI is green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This applies #2108 (comment) to the
fix/generator-resolverbranch.Best viewed without whitespace: https://github.com/mswjs/msw/pull/2213/files?w=1