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

chore(dev): upgrade vue-tsc to 1.4.4 and move to root package.json #17212

Closed
wants to merge 4 commits into from

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Apr 23, 2023

Description

This issue starts to appear since volar@1.3.9, but I couldn't figure out the reason yet.

volar@1.3.8 works.

However, this is an issue supposed to be complained: prove link

this seems to be an issue which didn't show up before, also seems like there was an enhancement from volar@1.3.9 that makes this issue show up. So it doesn't bother we make a fix in vuetify side

Since we can use vue-tsc against dev playground, it would make sense to move vue-tsc to root package.json

Markup:

<template>
  <v-app>
    <v-main>
      <v-select
        return-object
        multiple
      />
      <v-autocomplete
        return-object
        multiple
      />
      <v-combobox
        return-object
        multiple
      />
    </v-main>
  </v-app>
</template>

<script lang="ts">
</script>

@yuwu9145 yuwu9145 self-assigned this Apr 23, 2023
@yuwu9145 yuwu9145 marked this pull request as ready for review April 24, 2023 08:14
@johnleider
Copy link
Member

2 questions:

  • What other areas could this crop up in?
  • What is the reason that we can't infer for these specific props?

@KaelWD
Copy link
Member

KaelWD commented Apr 24, 2023

1.5.2 is out now
I didn't try a separate project yet but I couldn't reproduce the original issue in dev with either 1.2 or 1.4
Need to make sure this is still working in tsx too, volar should be following tsx

@yuwu9145
Copy link
Member Author

yuwu9145 commented Apr 25, 2023

2 questions:

  • What other areas could this crop up in?

This is an issue regarding the usage of extends boolean = true/false, when I do a global search, only multiple & returnObject doing this.

  • What is the reason that we can't infer for these specific props?

It has been an issue which should have shown up from the right beginning. I believe there was something in genericComponent that hides this issue before volar 1.3.8. 1.3.9 was released three weeks ago and it shows up. I am still trying to understand what was it. However, regardless of the cause, this is a proven issue needs to be fixed

@yuwu9145
Copy link
Member Author

yuwu9145 commented Apr 25, 2023

1.5.2 is out now

This version is too new, 1.4.4 is stable.

image

Need to make sure this is still working in tsx too, volar should be following tsx

will do

@KaelWD
Copy link
Member

KaelWD commented Apr 25, 2023

This is why the generics have = false:

const items = [
  { title: 'a' },
  { title: 'b' },
  { title: 'c' },
]
const Comp = (
  <VSelect items={ items } onUpdate:modelValue={ v => v } returnObject />
)

v should be {title: string}, but if typescript doesn't know what multiple is then you get {title: string} | readonly {title: string}[] instead. Volar doesn't seem to be resolving the generic correctly as it's always any in templates.

@KaelWD
Copy link
Member

KaelWD commented Apr 26, 2023

Closing in favour of #17231

@KaelWD KaelWD closed this Apr 26, 2023
@johnleider johnleider deleted the fix-17211 branch January 13, 2024 23: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.

[Bug Report][3.1.15] VSelect prop return-object type error
3 participants