Skip to content

Upgrade to Svelte 5 and remove slow manual component event delegation #1877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Keavon opened this issue Jul 30, 2024 · 1 comment
Open
Assignees
Labels
Performance Speed and efficiency improvements Web Involves web programming (TypeScript, Svelte, CSS)

Comments

@Keavon
Copy link
Member

Keavon commented Jul 30, 2024

LayoutRow.svelte and LayoutCol.svelte each have to manually delegate events and we take the ugly approach of just naming every event for delegation. But as @adamgerhant and I just discovered when debugging a performance issue with creating and destroying a bunch of layers in the Layers panel, it turns out Svelte is creating and destroying an event handler for each and every one of those delegated events, even when nearly all are unused. Removing these quadruples the performance for creating/removing all those layers.

Svelte 5 allows components to delegate events. We should aim to upgrade to Svelte 5 and update how those components are doing their event delegation. (Side note: can we also delegate other attributes like class and style to avoid the hacky way we have many components do that presently?) This should provide a significant frontend performance improvement for all components that utilize LayoutRow and LayoutCol.

@Keavon Keavon added Cleanup Web Involves web programming (TypeScript, Svelte, CSS) Performance Speed and efficiency improvements labels Jul 30, 2024
@Keavon Keavon self-assigned this Jul 30, 2024
@github-project-automation github-project-automation bot moved this to Short-Term in Task Board Jul 30, 2024
@Keavon
Copy link
Member Author

Keavon commented Oct 25, 2024

I'm planning to work on this within the next month now that Svelte 5 is officially out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Speed and efficiency improvements Web Involves web programming (TypeScript, Svelte, CSS)
Projects
Status: Short-Term
Development

No branches or pull requests

1 participant