-
-
Notifications
You must be signed in to change notification settings - Fork 190
feat(analytics): introduce @metamask/analytics-client package and consolidate tracking types #1263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abretonc7s
wants to merge
13
commits into
redis-consolidation
Choose a base branch
from
ab/analytics-client
base: redis-consolidation
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f99c6f0
to
29f6f9c
Compare
390e52b
to
5ecfb0b
Compare
21a849c
to
73e7ef5
Compare
ecp4224
approved these changes
Apr 16, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## redis-consolidation #1263 +/- ##
=======================================================
+ Coverage 73.73% 74.00% +0.27%
=======================================================
Files 182 181 -1
Lines 4355 4301 -54
Branches 1067 1061 -6
=======================================================
- Hits 3211 3183 -28
+ Misses 1144 1118 -26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…lytics handling - Created a new package `@metamask/analytics-client` to encapsulate analytics functionality. - Added TypeScript types for analytics events and originator information in `@metamask/sdk-types`. - Updated various SDK packages to utilize the new analytics client, enhancing modularity and maintainability. - Refactored existing analytics code to leverage the new package, ensuring consistent event tracking across the SDK. - Updated package dependencies and configurations to support the new structure.
- Updated Jest configuration to include module name mappings for analytics and SDK types. - Refactored test files to utilize the new `@metamask/analytics-client` package for analytics handling. - Improved global mock setup for `navigator` and `window` properties in tests to ensure proper environment simulation. - Added cleanup logic in tests to restore original global properties after each test execution. - Enhanced test cases for `PlatformManager` and `isOldIOS` to ensure accurate platform detection and behavior.
- Disabled analytics in the SDK configuration for development. - Added 'build' and 'wwww' to the ESLint ignore patterns for better project structure. - Updated .gitignore to include 'wwww' for cleaner build management. - Added a new README.md file in the sdk-types package for documentation.
035fd99
to
4d800d3
Compare
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Overview
This PR introduces a new dedicated package
@metamask/analytics-client
to encapsulate analytics functionality that was previously scattered across multiple packages. It also refactors related types into a new@metamask/sdk-types
package to promote consistency and code reuse.Depends on #1259
Key Changes
@metamask/analytics-client
package that centralizes analytics handling logic@metamask/sdk-types
package with shared types likeOriginatorInfo
andTrackingEvents
sdk-communication-layer
to the dedicated packageImplementation Details
TrackingEvents
,OriginatorInfo
) to a dedicated types packageBreaking Changes
This refactoring introduces some breaking changes for internal package consumers:
sdk-communication-layer
will need to update imports to use@metamask/analytics-client
TrackingEvents
andOriginatorInfo
should now be imported from@metamask/sdk-types
Migration Guide
SendAnalytics
andAnalyticsProps
from@metamask/sdk-communication-layer
with imports from@metamask/analytics-client
TrackingEvents
andOriginatorInfo
from@metamask/sdk-communication-layer
with imports from@metamask/sdk-types
commLayer
in analytics events, this field has been removed as it's now handled internallyTesting Completed
Review Checklist