Skip to content

refactor: remove and replace analytics-client-common - #1905

Open
daniel-graham-amplitude wants to merge 2 commits into
mainfrom
SDK-144-migrate-common-to-core
Open

refactor: remove and replace analytics-client-common#1905
daniel-graham-amplitude wants to merge 2 commits into
mainfrom
SDK-144-migrate-common-to-core

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced plugin-session-replay-browser's import of 'getAnalyticsConnector' to use 'analytics-core' instead
  • Moved all attribution code from 'client-common' to 'plugin-web-attribution-browser' since that's the only package that imports it
  • Deleted 'analytics-client-common' package
  • Removed any references to it

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Medium Risk
Touches session replay, web attribution, and targeting dependency boundaries; incorrect re-exports or missed imports could break browser SDK behavior at runtime, though the change is primarily structural with no new public API described.

Overview
Removes the deprecated @amplitude/analytics-client-common workspace package and updates the monorepo so consumers depend on @amplitude/analytics-core (and browser-local modules) instead.

Dependency graph: plugin-session-replay-browser, plugin-web-attribution-browser, session-replay-browser, and targeting no longer list analytics-client-common; session replay drops related transitive deps such as idb-keyval and rrweb-packer from the lockfile where they were only pulled in through that path. The expo example pnpm-lock.yaml is regenerated to match.

Code that lived in client-common (attribution helpers, cookie/query utilities, connector wiring, default-tracking flags, etc.) is deleted from that package; callers are expected to use equivalents from analytics-core or analytics-browser / the web attribution plugin, per the PR intent. getAnalyticsConnector for session replay is pointed at core rather than client-common.

Reviewed by Cursor Bugbot for commit dfa8119. Bugbot is set up for automated code reviews on this repo. Configure here.

@daniel-graham-amplitude
daniel-graham-amplitude requested review from a team as code owners July 23, 2026 23:28
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

SDK-144

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 61.28 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.97 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 215.32 KB (-0.02% 🔽)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

@daniel-graham-amplitude
daniel-graham-amplitude force-pushed the SDK-144-migrate-common-to-core branch from 88e1a8f to 664db0a Compare July 23, 2026 23:39
@daniel-graham-amplitude daniel-graham-amplitude changed the title refactor: replace all client-common imports refactor: remove and replace analytics-client-common Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Session Replay Browser E2E Results

passed  153 passed
flaky  1 flaky

Details

stats  154 tests across 17 suites
duration  4 minutes, 19 seconds
commit  dfa8119

Flaky tests

chromium › e2e/shadow-dom.spec.ts › captureAdoptedStyleSheets option › SDK initializes without error and captures shadow host with captureAdoptedStyleSheets=false

@Mercy811 Mercy811 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @daniel-graham-amplitude, overall lgtm! Could you fix these comments? Thanks!

I confirm that right now only plugin SR and plugin web attribution actually imports client common package. SR and targeting are not actively using it at all. It's a unused dependency.

Image

Comment thread packages/plugin-web-attribution-browser/src/constants.ts Outdated
Comment thread scripts/check-deprecated-packages.sh
Comment thread scripts/README.md
Comment thread CONTRIBUTING.md
@daniel-graham-amplitude
daniel-graham-amplitude force-pushed the SDK-144-migrate-common-to-core branch from 664db0a to ed1890f Compare July 29, 2026 21:43
@daniel-graham-amplitude
daniel-graham-amplitude force-pushed the SDK-144-migrate-common-to-core branch from 803e59c to dfa8119 Compare July 29, 2026 22:39

@Mercy811 Mercy811 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@daniel-graham-amplitude
daniel-graham-amplitude enabled auto-merge (squash) July 31, 2026 21:05
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.

3 participants