You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently building a large dashboard with lots of bells and whistles. And one thing that I like to do, is to prefetch as much data as I can as soon as the user logs in, so that when the user navigates to a page that uses that data, it's instant.
And all of that works nicely, except when some of the endpoints send back large amounts of data. Like an array with 1000 objects or more. Then the UI thread starts to become slow / freeze. Even though I'm only prefetching data, none of that data is affecting the UI yet, because the first page the user lands on is not using any of the queries.
So at first I was confused why the UI thread would get blocked. I'm guessing a part of the reason may be that I'm also linking data from different endpoints together, so that in the end I get models with proper relationships and so on. And it made me wonder, would it help if vue-query, and my code that combines the data, do most of their work in a WebWorker, on a different thread. So that the UI thread just keeps on working no matter how much data vue-query needs to process.
Would that work? And do you guys have any ideas how I could make that work? Or is this something that would need to be implemented in the core of vue-query?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm currently building a large dashboard with lots of bells and whistles. And one thing that I like to do, is to prefetch as much data as I can as soon as the user logs in, so that when the user navigates to a page that uses that data, it's instant.
And all of that works nicely, except when some of the endpoints send back large amounts of data. Like an array with 1000 objects or more. Then the UI thread starts to become slow / freeze. Even though I'm only prefetching data, none of that data is affecting the UI yet, because the first page the user lands on is not using any of the queries.
So at first I was confused why the UI thread would get blocked. I'm guessing a part of the reason may be that I'm also linking data from different endpoints together, so that in the end I get models with proper relationships and so on. And it made me wonder, would it help if vue-query, and my code that combines the data, do most of their work in a WebWorker, on a different thread. So that the UI thread just keeps on working no matter how much data vue-query needs to process.
Would that work? And do you guys have any ideas how I could make that work? Or is this something that would need to be implemented in the core of vue-query?
Beta Was this translation helpful? Give feedback.
All reactions