Open pauldambra opened 9 months ago
@pauldambra, hi!
Sorry, maybe it's the wrong place to ask this question, but can I replace posthog-js
with posthog-js-lite
on the web in production right now?
I only use posthog.identify
and posthog.capture
, so the "minimal API" from the readme seems enough. I tested already, and it seems to work as expected with no issues. The only thing I had to change is how I import posthog, exactly like you said in your comment 👆
hey @fromaline yep, we use it in the toolbar... so it should be completely fine
this issue was only about the mismatch in exports that means you can't always swap with no code changes
@pauldambra, got it! Thanks for answering! PostHog is great tool 👍
Hey @pauldambra!
Does posthog-js-lite no longer record the Device Type
property? It seems to work in regular posthog-js.
Hey, It's best to go through the in-app support flow or ask new questions rather than comment on different issues 😊
posthog-js-lite is a subset of posthog-js - you can see what it gathers here https://github.com/PostHog/posthog-js-lite/blob/e5ccc75f49435e7cf307f9e515aebef79dcc3f8a/posthog-web/src/context.ts#L4
Best to run through the support flow saying what you're observing and what you expect or open a new issue here if you think there's a bug 🙏
@pauldambra so currently there's no way of enabling toolbar with posthog-js-lite, correct? Is that something that will be added in the near future?
hey @joaovpmamede, no... posthog-js-lite
is a super stripped down library for folk that need to prioritise bundle size over functionality. if we add functionality to it then it's no longer `lite' 😊
@pauldambra, thanks for answering my question! Initially, I missed it
@pauldambra got it and I really appreciate the work on the "lite" version. We're playing with it exactly because we'd like a smaller bundle size but now we were requested to have heatmaps and that seems to be only possible with the toolbar.
yep, that's posthog-js only 👍
When building the toolbar we use shared code from the main posthog app
But we never want to allow posthog-js in the toolbar, just posthog-js-lite
You can't always swap one-for-one because you can't
import { posthog } from posthog-js-lite
it'd be cool if you could