ntohq / buefy-next

Lightweight UI components for Vue.js (Vue3) based on Bulma
https://v3.buefy.org
MIT License
107 stars 10 forks source link

[SlotComponent] Lifecycle hook won't be removed in the future release of Vue #274

Open kikuomax opened 4 weeks ago

kikuomax commented 4 weeks ago

Description

This PR to Vue will make the workaround implemented in the internal component SlotComponent ineffective, which is used to capture update events from the target component. The workaround utilizes the undocumented return value from the onUpdated lifecycle hook so that the hook can be removed when the component is unmounted. The return value is documented as void but actually a reference to the hook wrapper created by Vue. The following is the affected code: https://github.com/ntohq/buefy-next/blob/185589fbced9100d05c84760a7e4eed6dee53da7/packages/buefy-next/src/utils/SlotComponent.js#L47-L48

The PR would become effective in Vue 3.5 or later.

Why Buefy need this feature

Table and Tabs internally use SlotComponent. Table and Tabs will cause memory leaks unless we address the issue.

kikuomax commented 4 weeks ago

Could the vnodeUpdated event help? https://github.com/vuejs/core/issues/4345