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): sync vue type augmentations with Vue 2.7 #19526
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Might also be that it is (needs to be?) different for Vue 2.6...? |
As mentioned in #9239, I've verified that this issue happens in Vue 2.7 but not in Vue 2.6. Are we fine with going forward with types being only Vue 2.7-compatible? It might be the case already as Nuxt ships with VueRouter version that relies on Vue 2.7 and there are also issues with importing
So, either we just revert #9230 or take this PR which reverts the breaking change but leaves some parts of the original change or we could go with something like rchl@0feb9fe which adapts the original changes to make them Vue 2.7 compatible and preserve the functionality that it added. |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## 2.x #19526 +/- ##
=======================================
Coverage 66.18% 66.18%
=======================================
Files 93 93
Lines 4096 4096
Branches 1158 1158
=======================================
Hits 2711 2711
Misses 1119 1119
Partials 266 266
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. β View full report in Codecov by Sentry. |
Just for the record (since we're discussing this in private anyway): with the current state of the code the inferring of types of properties returned from |
That is a different issue, and not caused by the fix I pushed here, which is correct as far as I can tell, but rather by the fact that there are other parts of these declarations that also need to be updated to work with Vue 2.7. |
I know but we have two ways we can go here. Either just fix the crash or fix the crash and support inferring of asyncData return values. The latter seems complicated and potentially risky (Vue types are a little brittle). So IMO it's an option to just fix the crash without the support for inferring and I feel like this is much safer. Not duplicating the |
I did a bit more than minimal testing and it appears to work nicely in TS components. |
π Linked issue
β Type of change
π Description
Fixing an error:
Note that I haven't tested this probably and I admit I don't fully understand the intentions here so this needs some testing.
π Checklist