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

feat: use Vue TS plugin #2145

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

feat: use Vue TS plugin #2145

wants to merge 4 commits into from

Conversation

znck
Copy link
Member

@znck znck commented Aug 8, 2020

No description provided.

},
"typescriptServerPlugins": [
{
"name": "@vuedx/typescript-vetur",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is @vuedx/typescript-vetur and where is its source code located?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

It's TS plugin version for vetur.

/cc @octref

@octref
Copy link
Member

octref commented Aug 9, 2020

I'm trying renaming on https://github.com/octref/veturpack/blob/e497ab2c4000c0139d94c2dd4599fa92a4b79530/src/Test.vue#L3, for either child or foo or bar, but it only updates the <template> region.

@znck
Copy link
Member Author

znck commented Aug 9, 2020

Vue 3 compiler treats lower case tag names as elements or web components: https://github.com/vuejs/vue-next/blob/50adc014f59a7f385c836014abb059ec72c52239/packages/compiler-core/src/parse.ts#L483-L487 so renaming child won't update the Child component registered in the components option.

Variable names foo and bar we not working due to a bug that made a false assumption that every component is using <script setup>. TypeScript cannot detect renames in strings: props: ['foo', 'bar'], it would require custom handling (will do it soon).

@yoyo930021
Copy link
Member

yoyo930021 commented Nov 8, 2020

@znck
I think we can add a option for ts plugin in Vetur.
You can update this PR if you have time.
I will merged it and add option for it.

@znck
Copy link
Member Author

znck commented Nov 8, 2020

Let's wait couple more weeks, I'll try to make it a bit more stable.

@yoyo930021
Copy link
Member

@znck Is the time ripe?

@znck
Copy link
Member Author

znck commented Jan 7, 2021

I need to make one more change for 2.x support, using defineCompoment types from composition API plugin.

@yoyo930021
Copy link
Member

I need to make one more change for 2.x support, using defineCompoment types from composition API plugin.

Is defineCompoment types better than Vue.extends in Vue 2?
If user project doesn't have @vue/composition-api?

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.

4 participants