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
Just updated the todomvc implementation, and the size has gone down slightly from v2 which is pleasing. Nonetheless I'm annoyed by all the unmangled identifiers you can see in http://svelte-todomvc.surge.sh/bundle.js — several occurrences of things like numCompleted and click_handler.
There's a couple of ways we could approach this. One is simply to map identifiers to mangled equivalents — so ctx.numCompleted because ctx.a, for example. (This could easily be a production-only thing.)
Another would be for ctx to be an array rather than an object, so that the generated code for this counter would change to this:
The advantage of the array form is that it gets us half way to bitmask-based change tracking (#1922). ctx[0] is more bytes than ctx.a though, and it would be a bit more fiddly to only turn that on in production. (I'm not sure if there are performance implications of having an array versus an object, in terms of lookups etc. Someone else might though! Hint hint @lukeed, to whom I always defer on such questions :)
Relatedly, there's some other low-hanging fruit in there like having a helper for applying className.
The text was updated successfully, but these errors were encountered:
Just updated the todomvc implementation, and the size has gone down slightly from v2 which is pleasing. Nonetheless I'm annoyed by all the unmangled identifiers you can see in http://svelte-todomvc.surge.sh/bundle.js — several occurrences of things like
numCompleted
andclick_handler
.There's a couple of ways we could approach this. One is simply to map identifiers to mangled equivalents — so
ctx.numCompleted
becausectx.a
, for example. (This could easily be a production-only thing.)Another would be for
ctx
to be an array rather than an object, so that the generated code for this counter would change to this:The advantage of the array form is that it gets us half way to bitmask-based change tracking (#1922).
ctx[0]
is more bytes thanctx.a
though, and it would be a bit more fiddly to only turn that on in production. (I'm not sure if there are performance implications of having an array versus an object, in terms of lookups etc. Someone else might though! Hint hint @lukeed, to whom I always defer on such questions :)Relatedly, there's some other low-hanging fruit in there like having a helper for applying
className
.The text was updated successfully, but these errors were encountered: