Open woothu opened 3 years ago
In case when Grid component is hidden (Grid inside node with display:none) the items inside the grid are destroyed, which causes an unnecessary re-render of all items when the Grid display is restored. It is very taxing on performance in case of heavy Grid items and increases the http requests number.
If you can demonstrate the issue, using https://svelte.dev/repl, please do. It will be more helpful for me to understand and help you.
I really don't understand how the fastStart
property is related to performance
In the
Grid
component iffastStart
prop istrue
the items are rendered only if internalxPerPx
is truthy:https://github.com/vaheqelyan/svelte-grid/blob/master/src/index.svelte#L8
In case when Grid component is hidden (Grid inside node with
display:none
) the items inside the grid are destroyed, which causes an unnecessary re-render of all items when the Grid display is restored. It is very taxing on performance in case of heavy Grid items and increases the http requests number.For the hotfix I used
fastStart = false
, but please provide some kind of caching mechanism, to allow grid items caching withfastStart = true
. Caching should be independent offastStart
in my opinion.