-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add custom device mode integrations support #2309
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
feat: add custom device mode integrations support #2309
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds first-class support for custom device-mode integrations: new types and utilities, an Analytics and RudderAnalytics API method addCustomIntegration, safe analytics instance storage, integration-centric device-mode flows, extensive tests, snippet/public API updates (addCustomIntegration), build/env changes, and workflow trigger/notification tweaks. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Snippet
participant SDK
participant Analytics
participant DeviceModeDestinations
participant State
User->>Snippet: rudderanalytics.addCustomIntegration(id, integration)
Snippet->>SDK: enqueue or proxy addCustomIntegration
SDK->>Analytics: addCustomIntegration(destinationId, integration, isBuffered?)
alt isBufferedInvocation true or SDK loaded
Analytics->>DeviceModeDestinations: addCustomIntegration(destinationId, integration, state, logger)
DeviceModeDestinations->>DeviceModeDestinations: validateCustomIntegration(...)
alt valid
DeviceModeDestinations->>DeviceModeDestinations: addIntegrationToDestination(...)
DeviceModeDestinations->>State: update configuredDestinations (trigger effects)
else invalid
DeviceModeDestinations->>Analytics: logger.error(...)
end
else buffer invocation
Analytics->>State: append to eventBuffer
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📥 CommitsReviewing files that changed from the base of the PR and between 2d82a3ec352f8c01b20a02b607cf9e4e16125cb1 and d9e8183. 📒 Files selected for processing (73)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2309 +/- ##
============================================
+ Coverage 65.05% 91.37% +26.31%
============================================
Files 482 207 -275
Lines 16533 5959 -10574
Branches 3323 1172 -2151
============================================
- Hits 10756 5445 -5311
+ Misses 4588 488 -4100
+ Partials 1189 26 -1163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (1)
.github/workflows/unit-tests-and-lint.yml (1)
70-70: Same consistency note as above for SonarQube actionApply the same decision (keep or remove version comment) here.
🧹 Nitpick comments (4)
.github/workflows/unit-tests-and-lint.yml (1)
54-55: Minor: dropped version comments — keep or drop consistentlyYou removed the inline version comment
# v5.4.3, yet kept the pinned SHA.
For consistency (and easier human scanning) either keep the comment for both pinned actions or drop them in all workflows.packages/analytics-js-plugins/src/deviceModeDestinations/index.ts (1)
36-53: Consider adding duplicate integration name check.The method correctly validates and adds custom integrations. However, it doesn't check if an integration with the same name already exists, which could lead to duplicate integrations in the active destinations list.
Consider adding a check to prevent duplicate integration names:
addCustomIntegration( name: string, integration: RSACustomIntegration, state: ApplicationState, logger: ILogger, ): void { if (!validateCustomIntegration(name, integration, state, logger)) { return; } + // Check if a custom integration with the same name already exists + const existingIntegration = state.nativeDestinations.activeDestinations.value.find( + dest => dest.isCustomIntegration && dest.displayName === name, + ); + + if (existingIntegration) { + logger.warn(`Custom integration "${name}" already exists. Skipping addition.`); + return; + } + const destination = createCustomIntegrationDestination(name, integration, state, logger); // Add them to the state state.nativeDestinations.activeDestinations.value = [ ...state.nativeDestinations.activeDestinations.value, destination, ]; },packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (1)
953-1132: Excellent comprehensive test coverage for createSafeAnalyticsInstance!The test suite thoroughly covers:
- Safe instance creation and storage in state
- All required methods are present and properly bound
- Automatic creation during RudderAnalytics construction
- Correct context preservation when methods are called
The tests provide confidence that the safe analytics instance will work correctly with custom integrations.
Consider adding a test to verify that the safe analytics instance doesn't expose sensitive methods like
load,reset, orsetAuthToken:it('should not expose sensitive methods in safe analytics instance', () => { rudderAnalyticsInstance.createSafeAnalyticsInstance(); const safeInstance = state.lifecycle.safeAnalyticsInstance.value!; // Verify sensitive methods are not exposed expect(safeInstance).not.toHaveProperty('load'); expect(safeInstance).not.toHaveProperty('reset'); expect(safeInstance).not.toHaveProperty('setAuthToken'); expect(safeInstance).not.toHaveProperty('consent'); expect(safeInstance).not.toHaveProperty('setDefaultInstanceKey'); });packages/analytics-js/__tests__/components/core/Analytics.test.ts (1)
913-1026: Well-structured test suite with comprehensive coverage.The test suite thoroughly covers the
addCustomIntegrationmethod's buffering behavior, error handling, and plugin manager interactions. The tests properly verify that custom integrations can only be added before the SDK is loaded, which is a good safety measure.Consider adding a test to verify that buffered custom integration calls are properly processed when the SDK loads:
+ it('should process buffered addCustomIntegration calls when SDK loads', () => { + // Add custom integration while SDK is not loaded + analytics.addCustomIntegration('TestIntegration', mockCustomIntegration); + + expect(state.eventBuffer.toBeProcessedArray.value).toEqual([ + ['addCustomIntegration', 'TestIntegration', mockCustomIntegration], + ]); + + // Simulate SDK loading + state.lifecycle.loaded.value = true; + + // Process buffered events + analytics.processBufferedEvents(); + + // Verify the custom integration was added via plugin manager + const invokeSingleSpy = jest.spyOn( + analytics.pluginsManager as IPluginsManager, + 'invokeSingle', + ); + + expect(invokeSingleSpy).toHaveBeenCalledWith( + 'nativeDestinations.addCustomIntegration', + 'TestIntegration', + mockCustomIntegration, + state, + analytics.logger, + ); + + expect(state.eventBuffer.toBeProcessedArray.value).toEqual([]); + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 74cf7fd and 7e23816f582424fc7c34ffbcbbb9be5bb3303d4d.
📒 Files selected for processing (36)
.github/workflows/check_pr_title.yml(1 hunks).github/workflows/security-code-quality-and-bundle-size-checks.yml(1 hunks).github/workflows/unit-tests-and-lint.yml(3 hunks)packages/analytics-js-common/.size-limit.js(1 hunks)packages/analytics-js-common/__tests__/utilities/destinations.test.ts(1 hunks)packages/analytics-js-common/src/types/ApplicationState.ts(2 hunks)packages/analytics-js-common/src/types/Destination.ts(2 hunks)packages/analytics-js-common/src/types/Event.ts(1 hunks)packages/analytics-js-common/src/types/IRudderAnalytics.ts(2 hunks)packages/analytics-js-common/src/types/Logger.ts(1 hunks)packages/analytics-js-common/src/utilities/destinations.ts(2 hunks)packages/analytics-js-integrations/.size-limit.js(1 hunks)packages/analytics-js-plugins/.size-limit.mjs(1 hunks)packages/analytics-js-plugins/__mocks__/state.ts(2 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts(3 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts(19 hunks)packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts(9 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/index.ts(4 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts(2 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/types.ts(0 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts(8 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts(1 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts(2 hunks)packages/analytics-js/__tests__/app/RudderAnalytics.test.ts(4 hunks)packages/analytics-js/__tests__/components/core/Analytics.test.ts(17 hunks)packages/analytics-js/public/index.html(3 hunks)packages/analytics-js/src/app/RudderAnalytics.ts(5 hunks)packages/analytics-js/src/browser.ts(2 hunks)packages/analytics-js/src/components/configManager/util/commonUtil.ts(2 hunks)packages/analytics-js/src/components/core/Analytics.ts(3 hunks)packages/analytics-js/src/components/core/IAnalytics.ts(2 hunks)packages/analytics-js/src/constants/logMessages.ts(2 hunks)packages/analytics-js/src/index.ts(1 hunks)packages/analytics-js/src/state/slices/lifecycle.ts(1 hunks)packages/loading-scripts/.size-limit.mjs(1 hunks)packages/loading-scripts/src/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- packages/analytics-js-plugins/src/deviceModeDestinations/types.ts
🧰 Additional context used
🧠 Learnings (36)
📓 Common learnings
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-10-08T15:52:59.819Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-06-25T08:25:30.628Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-06-14T09:50:33.511Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/__tests__/components/capabilitiesManager/CapabilitiesManager.test.ts:58-58
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user saikumarrs is fine with using the `any` type in the `CapabilitiesManager.test.ts` file for mocking purposes.
packages/analytics-js-common/.size-limit.js (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-06-28T15:31:21.910Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
packages/analytics-js-common/src/types/Event.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
packages/analytics-js-integrations/.size-limit.js (11)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
.github/workflows/check_pr_title.yml (7)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2308
File: .github/workflows/deploy-staging.yml:26-27
Timestamp: 2025-06-26T12:33:40.146Z
Learning: The `deploy-staging.yml` workflow only triggers on `pull_request` events, so the `trigger_source` variable correctly assumes PR context is always available and doesn't need guards for other event types.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0
Timestamp: 2025-06-23T12:35:08.817Z
Learning: Pull requests must have clear, actionable titles, complete descriptions using the PR template, include testing evidence (such as test results or screenshots), and clearly document any breaking changes.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0
Timestamp: 2025-06-23T12:35:08.817Z
Learning: Branch names must follow the pattern 'feature/SDK-1234-description' or 'fix/SDK-1234-description', and the repository history should be cleaned up (squash/rebase) before merging.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Branch names in RudderStack projects must follow the conventions: 'feature/', 'fix/', or 'docs/' prefixes to indicate the type of work.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Pull requests in RudderStack projects must use the provided PR templates to ensure consistency and completeness of information.
.github/workflows/unit-tests-and-lint.yml (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2308
File: .github/workflows/deploy-staging.yml:26-27
Timestamp: 2025-06-26T12:33:40.146Z
Learning: The `deploy-staging.yml` workflow only triggers on `pull_request` events, so the `trigger_source` variable correctly assumes PR context is always available and doesn't need guards for other event types.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: .github/workflows/deploy-sanity-suite.yml:133-133
Timestamp: 2024-10-08T15:52:59.819Z
Learning: No action was required for the issue of the non-existent `packages/sanity-suite/dist/` directory in the `.github/workflows/deploy-sanity-suite.yml` file as per the user's decision.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: .github/workflows/deploy-sanity-suite.yml:133-133
Timestamp: 2024-07-27T07:02:57.329Z
Learning: No action was required for the issue of the non-existent `packages/sanity-suite/dist/` directory in the `.github/workflows/deploy-sanity-suite.yml` file as per the user's decision.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0
Timestamp: 2025-06-23T12:35:08.817Z
Learning: Pull requests must have clear, actionable titles, complete descriptions using the PR template, include testing evidence (such as test results or screenshots), and clearly document any breaking changes.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Branch names in RudderStack projects must follow the conventions: 'feature/', 'fix/', or 'docs/' prefixes to indicate the type of work.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Pull requests in RudderStack projects must use the provided PR templates to ensure consistency and completeness of information.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0
Timestamp: 2025-06-23T12:35:08.817Z
Learning: Branch names must follow the pattern 'feature/SDK-1234-description' or 'fix/SDK-1234-description', and the repository history should be cleaned up (squash/rebase) before merging.
packages/analytics-js/src/state/slices/lifecycle.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/sanitize.ts:0-0
Timestamp: 2024-10-28T08:02:55.044Z
Learning: The previous suggestions on the `getSanitizedValue` function in `packages/analytics-js-common/src/utilities/sanitize.ts` are no longer valid.
packages/analytics-js/src/browser.ts (17)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2209
File: packages/analytics-js/__tests__/components/userSessionManager/utils.test.ts:209-223
Timestamp: 2025-05-06T09:03:18.823Z
Learning: The `generateAutoTrackingSession` function in the RudderStack JS SDK always generates new `id` and `expiresAt` values based on the current timestamp, regardless of any values provided in the input object. It extracts only `timeout` and `cutOff` properties from the input.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
packages/loading-scripts/.size-limit.mjs (4)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-06-28T15:31:21.910Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
packages/loading-scripts/src/index.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
packages/analytics-js/src/constants/logMessages.ts (13)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1703
File: packages/analytics-js/src/components/pluginsManager/PluginsManager.ts:31-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: There is no immediate plan to implement the TODOs in the `PluginsManager.ts` file as per user directive. These include chained plugins, retry mechanism, and timeout error mechanism. This should be ignored unless otherwise instructed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1703
File: packages/analytics-js/src/components/pluginsManager/PluginsManager.ts:31-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: There is no immediate plan to implement the TODOs in the `PluginsManager.ts` file as per user directive. These include chained plugins, retry mechanism, and timeout error mechanism. This should be ignored unless otherwise instructed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
packages/analytics-js-common/__tests__/utilities/destinations.test.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1867
File: packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts:1692-1692
Timestamp: 2024-10-08T15:52:59.819Z
Learning: When updating test suites, changes to the domain (e.g., from 'example.com' to 'dummy.dataplane.host.com') are only necessary for tests that actually make network requests.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
packages/analytics-js-common/src/types/Logger.ts (7)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
.github/workflows/security-code-quality-and-bundle-size-checks.yml (8)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2308
File: .github/workflows/deploy-staging.yml:26-27
Timestamp: 2025-06-26T12:33:40.146Z
Learning: The `deploy-staging.yml` workflow only triggers on `pull_request` events, so the `trigger_source` variable correctly assumes PR context is always available and doesn't need guards for other event types.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: .github/workflows/deploy-prod.yml:10-27
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The job name `deploy-tag` has been replaced with `deploy` in all relevant GitHub workflow files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: .github/workflows/deploy-sanity-suite.yml:133-133
Timestamp: 2024-10-08T15:52:59.819Z
Learning: No action was required for the issue of the non-existent `packages/sanity-suite/dist/` directory in the `.github/workflows/deploy-sanity-suite.yml` file as per the user's decision.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: .github/workflows/deploy-sanity-suite.yml:133-133
Timestamp: 2024-07-27T07:02:57.329Z
Learning: No action was required for the issue of the non-existent `packages/sanity-suite/dist/` directory in the `.github/workflows/deploy-sanity-suite.yml` file as per the user's decision.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Branch names in RudderStack projects must follow the conventions: 'feature/', 'fix/', or 'docs/' prefixes to indicate the type of work.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0
Timestamp: 2025-06-23T12:35:08.817Z
Learning: Branch names must follow the pattern 'feature/SDK-1234-description' or 'fix/SDK-1234-description', and the repository history should be cleaned up (squash/rebase) before merging.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Pull requests in RudderStack projects must use the provided PR templates to ensure consistency and completeness of information.
packages/analytics-js/src/components/core/IAnalytics.ts (13)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
packages/analytics-js-common/src/types/ApplicationState.ts (13)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts:72-72
Timestamp: 2024-11-09T05:32:00.696Z
Learning: In `UserSessionManager.test.ts`, when necessary, it's acceptable to directly set raw cookie values by accessing the original storage engine with `getOriginalEngine()`, instead of using the `Store` interface methods.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-common/src/utilities/url.ts:10-10
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `isValidURL` function in `packages/analytics-js-common/src/utilities/url.ts` uses `string | undefined` instead of `any` for the `url` parameter to enhance type safety.
packages/analytics-js-common/src/utilities/destinations.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/src/components/configManager/util/validate.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The function `isTopLevelDomain` in `validate.ts` was renamed to `isWebpageTopLevelDomain` for clarity.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/src/components/configManager/util/validate.ts:0-0
Timestamp: 2024-07-04T07:11:53.000Z
Learning: The function `isTopLevelDomain` in `validate.ts` was renamed to `isWebpageTopLevelDomain` for clarity.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/sanitize.ts:0-0
Timestamp: 2024-10-28T08:02:55.044Z
Learning: The previous suggestions on the `getSanitizedValue` function in `packages/analytics-js-common/src/utilities/sanitize.ts` are no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
packages/analytics-js-plugins/__mocks__/state.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/sanitize.ts:0-0
Timestamp: 2024-10-28T08:02:55.044Z
Learning: The previous suggestions on the `getSanitizedValue` function in `packages/analytics-js-common/src/utilities/sanitize.ts` are no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/utilities.ts:17-17
Timestamp: 2024-10-28T08:50:48.488Z
Learning: In the `isDataPlaneUrlValid` function in `packages/analytics-js/src/components/core/utilities.ts`, enforcing HTTPS for data plane URLs is not required at this point.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1649
File: packages/analytics-js/src/components/configManager/ConfigManager.ts:183-183
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `workspaceId` in `packages/analytics-js/src/components/configManager/ConfigManager.ts` and related files does not require validation as per user clarification.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1649
File: packages/analytics-js/src/components/configManager/ConfigManager.ts:183-183
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `workspaceId` in `packages/analytics-js/src/components/configManager/ConfigManager.ts` and related files does not require validation as per user clarification.
packages/analytics-js/src/components/configManager/util/commonUtil.ts (23)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/sanitize.ts:0-0
Timestamp: 2024-10-28T08:02:55.044Z
Learning: The previous suggestions on the `getSanitizedValue` function in `packages/analytics-js-common/src/utilities/sanitize.ts` are no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1649
File: packages/analytics-js/src/components/configManager/ConfigManager.ts:183-183
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `workspaceId` in `packages/analytics-js/src/components/configManager/ConfigManager.ts` and related files does not require validation as per user clarification.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1649
File: packages/analytics-js/src/components/configManager/ConfigManager.ts:183-183
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `workspaceId` in `packages/analytics-js/src/components/configManager/ConfigManager.ts` and related files does not require validation as per user clarification.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:9-27
Timestamp: 2024-10-28T08:14:00.846Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `stringifyData` function assumes that data is sanitized beforehand, so additional error handling within this function is not necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-common/src/utilities/url.ts:10-10
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `isValidURL` function in `packages/analytics-js-common/src/utilities/url.ts` uses `string | undefined` instead of `any` for the `url` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-common/src/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `isValidURL` function in `packages/analytics-js-common/src/utilities/url.ts` uses `string | undefined` instead of `any` for the `url` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/__tests__/components/configManager/validate.test.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getDataServiceUrl` function in the RudderStack JavaScript SDK will not receive an empty endpoint.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/__tests__/components/configManager/validate.test.ts:0-0
Timestamp: 2024-07-04T07:11:12.450Z
Learning: The `getDataServiceUrl` function in the RudderStack JavaScript SDK will not receive an empty endpoint.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/__tests__/components/configManager/validate.test.ts:50-60
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getDataServiceUrl` function in the RudderStack JavaScript SDK will not receive an empty endpoint.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1777
File: packages/analytics-js/__tests__/components/configManager/validate.test.ts:50-60
Timestamp: 2024-07-04T07:01:21.464Z
Learning: The `getDataServiceUrl` function in the RudderStack JavaScript SDK will not receive an empty endpoint.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/utilities.ts:17-17
Timestamp: 2024-10-28T08:50:48.488Z
Learning: In the `isDataPlaneUrlValid` function in `packages/analytics-js/src/components/core/utilities.ts`, enforcing HTTPS for data plane URLs is not required at this point.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
packages/analytics-js-plugins/.size-limit.mjs (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-06-28T15:31:21.910Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1771
File: packages/loading-scripts/rollup.config.mjs:60-60
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `ecma` version needs to be specified twice in the `terser` configuration of `packages/loading-scripts/rollup.config.mjs` for specific compatibility or formatting requirements.
packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts (10)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts (20)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/deviceModeTransformation/utilities.ts:159-159
Timestamp: 2024-11-09T05:58:54.124Z
Learning: In this codebase, when catching errors, it's acceptable to type caught errors as `any` because `errorHandler?.onError` can handle all kinds of errors.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/beaconQueue/index.ts:84-87
Timestamp: 2024-10-15T11:40:19.087Z
Learning: In the `BeaconQueue` plugin of the RudderStack Analytics JS SDK, when catching errors in the `queueProcessCallback`, the error should not be passed to the `done` callback; instead, `done(null)` is used to remove the item from the queue without retrying.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2246
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/utilities.test.ts:349-353
Timestamp: 2025-06-02T14:48:20.980Z
Learning: In device mode transformation utilities tests, the groupingHash validation was intentionally left out of the exception handling test case for JSON parsing errors.
packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts (11)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `INVALID_POLYFILL_URL_WARNING` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string` instead of `any` for the `customPolyfillUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
packages/analytics-js/public/index.html (21)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
packages/analytics-js/src/app/RudderAnalytics.ts (30)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/sanitize.ts:0-0
Timestamp: 2024-10-28T08:02:55.044Z
Learning: The previous suggestions on the `getSanitizedValue` function in `packages/analytics-js-common/src/utilities/sanitize.ts` are no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts:72-72
Timestamp: 2024-11-09T05:32:00.696Z
Learning: In `UserSessionManager.test.ts`, when necessary, it's acceptable to directly set raw cookie values by accessing the original storage engine with `getOriginalEngine()`, instead of using the `Store` interface methods.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:29-57
Timestamp: 2024-10-28T08:15:18.358Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `getReplacer` function is designed to keep track of ancestors between multiple function calls, so the `ancestors` array should not be reset at the start of each top-level call.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService is initialized in its constructor, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts (15)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
packages/analytics-js/src/components/core/Analytics.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript sample apps, error messages often refer to environment variables like `WRITE_KEY` and `DATAPLANE_URL` in the repository root's `.env` file, rather than the example-specific environment variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script copies these values from the root .env file to each example's .env file, replacing placeholders accordingly.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript examples, error messages correctly reference the root-level environment variables (`WRITE_KEY` and `DATAPLANE_URL`) rather than framework-specific variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script reads these variables from the root `.env` file and propagates them to each example's configuration, replacing placeholders like `${WRITE_KEY}` and `${DATAPLANE_URL}` with actual values.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
packages/analytics-js-common/src/types/IRudderAnalytics.ts (14)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
packages/analytics-js-common/src/types/Destination.ts (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
packages/analytics-js/src/index.ts (14)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
packages/analytics-js-plugins/src/deviceModeDestinations/index.ts (16)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
packages/analytics-js/__tests__/components/core/Analytics.test.ts (39)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts:1362-1362
Timestamp: 2024-11-09T05:04:51.002Z
Learning: In tests for the UserSessionManager, it's acceptable to spy on private methods like `private_syncValueToStorage` when necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: david8z
PR: rudderlabs/rudder-sdk-js#2037
File: packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js:120-121
Timestamp: 2025-02-10T13:32:41.446Z
Learning: In Facebook Pixel integration, the isReady method should always check for actual pixel initialization state using fbq.getState().pixels, even when skipInitialization is true, as the pixel might be initialized by other tools.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/beaconQueue/index.ts:84-87
Timestamp: 2024-10-15T11:40:19.087Z
Learning: In the `BeaconQueue` plugin of the RudderStack Analytics JS SDK, when catching errors in the `queueProcessCallback`, the error should not be passed to the `done` callback; instead, `done(null)` is used to remove the item from the queue without retrying.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:9-27
Timestamp: 2024-10-28T08:14:00.846Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `stringifyData` function assumes that data is sanitized beforehand, so additional error handling within this function is not necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/userSessionManager/UserSessionManager.test.ts:72-72
Timestamp: 2024-11-09T05:32:00.696Z
Learning: In `UserSessionManager.test.ts`, when necessary, it's acceptable to directly set raw cookie values by accessing the original storage engine with `getOriginalEngine()`, instead of using the `Store` interface methods.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1984
File: packages/analytics-js/__tests__/services/StoreManager/StoreManager.test.ts:205-205
Timestamp: 2025-01-07T11:10:36.994Z
Learning: The StoreManager test expecting 8 warnings for storage fallbacks is correct as it accounts for both the cascading storage fallbacks (cookie -> localStorage -> sessionStorage -> memory) and additional Store operation warnings.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1740
File: packages/analytics-js-plugins/src/bugsnag/utils.ts:119-119
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `state` parameter in the `getNewClient` function within `packages/analytics-js-plugins/src/bugsnag/utils.ts` is correctly typed as `ApplicationState`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (23)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript examples, error messages correctly reference the root-level environment variables (`WRITE_KEY` and `DATAPLANE_URL`) rather than framework-specific variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script reads these variables from the root `.env` file and propagates them to each example's configuration, replacing placeholders like `${WRITE_KEY}` and `${DATAPLANE_URL}` with actual values.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript sample apps, error messages often refer to environment variables like `WRITE_KEY` and `DATAPLANE_URL` in the repository root's `.env` file, rather than the example-specific environment variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script copies these values from the root .env file to each example's .env file, replacing placeholders accordingly.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:9-27
Timestamp: 2024-10-28T08:14:00.846Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `stringifyData` function assumes that data is sanitized beforehand, so additional error handling within this function is not necessary.
packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService is initialized in its constructor, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (34)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
Learnt from: david8z
PR: rudderlabs/rudder-sdk-js#2037
File: packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js:120-121
Timestamp: 2025-02-10T13:32:41.446Z
Learning: In Facebook Pixel integration, the isReady method should always check for actual pixel initialization state using fbq.getState().pixels, even when skipInitialization is true, as the pixel might be initialized by other tools.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the `delete` operator for performance reasons. Instead, set the value to `undefined` in the `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The `delete` operator in `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts` should be replaced with setting the value to `undefined` to avoid performance issues.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/deviceModeTransformation/utilities.ts:159-159
Timestamp: 2024-11-09T05:58:54.124Z
Learning: In this codebase, when catching errors, it's acceptable to type caught errors as `any` because `errorHandler?.onError` can handle all kinds of errors.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-integrations/__tests__/integrations/SpotifyPixel/browser.test.js:249-260
Timestamp: 2024-07-27T07:02:57.329Z
Learning: Inconsistencies in data structures such as `line_items` within test scripts of the `SpotifyPixel` and `Podsights` integrations can be ignored as per user guidance, as they do not necessarily reflect production code requirements.
Learnt from: ItsSudip
PR: rudderlabs/rudder-sdk-js#1684
File: packages/analytics-js-integrations/__tests__/utils/commonUtils.test.js:355-357
Timestamp: 2024-06-10T07:43:52.149Z
Learning: The `isBlank` function in `commonUtils.test.js` is expected to return `false` when the input is `null`, as per the specific implementation and requirement of the project.
Learnt from: ItsSudip
PR: rudderlabs/rudder-sdk-js#1684
File: packages/analytics-js-integrations/__tests__/utils/commonUtils.test.js:355-357
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `isBlank` function in `commonUtils.test.js` is expected to return `false` when the input is `null`, as per the specific implementation and requirement of the project.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the `getDeliveryPayload` function does not require additional error handling for stringification failures.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2246
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/utilities.test.ts:349-353
Timestamp: 2025-06-02T14:48:20.980Z
Learning: In device mode transformation utilities tests, the groupingHash validation was intentionally left out of the exception handling test case for JSON parsing errors.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/__tests__/components/capabilitiesManager/CapabilitiesManager.test.ts:129-129
Timestamp: 2024-07-27T07:02:57.329Z
Learning: When testing code that relies on imported constants, ensure the mock is applied correctly before the test cases run to avoid issues with timing or execution flow.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
🧬 Code Graph Analysis (10)
packages/analytics-js/src/constants/logMessages.ts (2)
packages/analytics-js-common/src/constants/logMessages.ts (1)
LOG_CONTEXT_SEPARATOR(25-25)packages/analytics-js-plugins/src/shared-chunks/common.ts (1)
LOG_CONTEXT_SEPARATOR(31-31)
packages/analytics-js-common/__tests__/utilities/destinations.test.ts (3)
packages/analytics-js-common/src/utilities/destinations.ts (4)
getNonCloudDestinations(45-45)isNonCloudDestination(44-44)isHybridModeDestination(46-46)getDestinationUserFriendlyId(47-47)packages/analytics-js-common/__fixtures__/fixtures.ts (1)
destinations(202-202)packages/analytics-js-common/src/types/Destination.ts (1)
Destination(140-152)
packages/analytics-js/src/components/core/IAnalytics.ts (1)
packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
RSACustomIntegration(229-291)
packages/analytics-js-common/src/types/ApplicationState.ts (1)
packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
RSAnalytics(210-223)
packages/analytics-js/src/components/configManager/util/commonUtil.ts (1)
packages/analytics-js-common/src/utilities/destinations.ts (1)
getDestinationUserFriendlyId(47-47)
packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts (1)
packages/analytics-js-plugins/src/shared-chunks/common.ts (1)
LOG_CONTEXT_SEPARATOR(31-31)
packages/analytics-js-common/src/types/IRudderAnalytics.ts (4)
packages/analytics-js/src/index.ts (4)
RSALogger(17-17)RSAEvent(24-24)LogLevel(17-17)IntegrationOpts(16-16)packages/analytics-js-common/src/types/Logger.ts (2)
RSALogger(21-24)LogLevel(19-19)packages/analytics-js-common/src/types/Event.ts (1)
RSAEvent(65-67)packages/analytics-js-plugins/src/types/plugins.ts (1)
LogLevel(6-6)
packages/analytics-js-common/src/types/Destination.ts (3)
packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
IntegrationRSAnalytics(293-297)packages/analytics-js/src/index.ts (2)
IntegrationOpts(16-16)RSAEvent(24-24)packages/analytics-js-common/src/types/Event.ts (1)
RSAEvent(65-67)
packages/analytics-js/__tests__/components/core/Analytics.test.ts (4)
packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
RSACustomIntegration(229-291)packages/analytics-js-plugins/__mocks__/state.ts (1)
state(221-221)packages/analytics-js/src/state/index.ts (1)
state(62-62)packages/analytics-js-common/src/types/PluginsManager.ts (1)
IPluginsManager(4-12)
packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (3)
packages/analytics-js/src/app/RudderAnalytics.ts (1)
RudderAnalytics(645-645)packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
RSACustomIntegration(229-291)packages/analytics-js/src/state/index.ts (2)
resetState(62-62)state(62-62)
🪛 Biome (1.9.4)
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts
[error] 2346-2346: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Bundle size checks
- GitHub Check: Security and code quality checks
- GitHub Check: Unit Tests and Lint
🔇 Additional comments (68)
packages/analytics-js-common/.size-limit.js (1)
9-9: Good addition for explicit import specification.The
import: '*'property explicitly includes all imports in size calculations, which improves the accuracy of bundle size measurement.However, given the warning comment about contacting CODEOWNERS before editing, please confirm this change was approved by the appropriate code owners.
packages/analytics-js-plugins/.size-limit.mjs (4)
9-10: Verify the Module Federation Mapping size limit increase.The size limit for both Legacy and Modern CDN Module Federation Mapping was doubled from 0.5 KiB to 1 KiB. This suggests the bundles have grown significantly.
Please confirm this increase is justified and aligns with the actual bundle sizes after the custom device mode integrations feature implementation.
Also applies to: 15-16
21-22: Confirm the Legacy CDN plugins size reduction.The size limit appears to have been reduced significantly for the Legacy CDN plugins bundle, while adding the
import: '*'property.Please verify this reduction aligns with actual bundle optimization and doesn't risk future size limit violations.
27-27: LGTM for Modern CDN import specification.Adding
import: '*'to the Modern CDN plugins configuration is consistent with other entries.
1-4: Confirm CODEOWNERS approval for size limit changes.The file header explicitly warns against editing without CODEOWNERS contact. Given the significant size limit adjustments in this file, please confirm proper approval was obtained.
packages/analytics-js-integrations/.size-limit.js (1)
9-9: Good addition for consistent import specification.Adding
import: '*'to both Legacy and Modern CDN integration bundles ensures comprehensive import coverage in size calculations, consistent with other package configurations.Please confirm this change was approved by CODEOWNERS as indicated in the file header warning.
Also applies to: 15-15
.github/workflows/check_pr_title.yml (1)
5-5: Includefix/*anddocs/*branches as wellBranch-naming guidelines for RudderStack projects allow
fix/…anddocs/…prefixes (see contribution rules 005 & 006).
If a PR comes from those prefixes the title check workflow will currently be skipped.- branches: ['main', 'develop', 'hotfix/*', 'feature/*'] + branches: ['main', 'develop', 'hotfix/*', 'feature/*', 'fix/*', 'docs/*']⛔ Skipped due to learnings
Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/005-rudderstack-contribution.mdc:0-0 Timestamp: 2025-06-23T12:35:04.772Z Learning: Branch names in RudderStack projects must follow the conventions: 'feature/', 'fix/', or 'docs/' prefixes to indicate the type of work.Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/005-rudderstack-contribution.mdc:0-0 Timestamp: 2025-06-23T12:35:04.772Z Learning: Pull requests in RudderStack projects must use the provided PR templates to ensure consistency and completeness of information.Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0 Timestamp: 2025-06-23T12:35:08.817Z Learning: Branch names must follow the pattern 'feature/SDK-1234-description' or 'fix/SDK-1234-description', and the repository history should be cleaned up (squash/rebase) before merging.Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0 Timestamp: 2025-06-23T12:35:08.817Z Learning: Pull requests must have clear, actionable titles, complete descriptions using the PR template, include testing evidence (such as test results or screenshots), and clearly document any breaking changes.Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/005-rudderstack-contribution.mdc:0-0 Timestamp: 2025-06-23T12:35:04.772Z Learning: All code changes in RudderStack projects require review from RudderStack team members before merging, ensuring code quality and shared understanding.Learnt from: CR PR: rudderlabs/rudder-sdk-js#0 File: .cursor/rules/006-rudderstack-git-standards.mdc:0-0 Timestamp: 2025-06-23T12:35:08.817Z Learning: All commit messages in RudderStack repositories must follow the Conventional Commits format, including a mandatory scope and a subject line no longer than 50 characters (including type and scope).Learnt from: saikumarrs PR: rudderlabs/rudder-sdk-js#2308 File: .github/workflows/deploy-staging.yml:26-27 Timestamp: 2025-06-26T12:33:40.146Z Learning: The `deploy-staging.yml` workflow only triggers on `pull_request` events, so the `trigger_source` variable correctly assumes PR context is always available and doesn't need guards for other event types.Learnt from: saikumarrs PR: rudderlabs/rudder-sdk-js#1823 File: packages/analytics-js-common/src/utilities/retryQueue/logMessages.ts:6-7 Timestamp: 2024-11-08T13:18:49.846Z Learning: In the 'rudder-sdk-js' repository, ignore code coverage issues during code reviews.packages/analytics-js-common/src/types/Event.ts (1)
65-67: LGTM! Clean event wrapper type for custom integrations.The
RSAEventtype provides a clear, simple wrapper forRudderEventobjects, consistent with the naming pattern of other RSA types in the codebase.packages/analytics-js-common/src/types/Logger.ts (1)
21-24: LGTM! Well-designed scoped logger interface.The
RSALoggertype appropriately restricts the logger interface for custom integrations by including core logging methods while excluding scope manipulation capabilities.packages/analytics-js-common/src/utilities/destinations.ts (3)
5-5: LGTM! Improved documentation clarity.The enhanced documentation clearly explains the conditions for non-cloud mode destinations, including hybrid mode scenarios.
32-41: LGTM! Clean utility function for consistent ID formatting.The
getDestinationUserFriendlyIdfunction provides a standardized way to generate user-friendly identifiers with clear transformation logic.
43-48: LGTM! Export statement correctly updated.The exports include the new utility function alongside existing exports.
packages/loading-scripts/.size-limit.mjs (1)
9-9: LGTM! Explicit import configuration for size limit.Adding
import: '*'makes the size limit calculation more explicit by including all imports in the bundle size measurement.packages/analytics-js/src/state/slices/lifecycle.ts (1)
18-18: LGTM! Consistent state property addition.The
safeAnalyticsInstancesignal follows the established pattern of other lifecycle state properties and supports the custom integration functionality.packages/analytics-js/src/browser.ts (1)
28-28: LGTM! Consistent API exposure pattern.The
addCustomIntegrationmethod is correctly exposed following the same pattern as other public methods in the browser facade.Also applies to: 56-56
packages/analytics-js/src/constants/logMessages.ts (1)
270-271: LGTM! Well-structured error message.The new error message follows the established pattern in this file, using
LOG_CONTEXT_SEPARATORconsistently and providing clear feedback about the integration restriction.Also applies to: 332-332
packages/loading-scripts/src/index.ts (1)
43-43: LGTM! Essential for buffering support.Adding
addCustomIntegrationto the methods array ensures that calls to this method before SDK initialization are properly buffered and replayed, which is crucial for the loading snippet functionality.packages/analytics-js-common/src/types/ApplicationState.ts (1)
24-24: LGTM! Well-designed safe analytics instance.The addition of
safeAnalyticsInstanceto the lifecycle state enables custom integrations to access a controlled subset of analytics methods safely. The use ofSignal<RSAnalytics | undefined>provides reactive updates while maintaining type safety.Also applies to: 100-100
packages/analytics-js/src/components/core/IAnalytics.ts (1)
22-22: LGTM! Well-designed interface extension.The
addCustomIntegrationmethod signature is well-structured with clear documentation. The method follows established patterns in the interface, including theisBufferedInvocationparameter for buffering support, and uses the properly definedRSACustomIntegrationtype.Also applies to: 220-230
packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts (1)
11-16: Enhanced error reporting with additional context.The function signature update to include event type and optional event name provides much better context for debugging integration forwarding failures. This improvement will make it easier to identify specific issues during event processing.
packages/analytics-js-common/__tests__/utilities/destinations.test.ts (1)
10-62: Well-structured test organization and comprehensive coverage.The reorganization into nested
describeblocks improves test readability and maintainability. The new test suite forgetDestinationUserFriendlyIdprovides good coverage of the utility function, verifying the correct formatting with spaces replaced by hyphens and triple underscores as separators.packages/analytics-js-plugins/__mocks__/state.ts (2)
79-91: Comprehensive mock for safe analytics instance testing.The
safeAnalyticsInstancemock provides good coverage of the analytics methods that would be exposed in a safe context. All essential methods (track,page,identify,group,alias) and getters are properly mocked with Jest functions for testing scenarios.
170-170: Source name property addition supports enhanced identification.The addition of the
nameproperty to the source signal enhances the mock state to better represent real-world source configurations.packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts (2)
24-31: Consistent terminology update from "instance" to "integration".The renaming from
instancetointegrationaligns with the broader terminology standardization across the codebase, improving clarity and consistency.
206-210: Error message assertions updated to match enhanced format.The test assertions correctly reflect the new detailed error message format that includes event type and event name, ensuring test coverage aligns with the improved error reporting capabilities.
packages/analytics-js/src/components/configManager/util/commonUtil.ts (2)
27-28: Import addition for centralized utility function.Good addition to support the refactoring toward centralized user-friendly ID generation logic.
409-412: Excellent refactoring to centralize user-friendly ID generation.Replacing inline string manipulation with the
getDestinationUserFriendlyIdutility function improves maintainability and ensures consistent ID formatting across the codebase. This follows the DRY principle and centralizes the logic for generating user-friendly destination identifiers.packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts (3)
3-7: LGTM: Import updates align with integration terminology.The updated imports correctly reflect the shift from "instance" to "integration" terminology and include the new
RSAEventtype for proper event wrapping.
73-77: LGTM: Event forwarding updated correctly.The event forwarding properly:
- Wraps the event in an
RSAEventobject under themessagekey as expected by integrations- Uses
dest.integrationinstead of the deprecateddest.instanceproperty- Maintains type safety with
DeviceModeIntegrationEventAPIs
82-87: LGTM: Enhanced error reporting provides better debugging context.The updated error handling now includes method name, destination user-friendly ID, and event name, which will significantly improve debugging capabilities when integration forwarding fails.
packages/analytics-js/src/index.ts (1)
17-17: LGTM: Type exports support custom integration feature.The new type exports (
RSALogger,RSAnalytics,RSACustomIntegration,RSAEvent) properly expose the custom integration types to package consumers, following the established pattern of re-exporting from the common package.Also applies to: 20-24
packages/analytics-js/src/components/core/Analytics.ts (2)
34-34: LGTM: Proper imports for custom integration support.The imports correctly include the
RSACustomIntegrationtype and the error message for lifecycle validation.Also applies to: 63-63
832-865: LGTM: Well-implemented custom integration API.The
addCustomIntegrationmethod properly handles the SDK lifecycle:
- Buffered invocations: Directly forwards to the plugin manager when the SDK is loaded
- Pre-load calls: Buffers the invocation for later processing
- Post-load calls: Logs an appropriate error and returns early
The implementation follows the established patterns used by other SDK methods and maintains consistency with the event buffering system.
packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts (1)
1-2: LGTM: Well-structured error messages for custom integration validation.The new error message functions follow the established patterns:
- Proper use of
LOG_CONTEXT_SEPARATORfor consistent formatting- Clear, descriptive error messages for different validation scenarios
- Consistent parameter naming and return types
These will provide helpful debugging information for custom integration issues.
Also applies to: 21-29, 37-39
packages/analytics-js/public/index.html (2)
13-13: LGTM: Proper version bump and method registration.The version update to "3.1.0" is appropriate for this new feature, and adding "addCustomIntegration" to the methods array ensures proper buffering before the SDK loads.
Also applies to: 29-29
189-227: LGTM: Comprehensive custom integration example.The sample custom integration effectively demonstrates the new feature by:
- Implementing all required methods (
init,isReady,page,track,identify,alias,group)- Using debug logging to show method invocations and arguments
- Being registered before the SDK load call (correct timing)
This provides a clear example for developers on how to implement custom integrations.
packages/analytics-js-plugins/src/deviceModeDestinations/index.ts (2)
12-20: LGTM! Well-organized imports for custom integration support.The imports are properly structured and include all necessary types and utility functions for custom integration support.
107-111: Excellent change to preserve custom integrations!The modification from assignment to concatenation ensures that custom integrations added via
addCustomIntegrationare preserved whensetActiveDestinationsis called. This is a critical fix for supporting custom integrations alongside configured destinations.packages/analytics-js-common/src/types/Destination.ts (2)
8-10: Well-designed type definitions for device mode integrations!The
DeviceModeIntegrationtype is comprehensive and well-documented:
- Clear separation between required (
isReady) and optional methods- Consistent event handler signatures using
RSAEvent- Helpful JSDoc comments for each method
- The rename from "Destination" to "Integration" better reflects the expanded functionality
Also applies to: 18-85
147-147: LGTM! Clear distinction between standard and custom integrations.The property rename from
instancetointegrationand the addition ofisCustomIntegrationflag provide a clean way to differentiate between standard and custom integrations.Also applies to: 151-151
packages/analytics-js/src/app/RudderAnalytics.ts (4)
10-13: LGTM! Proper imports for custom integration support.The imports are correctly added for the new custom integration functionality.
Also applies to: 30-30
100-103: Good initialization of custom integration support in constructor.The method binding follows the established pattern, and automatically creating the safe analytics instance ensures it's available for integrations from the start.
120-140: Well-implemented safe analytics instance for integrations!The implementation correctly:
- Exposes only the necessary subset of methods for integrations
- Properly binds all methods to maintain the correct
thiscontext- Stores the instance in the reactive state for accessibility
This provides a secure and controlled interface for custom integrations.
633-642: LGTM! Consistent implementation with proper error handling.The
addCustomIntegrationmethod follows the established pattern of other public methods with:
- Input sanitization using
getSanitizedValue- Delegation to the analytics instance
- Error catching and dispatching
packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (2)
2-2: LGTM! Proper import for custom integration type.
742-784: Good test coverage for addCustomIntegration method.The tests properly verify:
- Correct forwarding of arguments to the analytics instance
- Error handling with event dispatching
packages/analytics-js-common/src/types/IRudderAnalytics.ts (5)
5-5: LGTM! Appropriate imports for custom integration types.Also applies to: 8-9
202-207: Good addition to the analytics interface.The
addCustomIntegrationmethod is well-documented and has a clear, intuitive signature.
210-223: Well-designed RSAnalytics type for integration usage.The
RSAnalyticstype appropriately exposes only the methods that integrations need:
- Event tracking methods (track, page, identify, group, alias)
- Data retrieval methods (getAnonymousId, getUserId, etc.)
Sensitive methods like
load,reset, andsetAuthTokenare correctly excluded.
225-291: Excellent custom integration type definition!The
RSACustomIntegrationtype is well-designed:
- Clear and comprehensive JSDoc documentation
- Consistent method signatures with analytics instance, logger, and event parameters
- Appropriate use of required (
isReady) vs optional methods- Provides flexibility for integration developers to implement only needed event handlers
This creates a clean, extensible contract for custom integrations.
293-297: LGTM! Useful extension type for integration context.The
IntegrationRSAnalyticstype appropriately extendsRSAnalyticswith integration-specific configuration properties that integrations may need to access.packages/analytics-js/__tests__/components/core/Analytics.test.ts (3)
4-4: LGTM!The import for
RSACustomIntegrationtype is correctly added and properly used in the new test suite.
255-255: LGTM!The optional chaining with non-null assertions is appropriate here since these service properties are initialized by
prepareInternalServices()before being accessed in the tests.Also applies to: 449-449, 472-472, 495-497, 516-518, 545-545, 563-563, 579-579, 595-596, 608-610, 628-628, 637-637, 653-653
278-282: Verify the undefined analyticsInstance in event details.The test expects
analyticsInstance: undefinedin the CustomEvent detail. This might indicate that the Analytics class is not properly setting the safe analytics instance when dispatching these events.Run the following script to verify how these events are dispatched in the implementation:
#!/bin/bash # Description: Check how RSA_Initialised and RSA_Ready events are dispatched # Search for RSA_Initialised event dispatch ast-grep --pattern 'dispatchEvent($_)' rg -A 5 "RSA_Initialised|RSA_Ready" --type tsWhat is the purpose of the analyticsInstance property in CustomEvent detail for RudderStack analytics events?Also applies to: 400-404
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (3)
9-9: LGTM!The import for
RSACustomIntegrationtype is correctly added and used in the new test suite.
385-468: Excellent test coverage for custom integration preservation.This test ensures that custom integrations added via
addCustomIntegrationare preserved whensetActiveDestinationsis called, and that configured destinations are properly appended to the existing list. This is critical for maintaining the integrity of custom integrations throughout the SDK lifecycle.
1163-1442: Exceptional test coverage for the addCustomIntegration feature!This comprehensive test suite thoroughly validates all aspects of custom integration support:
- Input validation (name, format)
- Conflict detection with existing destinations
- Proper destination object creation
- State management and preservation of existing destinations
- Edge case handling
The tests ensure robust error handling and maintain the integrity of the destination management system.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (6)
25-31: LGTM! UUID mocking is properly configured.The mock setup follows Jest best practices by defining the mock before importing the module.
110-136: LGTM! Test correctly updated to use new integration terminology.The test properly uses the new
integration.isReady()method and maintains the same test coverage.
231-315: Excellent test coverage for analytics method forwarding!The test thoroughly verifies that all analytics methods are correctly forwarded to the safe analytics instance, ensuring proper integration with the state management system.
1101-1144: LGTM! Function rename improves clarity.The plural form
filterDisabledDestinationsbetter reflects that the function operates on an array of destinations.
1445-1831: Outstanding test coverage for custom integration validation!The test suite comprehensively covers:
- All edge cases for name validation (empty, null, undefined, whitespace)
- Conflict detection with existing destinations
- Interface conformance checking for all optional methods
- Proper handling of partial implementations
This thorough testing ensures robust validation of custom integrations.
2142-2347: Excellent realistic integration test!The test with
realisticIntegrationprovides valuable coverage by:
- Demonstrating actual usage of analytics and logger APIs
- Testing the full lifecycle (init, ready, track, page, identify)
- Verifying logger output at different levels
- Showing how custom integrations interact with the analytics instance
This serves as both a test and documentation for custom integration developers.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (5)
9-48: LGTM! Imports properly organized for new functionality.The new imports support the custom integration features and maintain good organization by grouping related imports together.
74-98: Clean refactoring to integration terminology!The simplified analytics instance creation using the spread operator with
safeAnalyticsInstanceis more maintainable than manually wrapping each method.
159-165: Good defensive programming for integration initialization.The code properly handles cases where the integration might already exist (e.g., custom integrations) while maintaining backward compatibility for standard destinations.
346-386: Robust validation logic for custom integrations.The validation properly ensures:
- Name is a non-empty string
- No conflicts with existing destination names
- Required
isReadymethod is present- All provided methods are functions
The implementation aligns with the SDK's single-threaded execution model.
393-461: Excellent implementation of custom integration destination creation!Key strengths:
- Logger cloning with scoped naming for better debugging
- Safe logger interface exposing only necessary methods
- Consistent method wrapping that injects analytics instance and logger
- Proper handling of optional methods using spread operator
- Unique ID generation for each custom integration
The design provides a clean abstraction for custom integrations while maintaining consistency with standard integrations.
.github/workflows/security-code-quality-and-bundle-size-checks.yml
Outdated
Show resolved
Hide resolved
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts
Outdated
Show resolved
Hide resolved
a17b7d9 to
1400c5f
Compare
12d2765
12d2765 to
bb541e7
Compare
ceb3470
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/gatsby/sample-gatsby-site/gatsby-browser.js (1)
5-5: Remove the redundant 'use strict' directive.The 'use strict' directive is redundant in module context as JavaScript modules are automatically in strict mode.
- 'use strict';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between bb541e7 and ceb3470ec96ef49730f176649105bcc19f87e5a3.
📒 Files selected for processing (29)
examples/angular/sample-app/src/index.html(2 hunks)examples/gatsby/sample-gatsby-site/gatsby-browser.js(1 hunks)examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html(1 hunks)examples/nextjs/hooks/sample-app/src/app/layout.tsx(2 hunks)examples/nextjs/js/sample-app/src/app/layout.js(2 hunks)examples/nextjs/page-router/sample-app/src/pages/_document.tsx(2 hunks)examples/nextjs/ts/sample-app/src/app/layout.tsx(2 hunks)examples/reactjs/hooks/sample-app/public/index.html(2 hunks)examples/reactjs/js/sample-app/public/index.html(2 hunks)examples/reactjs/ts/sample-app/public/index.html(2 hunks)examples/reactjs/vite/sample-app/index.html(2 hunks)examples/v3-beacon/index.html(2 hunks)examples/v3-legacy-minimum-plugins/index.html(2 hunks)examples/v3-legacy/index.html(2 hunks)examples/v3-minimum-plugins/index.html(2 hunks)examples/v3/index.html(2 hunks)packages/analytics-js/__tests__/nativeSdkLoader.js(2 hunks)packages/sanity-suite/public/v3/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/index-local.html(2 hunks)packages/sanity-suite/public/v3/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/index-npm.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-local.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-local.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm.html(2 hunks)
✅ Files skipped from review due to trivial changes (18)
- examples/nextjs/hooks/sample-app/src/app/layout.tsx
- examples/nextjs/page-router/sample-app/src/pages/_document.tsx
- examples/nextjs/ts/sample-app/src/app/layout.tsx
- examples/v3-minimum-plugins/index.html
- examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html
- packages/sanity-suite/public/v3/manualLoadCall/index-local.html
- examples/nextjs/js/sample-app/src/app/layout.js
- examples/v3-legacy/index.html
- examples/v3/index.html
- examples/reactjs/ts/sample-app/public/index.html
- packages/sanity-suite/public/v3/index-cdn.html
- examples/v3-beacon/index.html
- packages/sanity-suite/public/v3/integrations/index-cdn.html
- examples/angular/sample-app/src/index.html
- examples/v3-legacy-minimum-plugins/index.html
- packages/sanity-suite/public/v3/manualLoadCall/index-npm.html
- examples/reactjs/hooks/sample-app/public/index.html
- packages/sanity-suite/public/v3/index-local.html
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,jsx,ts,tsx}`: Code must work in browsers AND service workers (no Node.js APIs)
**/*.{js,jsx,ts,tsx}: Code must work in browsers AND service workers (no Node.js APIs)
📄 Source: CodeRabbit Inference Engine (.cursor/rules/002-javascript-typescript.mdc)
List of files the instruction was applied to:
packages/analytics-js/__tests__/nativeSdkLoader.jsexamples/gatsby/sample-gatsby-site/gatsby-browser.js
🧠 Learnings (12)
📓 Common learnings
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-06-25T08:25:30.628Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-10-08T15:52:59.819Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-06-14T09:50:33.511Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/__tests__/components/capabilitiesManager/CapabilitiesManager.test.ts:58-58
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user saikumarrs is fine with using the `any` type in the `CapabilitiesManager.test.ts` file for mocking purposes.
packages/sanity-suite/public/v3/integrations/index-npm-bundled.html (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
packages/sanity-suite/public/v3/integrations/index-npm.html (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
packages/analytics-js/__tests__/nativeSdkLoader.js (17)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
packages/sanity-suite/public/v3/integrations/index-local.html (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
packages/sanity-suite/public/v3/index-npm-bundled.html (12)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
examples/reactjs/vite/sample-app/index.html (11)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
examples/gatsby/sample-gatsby-site/gatsby-browser.js (14)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
examples/reactjs/js/sample-app/public/index.html (11)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
packages/sanity-suite/public/v3/index-npm.html (12)
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
🪛 Biome (1.9.4)
examples/gatsby/sample-gatsby-site/gatsby-browser.js
[error] 5-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Security and code quality checks
- GitHub Check: Bundle size checks
- GitHub Check: Unit Tests and Lint
🔇 Additional comments (13)
packages/analytics-js/__tests__/nativeSdkLoader.js (2)
4-4: Version bump reflects new custom integration feature.The snippet version update to "3.1.0" correctly reflects the addition of custom integration support.
20-20: Correct addition of addCustomIntegration method to snippet.The new method is properly added to the methods array, ensuring it can be called and queued before the full SDK loads. This follows the standard pattern for exposing new SDK methods in the loading snippet.
packages/sanity-suite/public/v3/integrations/index-npm.html (1)
35-35: Consistent snippet updates for custom integration support.The version bump and addition of "addCustomIntegration" to the methods array are correctly implemented, maintaining consistency with the custom integration feature rollout across all snippet files.
Also applies to: 51-51
packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html (1)
35-35: Maintains snippet consistency across deployment scenarios.The identical changes ensure that the addCustomIntegration method is available consistently across all SDK loading contexts, which is essential for the new custom integration functionality.
Also applies to: 51-51
packages/sanity-suite/public/v3/integrations/index-npm-bundled.html (1)
35-35: Bundled version correctly updated for custom integrations.The changes maintain consistency with other snippet files, ensuring the bundled deployment scenario also supports the new addCustomIntegration method.
Also applies to: 51-51
packages/sanity-suite/public/v3/index-npm.html (1)
35-35: Completes consistent snippet updates across all test files.The version bump and method addition follow the established pattern, ensuring comprehensive support for the addCustomIntegration feature across all testing and example scenarios.
Also applies to: 51-51
packages/sanity-suite/public/v3/index-npm-bundled.html (1)
35-52:addCustomIntegrationcorrectly added to the buffered-methods list
The snippet version bump to3.1.0and the inclusion of"addCustomIntegration"keep the pre-SDK buffer in sync with the new public API. No functional or compatibility issues observed.packages/sanity-suite/public/v3/integrations/index-local.html (1)
35-52: Snippet update aligns with new custom-integration feature
Version constant and method array are updated consistently. Implementation remains idempotent and safe for multiple inclusions.examples/reactjs/js/sample-app/public/index.html (1)
31-48: React sample snippet reflects the new API surface
"addCustomIntegration"is now buffered, preventing race conditions before full SDK load. Looks good.packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html (1)
35-52: Manual-load page kept in sync with SDK changes
The extra buffered method and version bump are applied correctly; no further action required.examples/reactjs/vite/sample-app/index.html (1)
11-28: Vite sample updated without breaking the snippet contract
The added"addCustomIntegration"call is correctly listed and will queue as expected; change is fine.examples/gatsby/sample-gatsby-site/gatsby-browser.js (2)
6-6: LGTM! Version update and new custom integration method added correctly.The version bump to
3.1.0and addition of theaddCustomIntegrationmethod align perfectly with the PR objectives for adding custom device mode integrations support.Also applies to: 36-36
40-51: LGTM! Proper closure capture with IIFE pattern.The refactored method initialization using IIFE ensures proper closure capture of method names, which is a good practice for this type of dynamic method generation.
ceb3470 to
abe2578
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/gatsby/sample-gatsby-site/gatsby-browser.js (1)
4-5: Consider removing redundant strict mode directive.The strict mode directive is redundant in ES modules as they are automatically in strict mode. However, since this is an SDK snippet that may be used in various contexts, keeping it explicit might be intentional for broader compatibility.
-(function () { - 'use strict'; +(function () {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between ceb3470ec96ef49730f176649105bcc19f87e5a3 and abe257813a62275a6015ecff2db9bd66c2e0621a.
📒 Files selected for processing (69)
.github/workflows/check_pr_title.yml(1 hunks).github/workflows/deploy-beta.yml(0 hunks).github/workflows/deploy-npm.yml(7 hunks).github/workflows/deploy-sanity-suite.yml(1 hunks).github/workflows/deploy.yml(1 hunks).github/workflows/publish-new-release.yml(1 hunks).github/workflows/rollback.yml(1 hunks).github/workflows/security-code-quality-and-bundle-size-checks.yml(1 hunks).github/workflows/unit-tests-and-lint.yml(3 hunks)examples/angular/sample-app/src/index.html(2 hunks)examples/gatsby/sample-gatsby-site/gatsby-browser.js(1 hunks)examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html(1 hunks)examples/nextjs/hooks/sample-app/src/app/layout.tsx(2 hunks)examples/nextjs/js/sample-app/src/app/layout.js(2 hunks)examples/nextjs/page-router/sample-app/src/pages/_document.tsx(2 hunks)examples/nextjs/ts/sample-app/src/app/layout.tsx(2 hunks)examples/reactjs/hooks/sample-app/public/index.html(2 hunks)examples/reactjs/js/sample-app/public/index.html(2 hunks)examples/reactjs/ts/sample-app/public/index.html(2 hunks)examples/reactjs/vite/sample-app/index.html(2 hunks)examples/v3-beacon/index.html(2 hunks)examples/v3-legacy-minimum-plugins/index.html(2 hunks)examples/v3-legacy/index.html(2 hunks)examples/v3-minimum-plugins/index.html(2 hunks)examples/v3/index.html(2 hunks)packages/analytics-js-common/.size-limit.js(1 hunks)packages/analytics-js-common/__tests__/utilities/destinations.test.ts(1 hunks)packages/analytics-js-common/src/types/ApplicationState.ts(2 hunks)packages/analytics-js-common/src/types/Destination.ts(2 hunks)packages/analytics-js-common/src/types/Event.ts(1 hunks)packages/analytics-js-common/src/types/IRudderAnalytics.ts(2 hunks)packages/analytics-js-common/src/types/Logger.ts(1 hunks)packages/analytics-js-common/src/utilities/destinations.ts(2 hunks)packages/analytics-js-plugins/.size-limit.mjs(1 hunks)packages/analytics-js-plugins/__mocks__/state.ts(2 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts(4 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts(19 hunks)packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts(9 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/index.ts(4 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts(2 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/types.ts(0 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts(8 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts(1 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts(2 hunks)packages/analytics-js/__tests__/app/RudderAnalytics.test.ts(4 hunks)packages/analytics-js/__tests__/components/core/Analytics.test.ts(17 hunks)packages/analytics-js/__tests__/nativeSdkLoader.js(2 hunks)packages/analytics-js/public/index.html(3 hunks)packages/analytics-js/src/app/RudderAnalytics.ts(5 hunks)packages/analytics-js/src/browser.ts(2 hunks)packages/analytics-js/src/components/configManager/util/commonUtil.ts(2 hunks)packages/analytics-js/src/components/core/Analytics.ts(3 hunks)packages/analytics-js/src/components/core/IAnalytics.ts(2 hunks)packages/analytics-js/src/constants/logMessages.ts(2 hunks)packages/analytics-js/src/index.ts(1 hunks)packages/analytics-js/src/state/slices/lifecycle.ts(1 hunks)packages/loading-scripts/src/index.ts(1 hunks)packages/sanity-suite/public/v3/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/index-local.html(2 hunks)packages/sanity-suite/public/v3/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/index-npm.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-local.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-local.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm.html(2 hunks)
💤 Files with no reviewable changes (2)
- .github/workflows/deploy-beta.yml
- packages/analytics-js-plugins/src/deviceModeDestinations/types.ts
✅ Files skipped from review due to trivial changes (1)
- packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html
🚧 Files skipped from review as they are similar to previous changes (61)
- examples/nextjs/js/sample-app/src/app/layout.js
- packages/analytics-js-common/src/types/Event.ts
- packages/analytics-js-common/.size-limit.js
- .github/workflows/deploy.yml
- examples/nextjs/ts/sample-app/src/app/layout.tsx
- examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html
- packages/analytics-js-plugins/.size-limit.mjs
- .github/workflows/security-code-quality-and-bundle-size-checks.yml
- packages/sanity-suite/public/v3/manualLoadCall/index-local.html
- .github/workflows/deploy-sanity-suite.yml
- examples/v3-minimum-plugins/index.html
- .github/workflows/check_pr_title.yml
- .github/workflows/unit-tests-and-lint.yml
- examples/angular/sample-app/src/index.html
- .github/workflows/rollback.yml
- examples/reactjs/js/sample-app/public/index.html
- packages/sanity-suite/public/v3/index-local.html
- examples/v3-legacy-minimum-plugins/index.html
- packages/sanity-suite/public/v3/index-npm-bundled.html
- packages/sanity-suite/public/v3/index-cdn.html
- packages/analytics-js/src/browser.ts
- examples/v3/index.html
- examples/nextjs/page-router/sample-app/src/pages/_document.tsx
- packages/analytics-js/src/constants/logMessages.ts
- examples/reactjs/ts/sample-app/public/index.html
- examples/nextjs/hooks/sample-app/src/app/layout.tsx
- packages/analytics-js-common/tests/utilities/destinations.test.ts
- examples/v3-legacy/index.html
- packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html
- examples/v3-beacon/index.html
- packages/analytics-js/src/components/core/IAnalytics.ts
- packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts
- packages/sanity-suite/public/v3/integrations/index-cdn.html
- packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts
- packages/analytics-js-common/src/types/Logger.ts
- packages/sanity-suite/public/v3/manualLoadCall/index-npm.html
- packages/loading-scripts/src/index.ts
- examples/reactjs/hooks/sample-app/public/index.html
- .github/workflows/publish-new-release.yml
- packages/analytics-js-common/src/utilities/destinations.ts
- examples/reactjs/vite/sample-app/index.html
- packages/analytics-js/tests/nativeSdkLoader.js
- packages/analytics-js/src/state/slices/lifecycle.ts
- packages/analytics-js-common/src/types/ApplicationState.ts
- packages/analytics-js-plugins/tests/nativeDestinationQueue/utilities.test.ts
- packages/sanity-suite/public/v3/integrations/index-local.html
- packages/analytics-js-plugins/mocks/state.ts
- packages/sanity-suite/public/v3/integrations/index-npm.html
- .github/workflows/deploy-npm.yml
- packages/sanity-suite/public/v3/integrations/index-npm-bundled.html
- packages/analytics-js/src/index.ts
- packages/analytics-js-plugins/src/deviceModeDestinations/index.ts
- packages/sanity-suite/public/v3/index-npm.html
- packages/analytics-js/src/app/RudderAnalytics.ts
- packages/analytics-js/src/components/configManager/util/commonUtil.ts
- packages/analytics-js/public/index.html
- packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts
- packages/analytics-js-common/src/types/Destination.ts
- packages/analytics-js-common/src/types/IRudderAnalytics.ts
- packages/analytics-js/src/components/core/Analytics.ts
- packages/analytics-js/tests/components/core/Analytics.test.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,jsx,ts,tsx}`: Code must work in browsers AND service workers (no Node.js APIs)
**/*.{js,jsx,ts,tsx}: Code must work in browsers AND service workers (no Node.js APIs)
📄 Source: CodeRabbit Inference Engine (.cursor/rules/002-javascript-typescript.mdc)
List of files the instruction was applied to:
packages/analytics-js/__tests__/app/RudderAnalytics.test.tspackages/analytics-js-plugins/src/deviceModeDestinations/utils.tspackages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.tspackages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.tsexamples/gatsby/sample-gatsby-site/gatsby-browser.js
🧠 Learnings (6)
📓 Common learnings
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-10-08T15:52:59.819Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-06-25T08:25:30.628Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-06-14T09:50:33.511Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/__tests__/components/capabilitiesManager/CapabilitiesManager.test.ts:58-58
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user saikumarrs is fine with using the `any` type in the `CapabilitiesManager.test.ts` file for mocking purposes.
packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService is initialized in its constructor, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (23)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript sample apps, error messages often refer to environment variables like `WRITE_KEY` and `DATAPLANE_URL` in the repository root's `.env` file, rather than the example-specific environment variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script copies these values from the root .env file to each example's .env file, replacing placeholders accordingly.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript examples, error messages correctly reference the root-level environment variables (`WRITE_KEY` and `DATAPLANE_URL`) rather than framework-specific variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script reads these variables from the root `.env` file and propagates them to each example's configuration, replacing placeholders like `${WRITE_KEY}` and `${DATAPLANE_URL}` with actual values.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:9-27
Timestamp: 2024-10-28T08:14:00.846Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `stringifyData` function assumes that data is sanitized beforehand, so additional error handling within this function is not necessary.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (41)
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js-plugins/tests/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of IHttpClient in type assertions within the file packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts has been corrected by the user.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the findOtherQueues function in packages/analytics-js-common/src/utilities/retryQueue/utilities.ts is no longer applicable.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the issue regarding inconsistent error handling approaches in getDMTDeliveryPayload is no longer valid.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/tests/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (browser.test.js), the tests no longer rely on appVersion, so including appVersion in the mocked navigator object is unnecessary.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the isReady function in packages/analytics-js-integrations/src/integrations/Sprig/browser.js are not required.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in packages/analytics-js-integrations/src/integrations/Sprig/browser.js are not required.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js/tests/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in packages/analytics-js/__tests__/nativeSdkLoader.js is a standard part of the SDK, and no changes are desired on it.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths /packages/analytics-js-integrations/scripts/, /packages/analytics-js-common/src/types/Integration.ts, /packages/analytics-v1.1/src/utils/IntegrationsData.js, /packages/sanity-suite/public/v1.1/integrations/, and /packages/sanity-suite/public/v3/integrations/ do not need ownership assignment changes in the CODEOWNERS file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js/tests/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In packages/analytics-js/__tests__/components/utilities/consent.test.ts, the relative import path ../../../src/state correctly refers to the index.ts file in the /state directory.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/tests/components/userSessionManager/UserSessionManager.test.ts:1692-1692
Timestamp: 2024-10-08T15:52:59.819Z
Learning: When updating test suites, changes to the domain (e.g., from 'example.com' to 'dummy.dataplane.host.com') are only necessary for tests that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the delete operator for performance reasons. Instead, set the value to undefined in the packages/analytics-js-common/src/utilities/eventMethodOverloads.ts file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the delete operator for performance reasons. Instead, set the value to undefined in the packages/analytics-js-common/src/utilities/eventMethodOverloads.ts file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The delete operator in packages/analytics-js-common/src/utilities/eventMethodOverloads.ts should be replaced with setting the value to undefined to avoid performance issues.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The delete operator in packages/analytics-js-common/src/utilities/eventMethodOverloads.ts should be replaced with setting the value to undefined to avoid performance issues.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In packages/analytics-js-common/src/utilities/eventMethodOverloads.ts, the delete operator has been replaced with setting the value to undefined for better performance.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In packages/analytics-js-common/src/utilities/eventMethodOverloads.ts, the delete operator has been replaced with setting the value to undefined for better performance.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2309
File: packages/analytics-js-plugins/tests/deviceModeDestinations/utils.test.ts:2402-2402
Timestamp: 2025-06-30T10:02:01.367Z
Learning: Performance optimizations regarding the delete operator (replacing with undefined assignment) are not a concern for test files and should not be suggested in test code contexts.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with globalThis in packages/analytics-js-common/src/utilities/page.ts is handled elsewhere in the codebase as per user saikumarrs.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with globalThis in packages/analytics-js-common/src/utilities/page.ts is handled elsewhere in the codebase as per user saikumarrs.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-common/src/utilities/retryQueue/RetryQueue.ts:0-0
Timestamp: 2024-11-08T13:22:54.185Z
Learning: Code coverage issues should be ignored in future code reviews.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/fixtures/msw.handlers.ts:86-86
Timestamp: 2024-10-08T15:52:59.819Z
Learning: When updating test files to replace 'example.com' with 'dummy.dataplane.host.com', note that the change is only needed for test suites that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/fixtures/msw.handlers.ts:86-86
Timestamp: 2024-09-27T10:26:32.458Z
Learning: When updating test files to replace 'example.com' with 'dummy.dataplane.host.com', note that the change is only needed for test suites that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js-integrations/tests/integrations/SpotifyPixel/browser.test.js:249-260
Timestamp: 2024-07-27T07:02:57.329Z
Learning: Inconsistencies in data structures such as line_items within test scripts of the SpotifyPixel and Podsights integrations can be ignored as per user guidance, as they do not necessarily reflect production code requirements.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1999
File: packages/analytics-js/tests/services/HttpClient/HttpClient.test.ts:18-18
Timestamp: 2025-01-24T10:29:23.777Z
Learning: Hard-coded dummy credentials (like 'dummyWriteKey', 'rawHeaderValue') in test files are acceptable as they are not real sensitive values and improve test readability.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js file, ignore the assignment pattern let e = (window.rudderanalytics = window.rudderanalytics || []); as it is a standard snippet.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
</retrieved_learning>
<retrieved_learning>
Learnt from: david8z
PR: #2037
File: packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js:120-121
Timestamp: 2025-02-10T13:32:41.446Z
Learning: In Facebook Pixel integration, the isReady method should always check for actual pixel initialization state using fbq.getState().pixels, even when skipInitialization is true, as the pixel might be initialized by other tools.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the utility function getDeliveryPayload cannot fail because all problematic fields are cleaned up prior to this step.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In packages/analytics-js/src/app/RudderAnalytics.ts, the constructor of the RudderAnalytics class intentionally returns RudderAnalytics.globalSingleton to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the new operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In packages/analytics-js/src/components/core/Analytics.ts, inputs to the clone function are sanitized prior, so error handling for clone operations is not needed.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
</retrieved_learning>
<retrieved_learning>
Learnt from: MoumitaM
PR: #1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The trackPageLifecycleEvents method in packages/analytics-js/src/app/RudderAnalytics.ts does not require refactoring as the current implementation is preferred.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-plugins/src/deviceModeTransformation/utilities.ts:159-159
Timestamp: 2024-11-09T05:58:54.124Z
Learning: In this codebase, when catching errors, it's acceptable to type caught errors as any because errorHandler?.onError can handle all kinds of errors.
</retrieved_learning>
<retrieved_learning>
Learnt from: ItsSudip
PR: #1684
File: packages/analytics-js-integrations/tests/utils/commonUtils.test.js:355-357
Timestamp: 2024-06-10T07:43:52.149Z
Learning: The isBlank function in commonUtils.test.js is expected to return false when the input is null, as per the specific implementation and requirement of the project.
</retrieved_learning>
<retrieved_learning>
Learnt from: ItsSudip
PR: #1684
File: packages/analytics-js-integrations/tests/utils/commonUtils.test.js:355-357
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The isBlank function in commonUtils.test.js is expected to return false when the input is null, as per the specific implementation and requirement of the project.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function onError in packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the getDeliveryPayload function does not require additional error handling for stringification failures.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2246
File: packages/analytics-js-plugins/tests/deviceModeTransformation/utilities.test.ts:349-353
Timestamp: 2025-06-02T14:48:20.980Z
Learning: In device mode transformation utilities tests, the groupingHash validation was intentionally left out of the exception handling test case for JSON parsing errors.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1730
File: packages/analytics-js/tests/components/capabilitiesManager/CapabilitiesManager.test.ts:129-129
Timestamp: 2024-07-27T07:02:57.329Z
Learning: When testing code that relies on imported constants, ensure the mock is applied correctly before the test cases run to avoid issues with timing or execution flow.
</retrieved_learning>
<retrieved_learning>
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
</retrieved_learning>
examples/gatsby/sample-gatsby-site/gatsby-browser.js (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
🧬 Code Graph Analysis (1)
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (4)
packages/analytics-js-plugins/__mocks__/state.ts (1)
state(221-221)packages/analytics-js-common/src/types/IRudderAnalytics.ts (1)
RSACustomIntegration(229-291)packages/analytics-js/src/index.ts (1)
RSACustomIntegration(22-22)packages/analytics-js-common/src/types/Destination.ts (1)
Destination(140-152)
🪛 Biome (1.9.4)
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts
[error] 2402-2402: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
examples/gatsby/sample-gatsby-site/gatsby-browser.js
[error] 5-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Security and code quality checks
- GitHub Check: Bundle size checks
- GitHub Check: Unit Tests and Lint
- GitHub Check: Check PR title
🔇 Additional comments (32)
examples/gatsby/sample-gatsby-site/gatsby-browser.js (4)
6-6: LGTM: Version update aligns with custom integration support.The version update from "3.0.60" to "3.1.0" correctly reflects the new custom integration capabilities being added.
22-36: Excellent addition ofaddCustomIntegrationmethod.The new
addCustomIntegrationmethod perfectly aligns with the PR objective of adding custom device mode integrations support. The method is properly positioned in the SDK methods array.
40-51: Great improvement: Proper closure capture in method assignment.The refactored method assignment using an IIFE correctly captures the method name in the closure, preventing all methods from pointing to the last method in the loop. This is a significant improvement over the previous implementation.
7-37: Good code style standardization.The consistent use of single quotes and proper formatting improves code readability and maintains style consistency throughout the snippet.
packages/analytics-js/__tests__/app/RudderAnalytics.test.ts (4)
2-2: LGTM: Type import for custom integration tests.The import of
RSACustomIntegrationtype is correctly added to support the new test cases for custom integration functionality.
60-62: LGTM: Test modification maintains existing behavior verification.The test correctly verifies that creating a new
RudderAnalyticsinstance returns the existing global singleton, maintaining the singleton pattern behavior.
742-784: LGTM: Comprehensive test coverage for addCustomIntegration method.The tests correctly verify:
- Proper forwarding of integration name and object to the analytics instance
- Error event dispatching when exceptions occur during the call
- Mock custom integration structure follows the expected
RSACustomIntegrationinterfaceThe test structure follows the established pattern used for other methods in this file.
953-1132: LGTM: Excellent comprehensive test coverage for createSafeAnalyticsInstance.The test suite thoroughly covers all critical aspects:
- Creation and storage of safe analytics instance in global state
- Verification that all required methods are bound correctly
- Context preservation when methods are invoked through the safe instance
- Automatic creation during RudderAnalytics construction
- Proper method binding and forwarding to the original instance
The tests demonstrate good practices with proper setup/cleanup, comprehensive assertions, and edge case coverage. The method verification approach using spies effectively validates the binding behavior.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (4)
9-9: LGTM: Type import for custom integration tests.The import of
RSACustomIntegrationtype is correctly added to support the new custom integration test functionality.
25-25: LGTM: Mock mapping extension for conflict detection tests.Adding 'VWO' to the mock destination mapping is necessary for testing name conflict detection in the custom integration validation logic.
386-469: LGTM: Important test for custom integration preservation.This test verifies a critical behavior: ensuring that existing custom integrations in the active destinations are preserved when
setActiveDestinationsappends newly configured destinations. The test properly:
- Sets up pre-existing custom integrations in the active destinations
- Verifies they are preserved alongside newly added configured destinations
- Uses realistic mock destination structures
This behavior is essential for the custom integration feature to work correctly.
1164-1440: LGTM: Exceptional comprehensive test coverage for addCustomIntegration.This test suite provides outstanding coverage of the
addCustomIntegrationfunctionality:Positive test cases:
- Successful addition with proper destination creation
- Handling minimal integrations (only
isReadymethod)- Multiple custom integrations support
- Preservation of existing active destinations
Validation and error handling:
- Empty/whitespace-only integration names
- Name conflicts with supported destinations and existing custom integrations
- Invalid integration format (missing required
isReadymethod)Property verification:
- Correct destination properties (ID generation, flags, configuration)
- Integration name sanitization in
userFriendlyId- Method binding verification
Edge cases:
- Null/undefined state values
- Complex integration names with special characters
The tests follow excellent practices with proper setup, comprehensive assertions, and realistic mock data. The extensive validation coverage will help ensure the robustness of the custom integration feature.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (15)
9-9: Type renamed to reflect terminology change.The type has been correctly updated from
DeviceModeDestinationtoDeviceModeIntegrationto align with the consistent terminology change throughout the codebase.
12-17: New type imports added for custom integration support.The new imports for
ILogger,RSALogger,IntegrationRSAnalytics,RSACustomIntegration, andRSAnalyticsare correctly imported and will be used in the new custom integration functionality.
24-30: Utility imports added for validation logic.The imported utility functions (
isBoolean,isDefined,isNullOrUndefined,isString,isUndefined) are appropriate for the validation logic that will be used in the custom integration functions.
31-33: Additional imports for custom integration functionality.The imports for
RSAEvent,generateUUID, andgetDestinationUserFriendlyIdare correctly added to support the new custom integration creation functionality.
44-46: Error message imports for custom integration validation.The error message imports for custom integration validation are properly added and will be used in the validation functions.
77-82: Function renamed to reflect terminology change.The function has been correctly renamed from
createDestinationInstancetocreateIntegrationInstanceand the return type updated toDeviceModeIntegration. This aligns with the consistent terminology changes throughout the codebase.
83-89: Simplified analytics instance creation using safe instance from state.The analytics instance creation has been simplified by using the
safeAnalyticsInstancefrom state instead of manually constructing the analytics methods. This is a cleaner approach that reduces code duplication.
92-100: Variable renamed to reflect integration terminology.The variable has been correctly renamed from
destinationtointegrationto maintain consistency with the terminology changes.
105-105: Property access updated to use integration instead of instance.The property access has been correctly updated from
dest.instancetodest.integrationto align with the data structure changes.
134-138: Property access updated consistently.The property access has been correctly updated from
dest.instancetodest.integrationin both the condition check and the method call.
162-168: Integration initialization logic updated.The integration initialization logic has been properly updated:
- Variable renamed to
integrationwith correct type- Uses
isUndefinedcheck for better type safety- Calls the renamed function
createIntegrationInstance- Updates the destination's integration property correctly
227-227: Function renamed for grammatical correctness.The function has been correctly renamed from
filterDisabledDestinationtofilterDisabledDestinationsto reflect that it filters multiple destinations (plural form).Also applies to: 274-274, 282-282
341-387: Custom integration validation function implemented correctly.The
validateCustomIntegrationfunction provides comprehensive validation:
- Validates name is a non-empty string
- Checks for conflicts with existing destinations and built-in integrations
- Validates that the integration object has the required
isReadymethod- Validates that optional methods (if present) are functions
- Provides appropriate error logging for each validation failure
The validation logic is thorough and follows good practices for input validation.
389-463: Custom integration destination creation function implemented correctly.The
createCustomIntegrationDestinationfunction properly creates a destination object for custom integrations:
- Generates a unique ID using UUID
- Creates a scoped logger for the integration
- Wraps the custom integration methods to provide consistent API
- Sets appropriate default configuration values
- Marks the destination as a custom integration
The function follows the existing patterns in the codebase and provides a clean interface for custom integrations.
475-476: New functions properly exported.The new functions
validateCustomIntegrationandcreateCustomIntegrationDestinationare correctly added to the exports, making them available for use in other modules.packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (5)
25-31: Well-implemented UUID mocking for predictable testing.The UUID mocking setup is correctly positioned before the import to ensure proper module interception, which will enable consistent testing of unique ID generation in the custom integration creation tests.
109-170: Property updates correctly align with new type definitions.The test updates from
instance.isLoadedtointegration.isReadyproperly reflect the type system changes in the codebase, maintaining test consistency while adapting to the new integration interface.
172-316: Excellent comprehensive testing of analytics method forwarding.The updated test suite thoroughly validates that all analytics methods (page, track, identify, group, alias, and getters) are properly forwarded from the integration instance to the safe analytics instance. This ensures the integration layer works correctly and provides the expected API to custom integrations.
1446-1887: Outstanding comprehensive validation test coverage.The
validateCustomIntegrationtest suite provides excellent coverage of all validation scenarios including:
- Name validation for different data types and edge cases
- Conflict detection with existing destinations and built-in integrations
- Integration object structure validation for required and optional methods
- Proper error logging verification
This thorough testing ensures robust validation of custom integrations before they're added to the system.
1889-2529: Exceptional test coverage with realistic implementation example.The
createCustomIntegrationDestinationtest suite is exemplary, providing:
- Thorough testing of destination creation and configuration
- Comprehensive method wrapping verification with analytics instance and logger
- Realistic integration implementation test that demonstrates practical usage patterns
- Proper logger cloning and scoping verification
- Complete coverage of all event types and edge cases
The realistic implementation test (lines 2198-2403) is particularly valuable as it demonstrates how custom integrations would actually interact with the analytics and logger APIs in practice.
abe2578 to
1a68f20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (1)
2650-2650: Test cleanup using delete operator is acceptable.Based on previous feedback, performance optimizations like avoiding the
deleteoperator are not a concern for test files. The cleanup of global test state usingdeleteis appropriate here.
🧹 Nitpick comments (1)
examples/gatsby/sample-gatsby-site/gatsby-browser.js (1)
5-5: Remove redundant 'use strict' directive.The 'use strict' directive is unnecessary in JavaScript modules as they are automatically in strict mode.
- 'use strict';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between abe257813a62275a6015ecff2db9bd66c2e0621a and 1a68f20fb050d4471592bb9a69dd10d0cfc0cc75.
📒 Files selected for processing (69)
.github/workflows/check_pr_title.yml(1 hunks).github/workflows/deploy-beta.yml(0 hunks).github/workflows/deploy-npm.yml(7 hunks).github/workflows/deploy-sanity-suite.yml(1 hunks).github/workflows/deploy.yml(1 hunks).github/workflows/publish-new-release.yml(1 hunks).github/workflows/rollback.yml(1 hunks).github/workflows/security-code-quality-and-bundle-size-checks.yml(1 hunks).github/workflows/unit-tests-and-lint.yml(1 hunks)examples/angular/sample-app/src/index.html(2 hunks)examples/gatsby/sample-gatsby-site/gatsby-browser.js(1 hunks)examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html(1 hunks)examples/nextjs/hooks/sample-app/src/app/layout.tsx(2 hunks)examples/nextjs/js/sample-app/src/app/layout.js(2 hunks)examples/nextjs/page-router/sample-app/src/pages/_document.tsx(2 hunks)examples/nextjs/ts/sample-app/src/app/layout.tsx(2 hunks)examples/reactjs/hooks/sample-app/public/index.html(2 hunks)examples/reactjs/js/sample-app/public/index.html(2 hunks)examples/reactjs/ts/sample-app/public/index.html(2 hunks)examples/reactjs/vite/sample-app/index.html(2 hunks)examples/v3-beacon/index.html(2 hunks)examples/v3-legacy-minimum-plugins/index.html(2 hunks)examples/v3-legacy/index.html(2 hunks)examples/v3-minimum-plugins/index.html(2 hunks)examples/v3/index.html(2 hunks)packages/analytics-js-common/.size-limit.js(1 hunks)packages/analytics-js-common/__tests__/utilities/destinations.test.ts(1 hunks)packages/analytics-js-common/src/types/ApplicationState.ts(2 hunks)packages/analytics-js-common/src/types/Destination.ts(2 hunks)packages/analytics-js-common/src/types/Event.ts(1 hunks)packages/analytics-js-common/src/types/IRudderAnalytics.ts(2 hunks)packages/analytics-js-common/src/types/Logger.ts(1 hunks)packages/analytics-js-common/src/utilities/destinations.ts(2 hunks)packages/analytics-js-plugins/.size-limit.mjs(1 hunks)packages/analytics-js-plugins/__mocks__/state.ts(2 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts(4 hunks)packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts(19 hunks)packages/analytics-js-plugins/__tests__/nativeDestinationQueue/utilities.test.ts(8 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/index.ts(4 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts(2 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/types.ts(0 hunks)packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts(8 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts(1 hunks)packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts(2 hunks)packages/analytics-js/__tests__/app/RudderAnalytics.test.ts(4 hunks)packages/analytics-js/__tests__/components/core/Analytics.test.ts(17 hunks)packages/analytics-js/__tests__/nativeSdkLoader.js(2 hunks)packages/analytics-js/public/index.html(3 hunks)packages/analytics-js/src/app/RudderAnalytics.ts(5 hunks)packages/analytics-js/src/browser.ts(2 hunks)packages/analytics-js/src/components/configManager/util/commonUtil.ts(2 hunks)packages/analytics-js/src/components/core/Analytics.ts(3 hunks)packages/analytics-js/src/components/core/IAnalytics.ts(2 hunks)packages/analytics-js/src/constants/logMessages.ts(2 hunks)packages/analytics-js/src/index.ts(1 hunks)packages/analytics-js/src/state/slices/lifecycle.ts(1 hunks)packages/loading-scripts/src/index.ts(1 hunks)packages/sanity-suite/public/v3/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/index-local.html(2 hunks)packages/sanity-suite/public/v3/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/index-npm.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-local.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/integrations/index-npm.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-local.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html(2 hunks)packages/sanity-suite/public/v3/manualLoadCall/index-npm.html(2 hunks)
💤 Files with no reviewable changes (2)
- packages/analytics-js-plugins/src/deviceModeDestinations/types.ts
- .github/workflows/deploy-beta.yml
🚧 Files skipped from review as they are similar to previous changes (63)
- examples/nextjs/js/sample-app/src/app/layout.js
- packages/analytics-js-common/src/types/Event.ts
- examples/nextjs/ts/sample-app/src/app/layout.tsx
- packages/analytics-js-common/.size-limit.js
- examples/nextjs/hooks/sample-app/src/app/layout.tsx
- examples/nextjs/page-router/sample-app/src/pages/_document.tsx
- packages/analytics-js/src/browser.ts
- packages/sanity-suite/public/v3/index-cdn.html
- packages/analytics-js/tests/nativeSdkLoader.js
- examples/reactjs/hooks/sample-app/public/index.html
- examples/v3-legacy-minimum-plugins/index.html
- packages/sanity-suite/public/v3/index-npm.html
- packages/analytics-js-plugins/.size-limit.mjs
- .github/workflows/deploy.yml
- packages/sanity-suite/public/v3/manualLoadCall/index-cdn.html
- .github/workflows/rollback.yml
- .github/workflows/deploy-sanity-suite.yml
- packages/loading-scripts/src/index.ts
- packages/analytics-js/src/state/slices/lifecycle.ts
- packages/analytics-js-common/src/types/ApplicationState.ts
- packages/analytics-js-common/src/types/Logger.ts
- examples/v3-beacon/index.html
- examples/v3-legacy/index.html
- examples/v3-minimum-plugins/index.html
- examples/angular/sample-app/src/index.html
- .github/workflows/publish-new-release.yml
- examples/integrations/Ninetailed/sample-apps/app-using-v3-cdn/public/index.html
- packages/analytics-js/src/constants/logMessages.ts
- packages/sanity-suite/public/v3/manualLoadCall/index-npm.html
- examples/v3/index.html
- packages/sanity-suite/public/v3/index-npm-bundled.html
- packages/analytics-js-plugins/src/nativeDestinationQueue/utilities.ts
- examples/reactjs/js/sample-app/public/index.html
- examples/reactjs/vite/sample-app/index.html
- .github/workflows/check_pr_title.yml
- packages/analytics-js-plugins/src/nativeDestinationQueue/logMessages.ts
- packages/analytics-js-common/src/utilities/destinations.ts
- packages/analytics-js-plugins/tests/nativeDestinationQueue/utilities.test.ts
- packages/sanity-suite/public/v3/integrations/index-npm-bundled.html
- packages/analytics-js/src/components/configManager/util/commonUtil.ts
- packages/sanity-suite/public/v3/manualLoadCall/index-local.html
- packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html
- examples/reactjs/ts/sample-app/public/index.html
- .github/workflows/unit-tests-and-lint.yml
- packages/analytics-js/src/components/core/Analytics.ts
- .github/workflows/security-code-quality-and-bundle-size-checks.yml
- packages/sanity-suite/public/v3/index-local.html
- packages/analytics-js-plugins/src/deviceModeDestinations/index.ts
- packages/analytics-js/src/index.ts
- packages/sanity-suite/public/v3/integrations/index-npm.html
- packages/sanity-suite/public/v3/integrations/index-cdn.html
- packages/analytics-js-plugins/src/deviceModeDestinations/logMessages.ts
- packages/analytics-js-common/tests/utilities/destinations.test.ts
- packages/analytics-js/public/index.html
- packages/analytics-js/src/components/core/IAnalytics.ts
- packages/sanity-suite/public/v3/integrations/index-local.html
- packages/analytics-js/src/app/RudderAnalytics.ts
- packages/analytics-js/tests/app/RudderAnalytics.test.ts
- packages/analytics-js-plugins/mocks/state.ts
- .github/workflows/deploy-npm.yml
- packages/analytics-js-common/src/types/Destination.ts
- packages/analytics-js-common/src/types/IRudderAnalytics.ts
- packages/analytics-js/tests/components/core/Analytics.test.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- .cursor/rules/002-javascript-typescript.mdc
🧠 Learnings (5)
📓 Common learnings
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-06-25T08:25:30.628Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1759
File: packages/analytics-js-cookies/rollup.config.mjs:1-20
Timestamp: 2024-10-08T15:52:59.819Z
Learning: User `saikumarrs` prefers to temporarily accept missing dependencies in `package.json` for `rollup.config.mjs` in the context of PR 1759 without immediate correction.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1718
File: packages/analytics-js-service-worker/src/utilities.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `setImmediate` function in the `analytics-js-service-worker` package was updated to use `Promise.resolve().then(callback)` instead of `process.nextTick` to ensure compatibility with the service worker environment.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: sanpj2292
PR: rudderlabs/rudder-sdk-js#1948
File: packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js:59-65
Timestamp: 2024-11-25T11:33:39.706Z
Learning: In the Microsoft Clarity integration (`packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js`), adding validation or sanitization of trait values before sending them to Microsoft Clarity's SDK is not required at this time.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-service-worker/README.md:0-0
Timestamp: 2024-06-14T09:50:33.511Z
Learning: saikumarrs prefers simplified language in documentation, avoiding redundant phrases.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/__tests__/components/capabilitiesManager/CapabilitiesManager.test.ts:58-58
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user saikumarrs is fine with using the `any` type in the `CapabilitiesManager.test.ts` file for mocking purposes.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (24)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-plugins/src/xhrQueue/index.ts:34-34
Timestamp: 2024-11-06T16:32:46.257Z
Learning: The deprecated plugins have been removed from the `PluginName` type, so the explicit `PluginName` type annotation is no longer necessary in `packages/analytics-js-plugins/src/xhrQueue/index.ts`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In `packages/analytics-js-common/src/utilities/eventMethodOverloads.ts`, the `delete` operator has been replaced with setting the value to `undefined` for better performance.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/time.ts:19-29
Timestamp: 2024-11-09T06:16:23.609Z
Learning: In the file `packages/analytics-js-common/src/utilities/time.ts`, prefer using the regex-based implementation for timezone detection in the `getTimezone()` function instead of `Intl.DateTimeFormat().resolvedOptions().timeZone`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/components/utilities/url.ts:10-10
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `removeTrailingSlashes` function in `packages/analytics-js/src/components/utilities/url.ts` now uses optional chaining for better safety and readability.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the utility function `getDeliveryPayload` cannot fail because all problematic fields are cleaned up prior to this step.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/services/Logger/Logger.ts:14-14
Timestamp: 2024-10-16T13:00:25.657Z
Learning: In 'packages/analytics-js/src/services/Logger/Logger.ts', changing `DEFAULT_LOG_LEVEL` from `'ERROR'` to `'LOG'` is intentional.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2296
File: packages/analytics-js-common/src/constants/errors.ts:5-8
Timestamp: 2025-06-19T05:04:05.868Z
Learning: In the RudderStack SDK JS project, when creating regex patterns for error message filtering, prefer flexibility over strictness when the exact set of possible values is unknown. For example, in error message patterns like `/Unable to load \(.*\) the script with the id .*/`, using `(.*)` is preferred over specific alternations like `(plugin|integration)` to ensure no legitimate error messages are missed during filtering.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1730
File: packages/analytics-js/src/constants/logMessages.ts:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `DATA_PLANE_URL_VALIDATION_ERROR` function in `packages/analytics-js/src/constants/logMessages.ts` should use `string | undefined` instead of `any` for the `dataPlaneUrl` parameter to enhance type safety.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript examples, error messages correctly reference the root-level environment variables (`WRITE_KEY` and `DATAPLANE_URL`) rather than framework-specific variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script reads these variables from the root `.env` file and propagates them to each example's configuration, replacing placeholders like `${WRITE_KEY}` and `${DATAPLANE_URL}` with actual values.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/nextjs/page-router/sample-app/src/useRudderAnalytics.ts:29-39
Timestamp: 2025-04-10T08:10:26.854Z
Learning: In the RudderStack SDK JavaScript sample apps, error messages often refer to environment variables like `WRITE_KEY` and `DATAPLANE_URL` in the repository root's `.env` file, rather than the example-specific environment variables (like `NEXT_PUBLIC_RUDDERSTACK_WRITE_KEY`). This is because the `setup-examples-env.sh` script copies these values from the root .env file to each example's .env file, replacing placeholders accordingly.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function `onError` in `packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts` is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-common/src/utilities/json.ts:9-27
Timestamp: 2024-10-28T08:14:00.846Z
Learning: In `packages/analytics-js-common/src/utilities/json.ts`, the `stringifyData` function assumes that data is sanitized beforehand, so additional error handling within this function is not necessary.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (43)
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js-plugins/tests/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of IHttpClient in type assertions within the file packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts has been corrected by the user.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the findOtherQueues function in packages/analytics-js-common/src/utilities/retryQueue/utilities.ts is no longer applicable.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the issue regarding inconsistent error handling approaches in getDMTDeliveryPayload is no longer valid.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/tests/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (browser.test.js), the tests no longer rely on appVersion, so including appVersion in the mocked navigator object is unnecessary.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the isReady function in packages/analytics-js-integrations/src/integrations/Sprig/browser.js are not required.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in packages/analytics-js-integrations/src/integrations/Sprig/browser.js are not required.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js/tests/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in packages/analytics-js/__tests__/nativeSdkLoader.js is a standard part of the SDK, and no changes are desired on it.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths /packages/analytics-js-integrations/scripts/, /packages/analytics-js-common/src/types/Integration.ts, /packages/analytics-v1.1/src/utils/IntegrationsData.js, /packages/sanity-suite/public/v1.1/integrations/, and /packages/sanity-suite/public/v3/integrations/ do not need ownership assignment changes in the CODEOWNERS file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js/tests/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In packages/analytics-js/__tests__/components/utilities/consent.test.ts, the relative import path ../../../src/state correctly refers to the index.ts file in the /state directory.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/tests/components/userSessionManager/UserSessionManager.test.ts:1692-1692
Timestamp: 2024-10-08T15:52:59.819Z
Learning: When updating test suites, changes to the domain (e.g., from 'example.com' to 'dummy.dataplane.host.com') are only necessary for tests that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:39.648Z
Learning: Avoid using the delete operator for performance reasons. Instead, set the value to undefined in the packages/analytics-js-common/src/utilities/eventMethodOverloads.ts file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: Avoid using the delete operator for performance reasons. Instead, set the value to undefined in the packages/analytics-js-common/src/utilities/eventMethodOverloads.ts file.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The delete operator in packages/analytics-js-common/src/utilities/eventMethodOverloads.ts should be replaced with setting the value to undefined to avoid performance issues.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:26.185Z
Learning: The delete operator in packages/analytics-js-common/src/utilities/eventMethodOverloads.ts should be replaced with setting the value to undefined to avoid performance issues.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In packages/analytics-js-common/src/utilities/eventMethodOverloads.ts, the delete operator has been replaced with setting the value to undefined for better performance.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1782
File: packages/analytics-js-common/src/utilities/eventMethodOverloads.ts:0-0
Timestamp: 2024-07-11T08:44:37.825Z
Learning: In packages/analytics-js-common/src/utilities/eventMethodOverloads.ts, the delete operator has been replaced with setting the value to undefined for better performance.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2309
File: packages/analytics-js-plugins/tests/deviceModeDestinations/utils.test.ts:2402-2402
Timestamp: 2025-06-30T10:02:01.367Z
Learning: Performance optimizations regarding the delete operator (replacing with undefined assignment) are not a concern for test files and should not be suggested in test code contexts.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2323
File: packages/analytics-js-legacy-utilities/src/storage/cookie.js:39-41
Timestamp: 2025-07-09T06:01:31.874Z
Learning: In the context of PR #2323 for the legacy utilities package, user saikumarrs chose not to replace the delete operator with undefined assignment in packages/analytics-js-legacy-utilities/src/storage/cookie.js, even though this contradicts their previously established preference for avoiding delete operator for performance reasons.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with globalThis in packages/analytics-js-common/src/utilities/page.ts is handled elsewhere in the codebase as per user saikumarrs.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with globalThis in packages/analytics-js-common/src/utilities/page.ts is handled elsewhere in the codebase as per user saikumarrs.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-common/src/utilities/retryQueue/RetryQueue.ts:0-0
Timestamp: 2024-11-08T13:22:54.185Z
Learning: Code coverage issues should be ignored in future code reviews.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/fixtures/msw.handlers.ts:86-86
Timestamp: 2024-09-27T10:26:32.458Z
Learning: When updating test files to replace 'example.com' with 'dummy.dataplane.host.com', note that the change is only needed for test suites that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1867
File: packages/analytics-js/fixtures/msw.handlers.ts:86-86
Timestamp: 2024-10-08T15:52:59.819Z
Learning: When updating test files to replace 'example.com' with 'dummy.dataplane.host.com', note that the change is only needed for test suites that actually make network requests.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1708
File: packages/analytics-js-integrations/tests/integrations/SpotifyPixel/browser.test.js:249-260
Timestamp: 2024-07-27T07:02:57.329Z
Learning: Inconsistencies in data structures such as line_items within test scripts of the SpotifyPixel and Podsights integrations can be ignored as per user guidance, as they do not necessarily reflect production code requirements.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1999
File: packages/analytics-js/tests/services/HttpClient/HttpClient.test.ts:18-18
Timestamp: 2025-01-24T10:29:23.777Z
Learning: Hard-coded dummy credentials (like 'dummyWriteKey', 'rawHeaderValue') in test files are acceptable as they are not real sensitive values and improve test readability.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js file, ignore the assignment pattern let e = (window.rudderanalytics = window.rudderanalytics || []); as it is a standard snippet.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
</retrieved_learning>
<retrieved_learning>
Learnt from: david8z
PR: #2037
File: packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js:120-121
Timestamp: 2025-02-10T13:32:41.446Z
Learning: In Facebook Pixel integration, the isReady method should always check for actual pixel initialization state using fbq.getState().pixels, even when skipInitialization is true, as the pixel might be initialized by other tools.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:57.623Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the utility function getDeliveryPayload cannot fail because all problematic fields are cleaned up prior to this step.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2323
File: packages/analytics-js-legacy-utilities/src/ObjectUtils.js:54-54
Timestamp: 2025-07-09T06:01:31.404Z
Learning: In packages/analytics-js-legacy-utilities/src/ObjectUtils.js, the isInstanceOfEvent function checking only for the target property (without additional event-specific properties) is acceptable and intentional for the legacy utilities package.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In packages/analytics-js/src/app/RudderAnalytics.ts, the constructor of the RudderAnalytics class intentionally returns RudderAnalytics.globalSingleton to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the new operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In packages/analytics-js/src/components/core/Analytics.ts, inputs to the clone function are sanitized prior, so error handling for clone operations is not needed.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
</retrieved_learning>
<retrieved_learning>
Learnt from: MoumitaM
PR: #1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The trackPageLifecycleEvents method in packages/analytics-js/src/app/RudderAnalytics.ts does not require refactoring as the current implementation is preferred.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1823
File: packages/analytics-js-plugins/src/deviceModeTransformation/utilities.ts:159-159
Timestamp: 2024-11-09T05:58:54.124Z
Learning: In this codebase, when catching errors, it's acceptable to type caught errors as any because errorHandler?.onError can handle all kinds of errors.
</retrieved_learning>
<retrieved_learning>
Learnt from: ItsSudip
PR: #1684
File: packages/analytics-js-integrations/tests/utils/commonUtils.test.js:355-357
Timestamp: 2024-06-10T07:43:52.149Z
Learning: The isBlank function in commonUtils.test.js is expected to return false when the input is null, as per the specific implementation and requirement of the project.
</retrieved_learning>
<retrieved_learning>
Learnt from: ItsSudip
PR: #1684
File: packages/analytics-js-integrations/tests/utils/commonUtils.test.js:355-357
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The isBlank function in commonUtils.test.js is expected to return false when the input is null, as per the specific implementation and requirement of the project.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1907
File: packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts:172-174
Timestamp: 2024-11-08T06:58:29.573Z
Learning: The function onError in packages/analytics-js/src/services/ErrorHandler/ErrorHandler.ts is acceptable as currently implemented, and refactoring suggestions are not required unless necessary.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:25-26
Timestamp: 2024-10-28T08:08:55.995Z
Learning: In packages/analytics-js-plugins/src/utilities/eventsDelivery.ts, the getDeliveryPayload function does not require additional error handling for stringification failures.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #2246
File: packages/analytics-js-plugins/tests/deviceModeTransformation/utilities.test.ts:349-353
Timestamp: 2025-06-02T14:48:20.980Z
Learning: In device mode transformation utilities tests, the groupingHash validation was intentionally left out of the exception handling test case for JSON parsing errors.
</retrieved_learning>
<retrieved_learning>
Learnt from: saikumarrs
PR: #1730
File: packages/analytics-js/tests/components/capabilitiesManager/CapabilitiesManager.test.ts:129-129
Timestamp: 2024-07-27T07:02:57.329Z
Learning: When testing code that relies on imported constants, ensure the mock is applied correctly before the test cases run to avoid issues with timing or execution flow.
</retrieved_learning>
<retrieved_learning>
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
</retrieved_learning>
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (19)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts:10-11
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The misuse of `IHttpClient` in type assertions within the file `packages/analytics-js-plugins/__tests__/deviceModeTransformation/index.test.ts` has been corrected by the user.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/utilities/retryQueue/utilities.ts:0-0
Timestamp: 2024-11-08T13:17:51.356Z
Learning: The issue regarding missing test coverage for the `findOtherQueues` function in `packages/analytics-js-common/src/utilities/retryQueue/utilities.ts` is no longer applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:10-22
Timestamp: 2024-11-08T12:31:40.009Z
Learning: Tests for the constructor in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/__tests__/integrations/Amplitude/browser.test.js:193-194
Timestamp: 2024-10-07T05:43:26.038Z
Learning: In the Amplitude integration tests (`browser.test.js`), the tests no longer rely on `appVersion`, so including `appVersion` in the mocked navigator object is unnecessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-integrations/src/integrations/Sprig/browser.js:36-38
Timestamp: 2024-11-08T12:33:43.273Z
Learning: Tests for the `isReady` function in `packages/analytics-js-integrations/src/integrations/Sprig/browser.js` are not required.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js-plugins/src/utilities/eventsDelivery.ts:0-0
Timestamp: 2024-10-28T08:03:12.163Z
Learning: In `packages/analytics-js-plugins/src/utilities/eventsDelivery.ts`, the issue regarding inconsistent error handling approaches in `getDMTDeliveryPayload` is no longer valid.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: CODEOWNERS:3-12
Timestamp: 2024-11-08T06:57:00.859Z
Learning: The paths `/packages/analytics-js-integrations/scripts/`, `/packages/analytics-js-common/src/types/Integration.ts`, `/packages/analytics-v1.1/src/utils/IntegrationsData.js`, `/packages/sanity-suite/public/v1.1/integrations/`, and `/packages/sanity-suite/public/v3/integrations/` do not need ownership assignment changes in the `CODEOWNERS` file.
Learnt from: CR
PR: rudderlabs/rudder-sdk-js#0
File: .cursor/rules/005-rudderstack-contribution.mdc:0-0
Timestamp: 2025-06-23T12:35:04.772Z
Learning: Comprehensive testing is required for all customer-facing changes in RudderStack projects to maintain reliability and trust.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js/__tests__/components/utilities/consent.test.ts:1-1
Timestamp: 2024-10-08T06:50:02.860Z
Learning: In `packages/analytics-js/__tests__/components/utilities/consent.test.ts`, the relative import path `../../../src/state` correctly refers to the `index.ts` file in the `/state` directory.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: packages/analytics-js-common/src/types/LoadOptions.ts:0-0
Timestamp: 2024-11-09T06:40:30.520Z
Learning: In the `packages/analytics-js-common/src/types/LoadOptions.ts` file, the `dataplanes` property within the `SourceConfigResponse` type has been removed as it is no longer necessary.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1902
File: packages/analytics-js/src/components/core/Analytics.ts:125-127
Timestamp: 2024-10-28T08:19:43.438Z
Learning: In `packages/analytics-js/src/components/core/Analytics.ts`, inputs to the `clone` function are sanitized prior, so error handling for clone operations is not needed.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2056
File: packages/analytics-js/src/services/StoreManager/Store.ts:41-41
Timestamp: 2025-02-21T12:35:03.408Z
Learning: In the RudderStack JS SDK, TypeScript's type system is relied upon for parameter validation in internal classes, avoiding redundant runtime checks.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1754
File: packages/analytics-js-common/src/utilities/page.ts:1-34
Timestamp: 2024-06-14T06:40:08.622Z
Learning: The compatibility issue with `globalThis` in `packages/analytics-js-common/src/utilities/page.ts` is handled elsewhere in the codebase as per user `saikumarrs`.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1996
File: jest/jest.setup-dom.js:68-70
Timestamp: 2025-01-08T14:28:03.319Z
Learning: In jest.setup-dom.js, a simplified mock implementation of TransformStream with an empty constructor is sufficient for testing purposes. The mock doesn't require implementation of the standard TransformStream interface.
examples/gatsby/sample-gatsby-site/gatsby-browser.js (12)
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1823
File: examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js:18-18
Timestamp: 2024-08-26T09:34:28.341Z
Learning: When reviewing the `examples/integrations/Ninetailed/sample-apps/app-using-v1.1-cdn/src/App.js` file, ignore the assignment pattern `let e = (window.rudderanalytics = window.rudderanalytics || []);` as it is a standard snippet.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1708
File: packages/analytics-js/__tests__/nativeSdkLoader.js:31-33
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The loading snippet in `packages/analytics-js/__tests__/nativeSdkLoader.js` is a standard part of the SDK, and no changes are desired on it.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1876
File: packages/analytics-js/src/app/RudderAnalytics.ts:0-0
Timestamp: 2024-10-09T06:41:05.073Z
Learning: The `trackPageLifecycleEvents` method in `packages/analytics-js/src/app/RudderAnalytics.ts` does not require refactoring as the current implementation is preferred.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2299
File: packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts:335-358
Timestamp: 2025-06-25T09:23:42.370Z
Learning: The RudderStack analytics JavaScript SDK does not support concurrent execution, so race condition concerns for operations like custom integration validation are not applicable.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The `getAnonymousId` method in the RudderStack JavaScript SDK is still supported but does not need to be buffered, hence its removal from the list of buffered methods in example files.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy/index.html:22-31
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The 'getAnonymousId' method in the RudderStack JavaScript SDK is still supported but does not require buffering, hence its removal from the list of buffered methods in PR 1665.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#2150
File: examples/angular/sample-app/src/app/app.component.ts:19-25
Timestamp: 2025-04-10T08:12:56.433Z
Learning: In the Angular sample app, RudderAnalyticsService initializes the analytics in its constructor via the this.initialize() method, so explicit initialization in component ngOnInit methods is not necessary when the service is injected via dependency injection.
Learnt from: saikumarrs
PR: rudderlabs/rudder-sdk-js#1907
File: packages/analytics-js/src/app/RudderAnalytics.ts:68-68
Timestamp: 2024-11-07T05:29:11.813Z
Learning: In `packages/analytics-js/src/app/RudderAnalytics.ts`, the constructor of the `RudderAnalytics` class intentionally returns `RudderAnalytics.globalSingleton` to implement a singleton pattern. In JavaScript, returning an object from a constructor causes the `new` operator to return that object instead of a new instance. Therefore, when reviewing, avoid flagging returns from constructors as issues if they are intended for singleton implementations.
🪛 Biome (1.9.4)
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts
[error] 2650-2650: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
examples/gatsby/sample-gatsby-site/gatsby-browser.js
[error] 5-5: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Unit Tests and Lint
- GitHub Check: Bundle size checks
- GitHub Check: Security and code quality checks
🔇 Additional comments (20)
examples/gatsby/sample-gatsby-site/gatsby-browser.js (3)
6-6: LGTM: Version update to support custom integrations.The version bump to 3.1.0 aligns with the new custom integration features being added.
36-36: LGTM: New custom integration method added.The addition of 'addCustomIntegration' to the methods array correctly exposes the new API for custom integrations.
40-51: LGTM: Improved closure handling with IIFE.The refactoring to use an IIFE for method assignment ensures proper closure capture of the method name, which is a good practice for dynamic method generation.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/index.test.ts (4)
9-9: LGTM: Import for custom integration type added.The import of
RSACustomIntegrationtype is necessary for the new custom integration tests.
25-25: LGTM: VWO added to destination mapping.Adding VWO to the mock mapping supports the conflict detection tests in the custom integration suite.
388-471: LGTM: Test ensures custom integrations are preserved.This test case verifies that existing custom integrations in active destinations are preserved when
setActiveDestinationsis called, which is critical for the custom integration workflow.
1239-1515: Excellent comprehensive test coverage for custom integrations.The test suite thoroughly covers all aspects of the
addCustomIntegrationmethod including:
- Input validation for names and integration objects
- Conflict detection with existing destinations
- Error handling and logging
- Proper destination creation with correct properties
- Edge cases like null/undefined state values
- Multiple integration scenarios
The tests follow good practices with proper mocking, clear assertions, and comprehensive coverage of both success and failure paths.
packages/analytics-js-plugins/src/deviceModeDestinations/utils.ts (7)
9-9: LGTM: Updated type import reflects terminology change.The change from
DeviceModeDestinationtoDeviceModeIntegrationaligns with the consistent terminology used throughout the codebase.
12-17: LGTM: New imports support custom integration functionality.The additional imports for logger types, analytics interfaces, and utility functions are necessary for the new custom integration features.
78-102: LGTM: Function rename improves consistency.The rename from
createDestinationInstancetocreateIntegrationInstanceand the use ofsafeAnalyticsInstancefrom state improves code consistency and simplifies the analytics instance creation.
106-106: LGTM: Consistent use of 'integration' terminology.The changes from using 'instance' to 'integration' throughout the code improve consistency and align with the updated type definitions.
Also applies to: 135-135, 139-139, 164-170
231-231: LGTM: Function rename for grammatical correctness.The rename from
filterDisabledDestinationtofilterDisabledDestinationscorrectly reflects that the function processes multiple destinations.Also applies to: 278-278, 286-286
345-391: Excellent validation logic for custom integrations.The
validateCustomIntegrationfunction provides comprehensive validation:
- Checks for non-empty string names
- Validates against existing destination conflicts
- Verifies proper integration object structure with required and optional methods
- Provides clear error messages for different failure scenarios
The validation logic is thorough and follows good practices for input validation.
393-467: Well-structured custom integration destination creation.The
createCustomIntegrationDestinationfunction:
- Generates unique IDs for custom integrations
- Creates proper destination objects with correct configuration
- Implements safe logger scoping for integration-specific logging
- Wraps custom integration methods to match standard integration interface
- Provides analytics instance and logger to integration methods
The implementation follows the established patterns and provides a clean integration point for custom integrations.
packages/analytics-js-plugins/__tests__/deviceModeDestinations/utils.test.ts (6)
25-30: LGTM - Good UUID mocking setup for deterministic tests.The UUID mocking is properly configured to ensure predictable test results, which is essential for testing custom integration destination creation with unique IDs.
12-21: LGTM - Import updates align with refactoring.The import changes correctly reflect the function renames and new custom integration utilities added to the codebase.
172-316: LGTM - Comprehensive analytics forwarding tests.The updated tests thoroughly verify that all analytics methods (page, track, identify, group, alias, and getters) are properly forwarded to the safe analytics instance from state. This ensures the integration wrapper correctly delegates to the analytics instance.
1101-1144: LGTM - Function rename properly reflected in tests.The tests correctly use the renamed
filterDisabledDestinationsfunction while maintaining comprehensive coverage of the filtering logic.
1694-2135: LGTM - Comprehensive custom integration validation tests.The validation tests cover all critical scenarios:
- Name validation (type, emptiness, whitespace)
- Conflict detection with built-in and active destinations
- Integration interface validation with proper type checking
- Edge cases with null/undefined values
The test structure is well-organized with clear describe blocks and thorough edge case coverage.
2137-2777: LGTM - Thorough custom integration destination creation tests.The tests provide excellent coverage of the destination creation functionality:
- Proper destination structure validation
- Analytics instance and logger wrapping
- Unique ID generation verification
- Realistic integration implementation testing
- Method binding and forwarding verification
The realistic integration test (lines 2446-2651) is particularly valuable as it demonstrates actual usage patterns and verifies proper API interaction.
1a68f20 to
1f5bf4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/analytics-js/.env.example (1)
11-11: Consider reordering the environment variable for better organization.The new
CUSTOM_DEVICE_MODE_DESTINATION_IDvariable properly supports the custom integration feature. However, alphabetical ordering would improve maintainability.Apply this diff to reorder the variable:
CONFIG_SERVER_HOST= +CUSTOM_DEVICE_MODE_DESTINATION_ID= DEST_SDK_BASE_URL= REMOTE_MODULES_BASE_PATH= BUGSNAG_RELEASE_STAGE= BASE_CDN_URL= -CUSTOM_DEVICE_MODE_DESTINATION_ID=
2d82a3e
* feat(analytics-js-common): customintegration interface and types * chore: addressed review comments * chore: removed unused import * chore: updated customintegration type
* feat: add custom integrations api * feat: expose the api and improve code coverage * chore: update size limit config * refactor: log messages and property names * refactor: fix cyclic type dependency * refactor: rename function * feat: additional improvements * test: add test case to cover custom integrations case --------- Co-authored-by: AI Assistant <ai@rudderstack.com>
Co-authored-by: AI Assistant <ai@rudderstack.com>
Co-authored-by: AI Assistant <ai@rudderstack.com>
* feat: support custom device mode destination * chore: fix html --------- Co-authored-by: AI Assistant <ai@rudderstack.com>
…tions (#2378) * fix: allow disabled custom device mode in configured destinations * chore: update code comment * chore: address review comment * chore: size limit update
* fix: custom integrations validations * chore: address ai bot review comments * chore: fix placeholder issues * chore: add explicit boolean check
2d82a3e to
d9e8183
Compare
|



PR Description
Added support for custom device mode integrations.
Linear task (optional)
https://linear.app/rudderstack/issue/SDK-3400/implementation-custom-device-mode-integrations
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Tests
Chores