Skip to content

feat(browser): more improvements to tree shake#3097

Closed
dustinbyrne wants to merge 15 commits intomainfrom
feat/maximum-tree-shake
Closed

feat(browser): more improvements to tree shake#3097
dustinbyrne wants to merge 15 commits intomainfrom
feat/maximum-tree-shake

Conversation

@dustinbyrne
Copy link
Copy Markdown
Contributor

Problem

Changes

This is a work in progress - I'll likely open separate PRs to keep this digestible, but getting some visibility on these changes in the interim.

module.slim.js                   90.0kb raw /  31.4kb gz
module.js                       174.2kb raw /  55.8kb gz

-43.72% over baseline

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react
  • @posthog/ai
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin
  • @posthog/types

Checklist

  • Tests for new code
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the "release" label to the PR to indicate we're publishing new versions for the affected packages

This is a starting point for permitting the bundle to be tree shaken.
this change should effectively be a no-op, with the default extensions
replacing the entirety of what was previously available.
No prepackaged extensions. This bundle is not currently exported. It's
useful in its current state in showing what the maximum byte size return
is when tree shaking.
This will allow us to clean up some verbose extension calls and save
some bytes
Exceptions, toolbar, experiments, conversations, logs
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
posthog-js Error Error Feb 13, 2026 10:49pm
posthog-nextjs-config Error Error Feb 13, 2026 10:49pm

Request Review

@dustinbyrne
Copy link
Copy Markdown
Contributor Author

@dustinbyrne dustinbyrne closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant