V9 (vue) reduce unref overhead by supporting getter functions for configuration #6309
Unanswered
teleskop150750
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Is your feature request related to a problem?
Yes. Currently, the Vue adapters in the TanStack ecosystem (such as
@tanstack/table-vueand@tanstack/vue-query) lean heavily into deep object resolving usingunrefor custom deeply-unwrapping helpers (often referred to as themaybeRefanti-pattern in the Vue community).While this mimics React's flat dependency/configuration model, it introduces significant runtime overhead in Vue. The library spends extra CPU cycles deeply traversing configuration objects and data structures to unwrap potential
refs at every lifecycle step, even when the user passes static data or handles reactivity themselves.Describe the solution you'd like
Instead of forcing the internal codebase to deeply inspect and unwrap every single configuration property, the library could adopt a design similar to
@tanstack/solid.We should allow users to pass a getter function that returns a clean, plain JavaScript object. This shifts the responsibility of reactivity resolution to Vue's native reactivity tracking mechanism (like
computedor standard getter evaluation) and leaves the choice of how to unwrap refs to the user.Implementation Example
Pinia colada
Beta Was this translation helpful? Give feedback.
All reactions