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
When creating a component with multiple root elements, Svelte currently checks detaching for every single root element. IE:
// Truncated for brevity, see REPL// ...functioncreate_fragment(ctx){// ...return{// ...d(detaching){if(detaching)detach(h1);if(detaching)detach(t1);if(detaching)detach(h2);if(detaching)detach(t3);if(detaching)detach(h3);}};}// ...
Describe the bug
When creating a component with multiple root elements, Svelte currently checks
detaching
for every single root element. IE:When ran through Terser, that roughly becomes:
This should be fairly simple to cut down to this:
... which roughly becomes this:
This is a really minor thing, but it should lead to slightly better bundle sizes for some users.
I'd be happy to fix this as a first pull request 😄
Reproduction
REPL
Logs
No response
System Info
I encountered this on the playground, so I suppose 3.42.3?
Severity
annoyance
The text was updated successfully, but these errors were encountered: