Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6d40241
refactor(analytics): move to TypeScript
russellwheatley Aug 12, 2025
c358bcb
chore: make index.ts modular and reexport namespaced from there
russellwheatley Aug 12, 2025
135363f
chore: remove modular folder
russellwheatley Aug 12, 2025
5a58a79
chore: RN bob builder setup + package.json updates
russellwheatley Aug 12, 2025
c081c7a
tsconfig.json update to find app package
russellwheatley Aug 12, 2025
d0a837c
chore(app): validate.d.ts
russellwheatley Aug 12, 2025
068b59f
refactor: convert codebase to TypeScript
russellwheatley Aug 12, 2025
f241c17
chore: resolve index.d.ts issue
russellwheatley Aug 12, 2025
aa2a040
chore(analytics): fix types for index.ts
russellwheatley Aug 12, 2025
ffa235b
fix(analytics): RNFBAnalyticsModule make it modular export
russellwheatley Aug 12, 2025
067d333
fix: analytics with structs
russellwheatley Aug 12, 2025
bddd220
chore: remove import
russellwheatley Aug 12, 2025
e609f76
chore: rename to web types
russellwheatley Aug 12, 2025
081fb4e
fix: analytics types
russellwheatley Aug 12, 2025
86fbd14
chore: moved types to analytics types
russellwheatley Aug 12, 2025
392d882
chore: fix export types
russellwheatley Aug 13, 2025
66870da
chore: use correct type return + extend getApp()
russellwheatley Aug 13, 2025
118c892
fix: export just the type
russellwheatley Aug 13, 2025
4c52e89
use TS from root package
russellwheatley Aug 13, 2025
b4849e8
yarn.lock
russellwheatley Aug 13, 2025
82e75fd
chore: rm unneeded type
russellwheatley Aug 13, 2025
f5ac76f
test: update unit test import
russellwheatley Aug 13, 2025
81f4f36
chore: write type declaration files for web
russellwheatley Aug 13, 2025
7f4dd16
chore: move types/ dir and remove re-export of analytics
russellwheatley Aug 13, 2025
5d9901c
rm unneeded Ts declaration file
russellwheatley Aug 13, 2025
12a0c2a
fix internal types
russellwheatley Aug 13, 2025
75978c2
split modular and namespaced. import into index
russellwheatley Aug 13, 2025
24a4770
fix index.ts
russellwheatley Aug 13, 2025
e58a354
attempt at fixing type test problem
russellwheatley Aug 13, 2025
a34fa95
use default
russellwheatley Aug 13, 2025
1ab90ac
fix web api types
russellwheatley Aug 13, 2025
9d98316
fix SDK_VERSION problem
russellwheatley Aug 13, 2025
6b070ff
chore: update example app with analytics
russellwheatley Aug 13, 2025
33b9eff
tests: move tests to jest
russellwheatley Aug 19, 2025
daa4d0e
test: remove import
russellwheatley Aug 19, 2025
6c5b531
fix: types when using `analytics()` default export
russellwheatley Aug 19, 2025
0338905
chore: testing analytics types
russellwheatley Aug 19, 2025
c793a7f
Merge branch 'main' into analytics-typescript
russellwheatley Aug 19, 2025
305b17a
yarn.lock
russellwheatley Aug 19, 2025
22286d5
podfile.lock
russellwheatley Aug 19, 2025
5d1db47
chore: allow DOM types for web api
russellwheatley Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions packages/analytics/__tests__/analytics.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { jest, afterAll, beforeAll, describe, expect, it, xit, beforeEach } from '@jest/globals';

// @ts-ignore test
import FirebaseModule from '../../app/lib/internal/FirebaseModule';
import FirebaseModule from '@react-native-firebase/app/lib/internal/FirebaseModule';

import {
import analytics, {
firebase,
getAnalytics,
initializeAnalytics,
Expand Down Expand Up @@ -65,7 +65,7 @@ import {
import {
createCheckV9Deprecation,
CheckV9DeprecationFunction,
} from '../../app/lib/common/unitTestUtils';
} from '@react-native-firebase/app/lib/common/unitTestUtils';

describe('Analytics', function () {
describe('namespace', function () {
Expand Down Expand Up @@ -707,6 +707,49 @@ describe('Analytics', function () {
);
});
});

describe('TypeScript migration maintains existing `analytics()` exports', function () {
it('`analytics()` is properly exposed to end user', function () {
expect(analytics().logAddToCart).toBeDefined();
expect(analytics().logAddPaymentInfo).toBeDefined();
expect(analytics().logAddShippingInfo).toBeDefined();
expect(analytics().logAddToWishlist).toBeDefined();
expect(analytics().logAppOpen).toBeDefined();
expect(analytics().logBeginCheckout).toBeDefined();
expect(analytics().logCampaignDetails).toBeDefined();
expect(analytics().logEarnVirtualCurrency).toBeDefined();
expect(analytics().logEvent).toBeDefined();
expect(analytics().logGenerateLead).toBeDefined();
expect(analytics().logJoinGroup).toBeDefined();
expect(analytics().logLevelEnd).toBeDefined();
expect(analytics().logLevelStart).toBeDefined();
expect(analytics().logLevelUp).toBeDefined();
expect(analytics().logLogin).toBeDefined();
expect(analytics().logPostScore).toBeDefined();
expect(analytics().logSelectContent).toBeDefined();
expect(analytics().logSetCheckoutOption).toBeDefined();
expect(analytics().logShare).toBeDefined();
expect(analytics().logSignUp).toBeDefined();
expect(analytics().logSpendVirtualCurrency).toBeDefined();
expect(analytics().logTutorialBegin).toBeDefined();
expect(analytics().logTutorialComplete).toBeDefined();
expect(analytics().logUnlockAchievement).toBeDefined();
expect(analytics().logViewItem).toBeDefined();
expect(analytics().logViewItemList).toBeDefined();
expect(analytics().resetAnalyticsData).toBeDefined();
expect(analytics().logViewCart).toBeDefined();
expect(analytics().setAnalyticsCollectionEnabled).toBeDefined();
expect(analytics().logSelectPromotion).toBeDefined();
expect(analytics().logScreenView).toBeDefined();
expect(analytics().logViewPromotion).toBeDefined();
expect(analytics().setSessionTimeoutDuration).toBeDefined();
expect(analytics().setUserId).toBeDefined();
expect(analytics().setUserProperties).toBeDefined();
expect(analytics().logViewSearchResults).toBeDefined();
expect(analytics().setUserProperty).toBeDefined();
expect(analytics().setConsent).toBeDefined();
});
});
});

describe('modular', function () {
Expand Down
1 change: 1 addition & 0 deletions packages/analytics/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/index';
Loading
Loading