-
Notifications
You must be signed in to change notification settings - Fork 131
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
This library is large #65
Comments
I was wondering, would it be possible to "split" this package. For example if I don't need some of the features. I for example don't need the Toolbar or Session Recording at the moment. That could help to minimize the size for people who only need a part of the features. |
This package is huge and leaving us with wondering whether posthog is worthwhile given we're eating very real consequences from Google on mobile LCP. Any updates on this? |
Just discovered this - https://github.com/PostHog/posthog-js-lite/tree/master/posthog-web |
another instance of that https://posthog.com/questions/posthog-js-lite |
Very interested in this also, Posthog-js is now the single largest dependency in my Next.js website bundle, which is a bit ridiculous! I'm trying to improve core web vitals and this is hard to justify. Posthog JS is now larger than react-dom itself (168kb vs 142kb), and it's more than triple the size it was when @mariusandra first opened this issue about it being large. I've looked at the two alternative suggestions above but they're not suitable. In my case this is a Next.js marketing site, and I really just want to track anonymous page events and a handful of other very notable interactions, that's it. That shouldn't require a huge bundle imo, but it doesn't look like the lite alternatives include:
A lightweight package for minimal web analytics would be amazing 🙏 |
As it stands now, posthog-js v1.3.0 is about 52.4kb of minified code.
While nowhere near as bad as some of our competitors (mixpanel-browser is 95KB and segment's analytics.js is 187KB), this can still be improved upon.
Should we improve on this and with what priority? We've covered the low hanging fruit and the next step is to refactor and modernise the library's internals. This would greatly help writing proper tests as well.
The text was updated successfully, but these errors were encountered: