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 am using the library as a compile-time type checking with TypeScript, but the way that the exports are done, the root .js file is included anyway in the bundle. Is there any way to just add the types to my project without the runtime support?
The text was updated successfully, but these errors were encountered:
The .js is only needed if you use enum values e.g. ActionStatusType.CompletedActionStatus.
I would expect that tree-shaking gets rid of that from the bundle if you don't use it.
I did consider using const enums for enumerations at some point (which are inlined by tsc), but these unfortunately don't play well with Babel.
TBH I've been considering making the backwards-incompatible change of simply forcing people to use string literals (which was enabled by #43), but was hoping tree-shaking worked for most people.
Even when minified, the size of the code here is 20kb. For strings that you're not really using.
The goal is for tree-shaking to be set-up on one's code and have all this be inlined. But it might be desirable not to depend on the user setting this up correctly.
The problem is the change is backwards-incompatible. I think the right call is:
In the upcoming version, mark all exported enum variables as @deprecated, and encourage users to use the string literal instead.
Release 0.8.0 which only incudes the inlined strings.
I am using the library as a compile-time type checking with TypeScript, but the way that the exports are done, the root .js file is included anyway in the bundle. Is there any way to just add the types to my project without the runtime support?
The text was updated successfully, but these errors were encountered: