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
Currently, MemoryPack generates the latter. Meaning, if I only need the serialize() function, the entire class gets bundled anyway. Lots of code that I have no use for.
Additionally, classes get bundled pretty much as-is, while interfaces could be stripped away at bundle time.
For maximum tree-shaking compatibility and minimum bundle sizes, MemoryPack should be generating interfaces and loose functions, for example
Quick refresher on tree-shaking:
when referenced with
will generate
while
when referenced with
will generate
Currently, MemoryPack generates the latter. Meaning, if I only need the
serialize()
function, the entire class gets bundled anyway. Lots of code that I have no use for.Additionally, classes get bundled pretty much as-is, while interfaces could be stripped away at bundle time.
For maximum tree-shaking compatibility and minimum bundle sizes, MemoryPack should be generating interfaces and loose functions, for example
The text was updated successfully, but these errors were encountered: