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
I'm trying to use this library in an embedded context where we care a lot about memory usage, but having some issues.
When referencing generated TS code, we're able to do import type to get types only from a generated module, but if we attempt to actually import an enum to reference a value within it, it pulls in lots of other code within the file into our final bundle and blows the size up, causing it to fail to execute as we run out of memory.
It seems like Rollup should be able to treeshake these out, but it doesn't know that all the constructor invocations have no side effects.
Is there a way around this, eg a way to maybe just generate types without serializers/deserializers which seem to be the extra weight in the code?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to use this library in an embedded context where we care a lot about memory usage, but having some issues.
When referencing generated TS code, we're able to do
import type
to get types only from a generated module, but if we attempt to actually import an enum to reference a value within it, it pulls in lots of other code within the file into our final bundle and blows the size up, causing it to fail to execute as we run out of memory.It seems like Rollup should be able to treeshake these out, but it doesn't know that all the constructor invocations have no side effects.
Is there a way around this, eg a way to maybe just generate types without serializers/deserializers which seem to be the extra weight in the code?
Beta Was this translation helpful? Give feedback.
All reactions