Skip to content
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(types): make $Fetch types less complex #1059

Merged
merged 3 commits into from
Mar 22, 2023

Conversation

mahdiboomeri
Copy link
Contributor

πŸ”— Linked issue

#1050

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR make $Fetch types less recursive by inlining Serialize in generated types. It also re-enables Simplify
I've manually tested the fix with nuxt repo test:types.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #1059 (8f50a27) into main (300df93) will increase coverage by 0.27%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main    #1059      +/-   ##
==========================================
+ Coverage   67.34%   67.62%   +0.27%     
==========================================
  Files          62       63       +1     
  Lines        6300     6356      +56     
  Branches      709      711       +2     
==========================================
+ Hits         4243     4298      +55     
- Misses       2042     2043       +1     
  Partials       15       15              
Impacted Files Coverage Ξ”
src/build.ts 41.48% <0.00%> (-0.11%) ⬇️
src/types/fetch.ts 100.00% <100.00%> (ΓΈ)
src/types/index.ts 100.00% <100.00%> (ΓΈ)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed this doesn't show the previous issues with type complexity in the nuxt repo. And it looks good to me in any case, moving the complexity to individual endpoints rather than within the extends check. πŸ‘Œ

@pi0 pi0 merged commit fe3287c into unjs:main Mar 22, 2023
@mahdiboomeri mahdiboomeri deleted the perf/fetch-types branch March 22, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants