feat(types): cheaper WithRequired - #4922
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
…nown` in `WithRequired`
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit db30de1:
|
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #4922 +/- ##
=======================================
Coverage 91.79% 91.79%
=======================================
Files 101 101
Lines 3890 3890
Branches 974 974
=======================================
Hits 3571 3571
Misses 298 298
Partials 21 21 ☔ View full report in Codecov by Sentry. |
|
@Andarist Any idea how much faster this one performs? Seems to be working as intended, but looks weird 😂 |
|
Hard to tell really. It's "theoretically" faster by the sole virtue of using fewer mapped types. The best way to test this would be to run |
|
So i ran a couple of runs on It seems like it improves the time by Of course those tests were not very scientific 🧑🔬 🔫 But it seems it does make a difference. @TkDodo Should we merge it? |
|
It also might be worth checking out the functionality of this code in pre-4.8 - since this is a version that changed some rules around |
|
Good point, we want to support 4.7 and onwards in v5 |
|
Note that I did recheck this (and everything looks alright) - it's just that I'm advising extra caution because of this TS 4.8 change. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit db30de1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
To the best of my understanding - this should work just fine but I didn't test it "thoroughly" with TanStack Query.
I'm opening this PR mostly because I got curious if it will pass your CI jobs. If it does though - it might be worth merging. This reduces 3 mapped types to just one :)