PostHog / PostHog/posthog-js

This library is large

Open
#65 33 comments 39 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement web
Dominant language
TypeScript
Stars
609
Forks
343
Avg merge
1d 19h
Merged PRs (30d)
302

Description

As it stands now, posthog-js v1.3.0 is about 52.4kb of minified code.

image

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Bundlephobia result for posthog-js@1.3.0 and the linked testing discussion in issue #50, then inspect the library internals to identify measurable size targets. Done requires an agreed priority and refactoring plan that reduces the minified bundle while supporting proper tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.