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
Describe the solution you'd like
Currently, for dynamic strings in an element, Svelte breaks the string into it's atomic parts (be it a static string or a variable), and treats each part separately. For a textual element (without other embeded elements in it), changing a part of a string in the element doesn't provide much performance value over changing the entire string. Therefor, perhaps it would be better to opt for bundle size, by treating such a string as one unit.
I'll try to demonstrate the idea with the reactive assignment example from the homepage.
It creates various variables, and various operations, just to insert one dynamic string. The basic idea is to treat this string as one unit. Here is a draft of what this could look like.
This is pretty similar to #3898 in a lot of ways though a slightly different solution that could be combined with it. I'd be curious to see some benchmark results to see if this still has value after #3898
Describe the solution you'd like
Currently, for dynamic strings in an element, Svelte breaks the string into it's atomic parts (be it a static string or a variable), and treats each part separately. For a textual element (without other embeded elements in it), changing a part of a string in the element doesn't provide much performance value over changing the entire string. Therefor, perhaps it would be better to opt for bundle size, by treating such a string as one unit.
I'll try to demonstrate the idea with the reactive assignment example from the homepage.
Lets take a look at the
create_fragment
function in the compiled JS output.It creates various variables, and various operations, just to insert one dynamic string. The basic idea is to treat this string as one unit. Here is a draft of what this could look like.
This reduces the js output of this component by 20% (from 1418 chars to 1144. )
How important is this feature to you?
I'm excited about Svelte, but new to the framework. I don't currently use it in production.
The text was updated successfully, but these errors were encountered: