-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce bundle size of the SDK and/or make it treeshakable #442
Comments
iterable-web-sdk/src/inapp/inapp.ts Lines 670 to 672 in e51f10f
set which could be replaced with setting property directly.
Yup library is used in very few places and could easily replaced with https://valibot.dev/ treeskable, very small bundle size alternative uuid can be replaced with native crypto.generateRandomUUID Axios could be replaced with native fetch, though that might be breaking change, not quite sure. |
This doesn't exist in the current README (but should still be applicable at this time): If you import functions from their direct path, your app should only bundle the code you're using. So this: import { getInAppMessages } from '@iterable/web-sdk/dist/inapp'; instead of this: import { getInAppMessages } from '@iterable/web-sdk'; But yeah updating the |
I am lazily importing Iterable, though I might be impacted by rollup/rollup#5410 bug, my bad about treeshaking part, though there are still low hanging fruits which could be optimized. |
Opened a PR to enable tree-shaking here. Will cut a separate ticket for addressing some of the larger packages usage. |
The bundle size of the Iterable SDK minified is 294kb which is very large, some apps are smaller than this.
One way to reduce size of the library would be to make it more treeshable, if for example some feature is not used it could be stripped from the final bundle, maybe they could be opt in, for example if users only use tracking and not notifications and so on.
The text was updated successfully, but these errors were encountered: