Resolve RecipeVariants type to improve IDE hint#1161
Merged
mattcompiles merged 4 commits intovanilla-extract-css:masterfrom Nov 9, 2023
PrettyCoffee:feat/resolve-recipe-variants
Merged
Resolve RecipeVariants type to improve IDE hint#1161mattcompiles merged 4 commits intovanilla-extract-css:masterfrom PrettyCoffee:feat/resolve-recipe-variants
mattcompiles merged 4 commits intovanilla-extract-css:masterfrom
PrettyCoffee:feat/resolve-recipe-variants
Conversation
🦋 Changeset detectedLatest commit: 3ead769 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
Contributor
|
Thanks for the PR! Love the screenshots. We've wanted to do this where it made sense in the repo, but never got around to it. It definitely improves the types significantly. Your PR looks fine, but you'll need to add a changeset in order to get the change released. If you're unfamiliar with changesets, have a look at the links in the changeset bot comment above. |
askoufis
approved these changes
Aug 21, 2023
Contributor
Author
|
@askoufis thanks a lot for adding the changeset! Unfortunately, I didn't have a lot of time last week. 😅 |
Merged
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.
Hey, when testing out vanilla-extract, I found that the type hints are currently very verbose with the generic
RecipeVariantstype and not readable.For example when having a button that has the variants
look,size,pillandsquare, it currently looks like this in my IDE (VSCode):By using a generic type like this:
you can kind of "resolve" the type and only display the actually underlying type:
which has much better readability! :)
This is not changing the type itself, it is more like reassigning the attributes to a new type.
Loving the project so far, great work!♥️