Skip to content

Conversation

@daniel-graham-amplitude
Copy link
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Oct 30, 2025

Summary

  • Refactor "track-change.ts" to use Zen over RxJS

Checklist

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

Note

Replaces RxJS-based change tracking with ZenObservable + multicast, updates types/subscriptions, and exports Unsubscribable; test page config toggled.

  • Autocapture (browser):
    • Replace RxJS fromEvent(...).pipe(...) change tracking with Zen Observable via multicast(new ZenObservable(...)) using getGlobalScope for DOM listeners in autocapture-plugin.ts.
    • Update AllWindowObservables.ChangeObservable to ZenObservable and subscriptions to Unsubscribable.
    • Refactor track-change.ts to use Zen Observable methods (filter, map) instead of RxJS operators.
  • Core (analytics-core):
    • Export Unsubscribable from utils/observable and re-export in index.ts.
  • Test server:
    • Toggle config: fetchRemoteConfig disabled; enable autocapture.elementInteractions in element-interactions.html.

Written by Cursor Bugbot for commit af190e5. Configure here.

@daniel-graham-amplitude
Copy link
Collaborator Author

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the change event observable from RxJS to Zen Observable implementation to align with the project's move away from RxJS dependencies for change event tracking.

  • Replaced RxJS fromEvent with manual ZenObservable implementation for change events
  • Converted RxJS pipe-based operators (.pipe(filter(), map())) to ZenObservable instance methods (.filter().map())
  • Updated type definitions to use ZenObservable instead of RxJS Observable for change events
  • Exported Unsubscribable type from analytics-core to support the migration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-server/autocapture/element-interactions.html Enabled element interactions and disabled remote config for testing
packages/plugin-autocapture-browser/src/autocapture/track-change.ts Migrated from RxJS pipe operators to ZenObservable instance methods
packages/plugin-autocapture-browser/src/autocapture-plugin.ts Replaced RxJS fromEvent with manual ZenObservable implementation for change events and updated type definitions
packages/analytics-core/src/utils/observable.ts Exported Unsubscribable type
packages/analytics-core/src/index.ts Added Unsubscribable to public exports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as draft October 30, 2025 22:27
Base automatically changed from AMP-142598-frustration-plugin-full-zen to zen-observable-migration October 31, 2025 00:03
@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as ready for review October 31, 2025 04:02
Copy link
Contributor

@Mercy811 Mercy811 left a comment

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 merged commit 02270be into zen-observable-migration Oct 31, 2025
13 of 14 checks passed
@daniel-graham-amplitude daniel-graham-amplitude deleted the AMP-142598-refactor-track-change branch October 31, 2025 18:56
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.

4 participants