Replies: 1 comment 1 reply
-
I tried to check the performance beforehand. There may be errors in the code, so don't trust the results too much. Originally posted by @teleskop150750 in #908 (comment) |
Beta Was this translation helpful? Give feedback.
-
I use let variables or useRef where React uses useRef. Radix-vue creates unnecessary reactive ref variables in all places, which is completely unnecessary.
I use the composeEventHandlers hook. This hook allows canceling events through preventDefault. Unfortunately, in Vue, handlers received from the parent component end up at the end of the array and are called last (I might have misunderstood the code, there may be inaccuracies).
I use attribute inheritance instead of redefining them in each component, generating unnecessary code. Moreover, it seems that Volar now has typing for attrs. This approach may change if it turns out to be inconvenient to use.
I do not use their useForwardExpose. A hook that replaces the original expose object to pass props outside. Why, if access to them is already available.
I do not use asChild for implementing primitives. Instead, I wrap the component's content in a hook and use it. I thought it was a bit cumbersome to use so many empty wrapper components when they can be eliminated. For example, the FocusScope wrapper is 3 components: FocusScope -> Primitive -> Slot. If there are 3 such wrappers, it is already a tree of 9+ components.
This is currently a test implementation.
I think it's unlikely. In the distant future, there is a thought to abandon components and leave only hooks that return props. For example, like in Zag and Melt. If the Vapor mod comes out in our lifetime, this method will allow us to get rid of
Primitive
andSlot
Different implementation of Collection without Map, VDom. Radix vue
Presence is just a hook for me. The same approach was found in Solid's Kobalte. In radix-vue, it is the reason for the absence of content on the first render in components like Accordion.
Availability of component context export for access in user code. It seems that this was promised to be added in Radix v2. I am not following.
No empty wrappers that do nothing.
An easier way to get the current element without
computed
. Radix-vueScoped Context WIP Link Link
Originally posted by @teleskop150750 in #908 (comment)
Beta Was this translation helpful? Give feedback.
All reactions