Refactor tracking methods to queue arguments for analytics#65
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughChanged analytics method wrappers in apps/html to enqueue calls into a shared queue (w[da].q) instead of invoking the central function immediately. Methods affected include trackClick, trackLead, and trackSale. Public API remains the same; internal control flow shifts from synchronous dispatch to deferred queue processing. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Page as Page Script
participant Stub as w[da] (stub)
participant Queue as w[da].q
participant Real as Analytics Loader
User->>Page: triggers trackClick/trackLead/trackSale
Page->>Stub: w[da][m](...args)
Note over Stub,Queue: New behavior (deferred)
Stub->>Queue: push([m, ...args])
Note over Queue: Calls accumulate until loader is ready
Real-->>Queue: drain queued calls (async)
loop For each queued item
Real->>Real: dispatch(method, args)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
Summary by CodeRabbit
Refactor
Bug Fixes
Performance
Chores