wheatjs / vite-plugin-vue-type-imports

Import types in Vue SFC for defineProps
223 stars 16 forks source link

feat: support tsx #33

Closed nooooooom closed 1 year ago

Zolyn commented 1 year ago

Could you add some tests?

If you don't know how to add tests, see https://github.com/wheatjs/vite-plugin-vue-type-imports/pull/19#issuecomment-1203143020

nooooooom commented 1 year ago

Could you add some tests?

If you don't know how to add tests, see #19 (comment)

Sure! I'm thinking of doing this, but i may finish it tomorrow.

nooooooom commented 1 year ago

@Zolyn I think it's just a simple test for tsx because it only adds plugin that supports babel to parse jsx, I'd like to hear your opinion.

Zolyn commented 1 year ago

@Zolyn I think it's just a simple test for tsx because it only adds plugin that supports babel to parse jsx, I'd like to hear your opinion.

I am not familiar with JSX. You can just add a simple usecase in dynamic category.

nooooooom commented 1 year ago

I found out that this change only supports jsx elements in setup but does not support importing types from .tsx files.

Should I try this feature addition in this pr? I don't know much about this, but I'm happy to try to figure this out. It may take some time.

Zolyn commented 1 year ago

https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/ab76726d59538a2eb922bbad4ba6e3cc79171b96/src/core/utils.ts#L164-L193

Currently it only matches .ts .d.ts files

Zolyn commented 1 year ago

Are you going to support importing types from tsx files in this PR or another PR?

nooooooom commented 1 year ago

Are you going to support importing types from tsx files in this PR or another PR?

Okay~ I misunderstood the meaning before. I thought that there was no need to support this feature at present.

I will support the import of tsx in this PR, as this appears to be part of enhancing tsx.