virtua icon indicating copy to clipboard operation
virtua copied to clipboard

Migrate to Vue SFC for better type/optimization

Open inokawa opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Vue's official support for defineComponent and JSX is limited. It's almost impossible to type slot with generics using defineComponent. Also defineComponent and JSX are less optimized than SFC, and probably can't be compiled with Vapor mode.

Describe the solution you'd like Replace Vue's defineComponent with script setup using SFC, or maybe setupSFC or setupComponent of vue-macros.

Describe alternatives you've considered Continue to use defineComponent and JSX, and improve type/optimization in some way.

Additional context #342 #347

inokawa avatar Nov 21 '24 13:11 inokawa

I believe the shift to SFC is the best solution. SFCs are also easy to write. to just add setup and lang=ts

I have a problem with the types in the current version (slots) like you mentioned.

I also have another problem where the list does update when the data changes. I connected the list to the data return by a Pinia Colada Query. The updates work for regular v-for but not for VList. I had to use :key but now, I am not able to animate the items.

SFC (composition API) would also make it easier for me to read and contribute to the code base.

tobychidi avatar Nov 22 '24 05:11 tobychidi

https://github.com/inokawa/virtua/pull/576#discussion_r1875664556

inokawa avatar Dec 14 '24 12:12 inokawa