Skip to content

feat(amp-semantic): capture browser lifecycle boundaries - #2150

Draft
jxiwang wants to merge 3 commits into
codex/semantic-visibility-recorderfrom
codex/semantic-lifecycle-events
Draft

jxiwang wants to merge 3 commits into
codex/semantic-visibility-recorderfrom
codex/semantic-lifecycle-events

Conversation

@jxiwang

@jxiwang jxiwang commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the amp-semantic/lifecycle recorder as a small follow-up to #2128. It emits pagehide, pageshow, pageshow_bfcache, freeze, and resume with the shared version, timestamp, tab ID, and document ID. The schema, local inspector, and browser transport test cover the new family. Recording status and the other event families remain in later PRs.

This is a clean replacement for the lifecycle portion of the older draft #2080; it uses the package runtime already on main and leaves context and visibility in their own PRs.

Validation

  • pnpm install --frozen-lockfile — passed (Node 24)
  • pnpm --filter @amplitude/amp-semantic build — passed
  • pnpm --filter @amplitude/amp-semantic exec jest --runInBand — 41 tests passed, 100% coverage
  • pnpm --filter @amplitude/amp-semantic test:playwright — 8 tests passed
  • pnpm lint, pnpm lint:deps, pnpm test:examples — passed
  • pnpm build — stalled in the unchanged Segment Session Replay Rollup bundle; stopped after several minutes. The semantic package build passed independently.
  • pnpm test — blocked by two failures in unchanged analytics-react-native tests (offline-integration.test.ts and remnant-data-migration.test.ts).

Draft until the workspace gates are green and #2128 is merged.

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 68.41 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 140.38 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 226.82 KB (0%)
@amplitude/element-selector (gzipped esm) 3.48 KB (0%)
@amplitude/analytics-browser/lite (gzipped CDN bundle) 21.34 KB (0%)

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Session Replay Browser E2E Results

passed  158 passed
flaky  1 flaky

Details

stats  159 tests across 18 suites
duration  4 minutes, 26 seconds
commit  cb69f25

Flaky tests

chromium › e2e/shadow-dom.spec.ts › captureAdoptedStyleSheets option › SDK initializes without error and captures shadow host with default (true)

This branch has not been deployed

No deployments
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