Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
createResizeListenerFactory
module used in various places across the codebase asuse:listenToNodeResize
. In all instances, this action was used to capture the dimensions of an underlying DOM element. However, Svelte provides a native binding for this (bind:clientHeight
andbind:clientWidth
) and this PR replaces usage of the action with this binding.While the Svelte binding has slightly more overhead than
ResizeObserver
, I propose making this change because it is used so infrequently throughout our codebase, removes the need for creating a store for the observed element, and the native binding will be updated to use ResizeObserver in Svelte 5 (sveltejs/svelte#7583).That said, we could also replace this with
bind:borderBoxSize
, which uses the ResizeObserver API already, though it is slightly less ergonomic.This PR also removes the
getEltSize
function, which was only used in theDashboard
component and captured the total size of an element including margin. However, the element it was applied to does not have margin to account for.In a few instances, knowing the dimension of the element is not necessary, but I'll address that in a separate PR.