Skip to content
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

chore(release): pulling release/3.7.0 into main #1703

Merged
merged 17 commits into from
Apr 29, 2024
Merged

chore(release): pulling release/3.7.0 into main #1703

merged 17 commits into from
Apr 29, 2024

Conversation

devops-github-rudderstack
Copy link
Contributor

@devops-github-rudderstack devops-github-rudderstack commented Apr 26, 2024

👑 An automated PR

Summary by CodeRabbit

  • New Features

    • Updated HTML titles in various Chrome extensions for improved clarity.
    • Enhanced analytics functionality with new version updates and method adjustments in multiple frameworks.
    • Introduced optional chaining in Next.js and React.js components for more robust code.
    • Added new event tracking and configuration options in analytics integrations.
  • Bug Fixes

    • Corrected a typo in Symfony documentation and modified function call parameters.
    • Removed deprecated useLegacySDK property from Gatsby configuration.
  • Documentation

    • Updated usage instructions and configuration details in Symfony and Gatsby.
  • Refactor

    • Unified script loading and initialization in HTML files across various technologies.
  • Chores

    • Increased size limits and improved storage management in the analytics-js package.

MoumitaM and others added 17 commits April 15, 2024 18:41
* feat: added custom domain support in ga4

* fix: modified browser test case

* fix: update packages/analytics-js-integrations/src/integrations/GA4/browser.js

Co-authored-by: Gauravudia <[email protected]>

* fix: handling trailing slash in base url

---------

Co-authored-by: Gauravudia <[email protected]>
* feat: supporting add to cart for criteo

* fix: adding test cases
* feat: warn users on missing plugins

* feat: structure the log messages

* feat: add data plane events state

* refactor: merge plugin filtering and configuration checking logic

* refactor: clean up

* test: add tests for updateDataPlaneEventsStateFromLoadOptions

* fix: use types in signal creation

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: add missing import

* fix: add tests and refactor code

* test: update descriptions as per coderabbitai suggestions

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: add autoConfig support in FBPixel, add tests

* chore: add undefined check for autoconfig
Copy link
Contributor

coderabbitai bot commented Apr 26, 2024

Walkthrough

This update encompasses a variety of enhancements across Chrome extensions, various JavaScript frameworks, and analytics integration packages. It includes HTML title revisions, updates to analytics snippet versions and methods, the introduction of optional chaining in JavaScript codebases for increased safety, and specific improvements in analytics integrations like Criteo and GA4. Additionally, adjustments were made to configuration settings in Symfony and Gatsby, and performance tweaks in analytics storage management.

Changes

Files Change Summary
.../chrome-extension/.../popup.html, .../settings.html Updated HTML titles to new conventions across multiple Chrome extensions.
.../index.html, .../layout.tsx, .../layout.js, .../_document.tsx Updated RudderSnippetVersion to '3.0.4' and standardized script loading and function assignments.
.../page.js, .../page.tsx, .../App.js, .../App.tsx Introduced optional chaining (?.) for safer property access in Next.js and React.js components.
.../constants.ts, .../browser.js, .../utils.js, .../utils.test.js, .../browser.test.js Enhanced functionality in analytics-js-common and analytics-js-integrations with new events and features in integrations like Criteo, Facebook Pixel, and GA4.
.../USAGE.md, .../app.js, .../gatsby-config.ts Corrected documentation and modified configuration settings in Symfony and Gatsby.
.size-limit.js, .../LocalStorage.ts Increased size limits and improved storage length calculation methods in analytics-js.

🐇💻
In the digital garden, changes bloom,
Titles, scripts, and methods assume
New forms in the code's bright room.
Watch the data dance, analytics zoom,
As the rabbit coder hops under the moon. 🌕✨


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 711180c and d2e5fe0.
Files ignored due to path filters (49)
  • examples/angular/sample-app/angular.json is excluded by !**/*.json
  • examples/angular/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/angular/sample-app/package.json is excluded by !**/*.json
  • examples/chrome-extension/background-script-websockets/manifest.json is excluded by !**/*.json
  • examples/chrome-extension/background-script/manifest.json is excluded by !**/*.json
  • examples/chrome-extension/content-script-v1.1/manifest.json is excluded by !**/*.json
  • examples/chrome-extension/content-script-v3/manifest.json is excluded by !**/*.json
  • examples/gatsby/sample-gatsby-plugin-usage/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/gatsby/sample-gatsby-plugin-usage/package.json is excluded by !**/*.json
  • examples/gatsby/sample-gatsby-site/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/gatsby/sample-gatsby-site/package.json is excluded by !**/*.json
  • examples/html/test_poster.jpg is excluded by !**/*.jpg, !**/*.jpg
  • examples/integrations/ninetailed/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/integrations/ninetailed/sample-app/package.json is excluded by !**/*.json
  • examples/nextjs/hooks/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/nextjs/hooks/sample-app/package.json is excluded by !**/*.json
  • examples/nextjs/js/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/nextjs/js/sample-app/package.json is excluded by !**/*.json
  • examples/nextjs/page-router/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/nextjs/page-router/sample-app/package.json is excluded by !**/*.json
  • examples/nextjs/ts/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/nextjs/ts/sample-app/package.json is excluded by !**/*.json
  • examples/reactjs/hooks/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/reactjs/hooks/sample-app/package.json is excluded by !**/*.json
  • examples/reactjs/js/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/reactjs/ts/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/reactjs/ts/sample-app/package.json is excluded by !**/*.json
  • examples/reactjs/vite/sample-app/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/reactjs/vite/sample-app/package.json is excluded by !**/*.json
  • examples/serverless/cloudflare-worker/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/serverless/cloudflare-worker/package.json is excluded by !**/*.json
  • examples/serverless/vercel-edge/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/symfony/sample/package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • examples/symfony/sample/package.json is excluded by !**/*.json
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • package.json is excluded by !**/*.json
  • packages/analytics-js-common/package.json is excluded by !**/*.json
  • packages/analytics-js-common/project.json is excluded by !**/*.json
  • packages/analytics-js-integrations/package.json is excluded by !**/*.json
  • packages/analytics-js-integrations/project.json is excluded by !**/*.json
  • packages/analytics-js-plugins/package.json is excluded by !**/*.json
  • packages/analytics-js-plugins/project.json is excluded by !**/*.json
  • packages/analytics-js/package.json is excluded by !**/*.json
  • packages/analytics-js/project.json is excluded by !**/*.json
  • packages/analytics-v1.1/package.json is excluded by !**/*.json
  • packages/analytics-v1.1/project.json is excluded by !**/*.json
  • packages/loading-scripts/package.json is excluded by !**/*.json
  • packages/loading-scripts/project.json is excluded by !**/*.json
  • packages/sanity-suite/package.json is excluded by !**/*.json
Files selected for processing (56)
  • examples/angular/sample-app/src/index.html (1 hunks)
  • examples/chrome-extension/background-script-websockets/popup/popup.html (1 hunks)
  • examples/chrome-extension/background-script-websockets/settings/settings.html (1 hunks)
  • examples/chrome-extension/background-script/popup/popup.html (1 hunks)
  • examples/chrome-extension/background-script/settings/settings.html (1 hunks)
  • examples/chrome-extension/content-script-v1.1/popup/popup.html (1 hunks)
  • examples/chrome-extension/content-script-v1.1/settings/settings.html (1 hunks)
  • examples/chrome-extension/content-script-v3/popup/popup.html (1 hunks)
  • examples/chrome-extension/content-script-v3/settings/settings.html (1 hunks)
  • examples/gatsby/sample-gatsby-plugin-usage/gatsby-config.ts (1 hunks)
  • examples/nextjs/hooks/sample-app/src/app/layout.tsx (1 hunks)
  • examples/nextjs/js/sample-app/src/app/layout.js (1 hunks)
  • examples/nextjs/js/sample-app/src/app/page.js (4 hunks)
  • examples/nextjs/page-router/sample-app/src/pages/_document.tsx (1 hunks)
  • examples/nextjs/ts/sample-app/src/app/page.tsx (4 hunks)
  • examples/reactjs/hooks/sample-app/public/index.html (1 hunks)
  • examples/reactjs/js/sample-app/src/App.js (4 hunks)
  • examples/reactjs/ts/sample-app/src/App.tsx (4 hunks)
  • examples/reactjs/vite/sample-app/index.html (1 hunks)
  • examples/reactjs/vite/sample-app/src/App.tsx (4 hunks)
  • examples/symfony/USAGE.md (1 hunks)
  • examples/symfony/sample/assets/app.js (1 hunks)
  • examples/v3-beacon/index.html (1 hunks)
  • examples/v3-legacy-minimum-plugins/index.html (1 hunks)
  • examples/v3-legacy/index.html (1 hunks)
  • examples/v3-minimum-plugins/index.html (1 hunks)
  • examples/v3/index.html (1 hunks)
  • packages/analytics-js-common/CHANGELOG.md (1 hunks)
  • packages/analytics-js-common/CHANGELOG_LATEST.md (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/Criteo/constants.ts (1 hunks)
  • packages/analytics-js-common/src/types/ApplicationState.ts (2 hunks)
  • packages/analytics-js-integrations/CHANGELOG.md (1 hunks)
  • packages/analytics-js-integrations/CHANGELOG_LATEST.md (1 hunks)
  • packages/analytics-js-integrations/tests/integrations/Criteo/utils.test.js (1 hunks)
  • packages/analytics-js-integrations/tests/integrations/FacebookPixel/browser.test.js (3 hunks)
  • packages/analytics-js-integrations/tests/integrations/GA4/browser.test.js (2 hunks)
  • packages/analytics-js-integrations/src/integrations/Criteo/browser.js (4 hunks)
  • packages/analytics-js-integrations/src/integrations/Criteo/utils.js (5 hunks)
  • packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js (2 hunks)
  • packages/analytics-js-integrations/src/integrations/GA4/browser.js (3 hunks)
  • packages/analytics-js-integrations/src/integrations/TVSquared/browser.js (2 hunks)
  • packages/analytics-js-plugins/CHANGELOG.md (1 hunks)
  • packages/analytics-js-plugins/CHANGELOG_LATEST.md (1 hunks)
  • packages/analytics-js/.size-limit.js (2 hunks)
  • packages/analytics-js/CHANGELOG.md (1 hunks)
  • packages/analytics-js/CHANGELOG_LATEST.md (1 hunks)
  • packages/analytics-js/tests/components/configManager/commonUtil.test.ts (2 hunks)
  • packages/analytics-js/tests/components/core/Analytics.test.ts (2 hunks)
  • packages/analytics-js/tests/components/pluginsManager/PluginsManager.test.ts (1 hunks)
  • packages/analytics-js/src/components/configManager/ConfigManager.ts (2 hunks)
  • packages/analytics-js/src/components/configManager/constants.ts (2 hunks)
  • packages/analytics-js/src/components/configManager/util/commonUtil.ts (2 hunks)
  • packages/analytics-js/src/components/pluginsManager/PluginsManager.ts (2 hunks)
  • packages/analytics-js/src/components/pluginsManager/types.ts (1 hunks)
  • packages/analytics-js/src/constants/logMessages.ts (2 hunks)
  • packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts (2 hunks)
Files not processed due to max files limit (8)
  • packages/analytics-js/src/state/index.ts
  • packages/analytics-js/src/state/slices/dataPlaneEvents.ts
  • packages/analytics-v1.1/CHANGELOG.md
  • packages/analytics-v1.1/CHANGELOG_LATEST.md
  • packages/loading-scripts/CHANGELOG.md
  • packages/loading-scripts/CHANGELOG_LATEST.md
  • packages/sanity-suite/CHANGELOG.md
  • sonar-project.properties
Files skipped from review due to trivial changes (15)
  • examples/chrome-extension/background-script-websockets/popup/popup.html
  • examples/chrome-extension/background-script-websockets/settings/settings.html
  • examples/chrome-extension/background-script/popup/popup.html
  • examples/chrome-extension/background-script/settings/settings.html
  • examples/chrome-extension/content-script-v1.1/popup/popup.html
  • examples/chrome-extension/content-script-v1.1/settings/settings.html
  • examples/chrome-extension/content-script-v3/popup/popup.html
  • examples/chrome-extension/content-script-v3/settings/settings.html
  • examples/nextjs/js/sample-app/src/app/page.js
  • examples/nextjs/ts/sample-app/src/app/page.tsx
  • examples/reactjs/js/sample-app/src/App.js
  • examples/reactjs/ts/sample-app/src/App.tsx
  • examples/symfony/sample/assets/app.js
  • packages/analytics-js-plugins/CHANGELOG_LATEST.md
  • packages/analytics-js/.size-limit.js
Additional Context Used
Learnings (1)
examples/v3-legacy-minimum-plugins/index.html (2)
User: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-legacy-minimum-plugins/index.html:22-31
Timestamp: 2024-03-22T05:54:18.817Z
Learning: The 'setAnonymousId' method is intended to be present in the example files of the RudderStack JavaScript SDK, as clarified in PR 1665.
User: MoumitaM
PR: rudderlabs/rudder-sdk-js#1665
File: examples/v3-minimum-plugins/index.html:22-31
Timestamp: 2024-03-22T05:53:06.290Z
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.
Additional comments not posted (83)
packages/analytics-js-common/src/constants/integrations/Criteo/constants.ts (1)

13-13: The addition of 'product added' to supportedEvents aligns with the PR's objectives to enhance the Criteo integration.

packages/analytics-js/src/components/pluginsManager/types.ts (1)

6-13: The PluginsGroup type definition is well-structured and provides clear configuration and management properties for plugins.

examples/gatsby/sample-gatsby-plugin-usage/gatsby-config.ts (1)

Line range hint 1-14: The Gatsby configuration for the RudderStack plugin is correctly implemented with appropriate options and keys.

packages/analytics-js/CHANGELOG_LATEST.md (1)

1-11: The changelog entries for analytics-js are correctly documented, detailing new features and dependency updates.

packages/analytics-js-integrations/CHANGELOG_LATEST.md (1)

1-11: The changelog entries for analytics-js-integrations are correctly documented, detailing new features and dependency updates.

examples/angular/sample-app/src/index.html (1)

10-19: The RudderStack analytics setup in the Angular sample app is correctly implemented, including the updated RudderSnippetVersion and method array.

packages/analytics-js/src/components/configManager/constants.ts (1)

Line range hint 5-31: The constants related to configuration management in analytics-js are well-defined and correctly exported, enhancing the configuration capabilities.

examples/reactjs/vite/sample-app/index.html (3)

9-9: Set the RudderSnippetVersion to '3.0.4'.


11-11: Standardized method array initialization.


14-18: Ensure that the function assignment to window.rudderanalytics methods is correctly scoped to avoid potential issues with closures.

examples/nextjs/page-router/sample-app/src/pages/_document.tsx (3)

10-10: Set the RudderSnippetVersion to '3.0.4'.


12-12: Standardized method array initialization.


15-19: Ensure that the function assignment to window.rudderanalytics methods is correctly scoped to avoid potential issues with closures.

examples/nextjs/js/sample-app/src/app/layout.js (3)

18-18: Set the RudderSnippetVersion to '3.0.4'.


20-20: Standardized method array initialization.


23-27: Ensure that the function assignment to window.rudderanalytics methods is correctly scoped to avoid potential issues with closures.

examples/nextjs/hooks/sample-app/src/app/layout.tsx (3)

19-19: Set the RudderSnippetVersion to '3.0.4'.


21-21: Standardized method array initialization.


24-28: Ensure that the function assignment to window.rudderanalytics methods is correctly scoped to avoid potential issues with closures.

examples/symfony/USAGE.md (1)

50-50: Ensure that the RudderStack JS SDK CDN package is correctly described for use in Twig templates.

packages/analytics-js/src/services/StoreManager/storages/LocalStorage.ts (2)

41-41: Updated the length property to use store.len() for more accurate storage length calculation.


52-52: Ensure that the length property is updated after removing an item to maintain accurate storage length tracking.

examples/reactjs/hooks/sample-app/public/index.html (3)

29-29: Set the RudderSnippetVersion to "3.0.4".


32-32: Standardized method array initialization.


35-39: Ensure that the function assignment to window.rudderanalytics methods is correctly scoped to avoid potential issues with closures.

packages/analytics-js-integrations/src/integrations/TVSquared/browser.js (1)

Line range hint 44-44: Verify that custom metrics are correctly handled and that the setCustomVariable and deleteCustomVariable methods are used appropriately within the track and page methods.

examples/reactjs/vite/sample-app/src/App.tsx (5)

22-22: Ensure that the optional chaining in window.rudderanalytics?.page is necessary given the context.


38-38: Confirm that the optional chaining in window.rudderanalytics?.identify is appropriate for the usage scenario.


52-52: Check if the optional chaining in window.rudderanalytics?.track is correctly applied.


65-65: Verify the necessity of optional chaining in window.rudderanalytics?.alias.


70-70: Ensure that the use of optional chaining in window.rudderanalytics?.group is justified.

packages/analytics-js-integrations/src/integrations/Criteo/browser.js (1)

133-135: Ensure that the new 'product added' event handling in the track method aligns with the expected business logic.

packages/analytics-js-integrations/__tests__/integrations/Criteo/utils.test.js (6)

5-25: Confirm that the test for correct property extraction from the message parameter in handleProductAdded covers all necessary cases.


28-35: Ensure that the test for an undefined message parameter in handleProductAdded correctly simulates all edge cases.


38-58: Verify that the test for creating an addToCartObject with a valid properties object is comprehensive.


61-81: Check if the test for adding a product object to the 'item' property in handleProductAdded is accurate.


84-104: Ensure that the test for pushing the addToCartObject to the finalPayload array in handleProductAdded is correct.


107-126: Confirm that the test for creating an addToCartObject without the 'currency' property when it's missing from the properties object is thorough.

packages/analytics-js-common/src/types/ApplicationState.ts (1)

97-100: Ensure that the new DataPlaneEventsState type correctly represents the intended structure and usage within the application.

packages/analytics-js-integrations/__tests__/integrations/GA4/browser.test.js (1)

16-24: Verify that the test for GA4 initialization with MeasurementId and SdkBaseUrl covers all relevant scenarios and correctly asserts the expected outcomes.

packages/analytics-js/src/components/configManager/ConfigManager.ts (1)

79-79: Ensure that the update to the data plane events state management in ConfigManager aligns with the intended functionality and state structure.

packages/analytics-js-integrations/src/integrations/GA4/browser.js (2)

133-133: Confirm that the script loading method in the GA4 integration correctly handles the new sdkBaseUrl configuration.


137-137: Ensure that the initialization method in the GA4 integration properly utilizes the updated script loading logic.

examples/v3/index.html (1)

9-69: Verify that the script initialization logic in the HTML document correctly sets up the RudderStack JS SDK with the new version and configuration options.

examples/v3-legacy/index.html (4)

11-11: Update RudderSnippetVersion to align with the latest version.


18-24: Ensure that the method array initialization aligns with the new unified format.


50-58: Consider adding error handling for script loading to enhance robustness.


62-68: Ensure that the configuration options are correctly set and align with the system's requirements.

examples/v3-minimum-plugins/index.html (4)

11-11: Update RudderSnippetVersion to align with the latest version.


18-24: Ensure that the method array initialization aligns with the new unified format.


50-58: Consider adding error handling for script loading to enhance robustness.


62-71: Ensure that the configuration options are correctly set and align with the system's requirements, including the plugins array.

examples/v3-legacy-minimum-plugins/index.html (4)

11-11: Update RudderSnippetVersion to align with the latest version.


18-24: Ensure that the method array initialization aligns with the new unified format.


50-58: Consider adding error handling for script loading to enhance robustness.


62-71: Ensure that the configuration options are correctly set and align with the system's requirements, including the plugins array.

examples/v3-beacon/index.html (4)

11-11: Update RudderSnippetVersion to align with the latest version.


18-24: Ensure that the method array initialization aligns with the new unified format.


50-58: Consider adding error handling for script loading to enhance robustness.


62-71: Ensure that the configuration options are correctly set and align with the system's requirements, including the beacon usage.

packages/analytics-js/src/components/configManager/util/commonUtil.ts (2)

21-21: Ensure that the import of PluginName is used appropriately in the file.


258-277: Check the logic for handling the beacon API and ensure it aligns with the system's capabilities and requirements.

packages/analytics-js-integrations/src/integrations/FacebookPixel/browser.js (2)

39-39: Ensure that the autoConfig property is set correctly based on the configuration.


76-76: Check the autoConfig setting in the fbq initialization to ensure it aligns with the intended behavior.

packages/analytics-js-integrations/src/integrations/Criteo/utils.js (3)

76-76: LGTM! Proper logging for missing product_id in handleProductView.


196-213: LGTM! The new handleProductAdded function correctly handles the 'product added' event with proper validation and structure.


324-328: LGTM! Proper handling and logging for missing product information in handleListView.

packages/analytics-js-integrations/__tests__/integrations/FacebookPixel/browser.test.js (1)

Line range hint 62-79: LGTM! The new test case correctly checks the initialization of Facebook Pixel with autoConfig feature.

packages/analytics-js/__tests__/components/pluginsManager/PluginsManager.test.ts (8)

12-13: Ensure that all necessary logger methods are mocked.

It's good practice to mock all methods of an object that might be called during tests to avoid unintended side effects or errors during test execution.


22-26: Initialization of PluginsManager in beforeEach is consistent and ensures test isolation.

This setup helps in ensuring that each test case starts with a fresh instance of PluginsManager, which is crucial for the independence of tests.


30-32: Correct handling of undefined plugins list.

This test ensures that the method correctly handles a scenario where the plugins list is undefined, which is a common edge case.


42-47: Test coverage for automatically configured plugins.

This test case effectively checks that automatically configured plugins are correctly recognized and included by the PluginsManager.


50-60: Logging behavior is correctly tested when a plugin is automatically loaded.

The test verifies that a warning is logged when a necessary plugin is automatically loaded, which is important for user awareness.


63-69: Ensure that error reporting plugins are correctly handled.

This test checks that the error reporting plugins are included when they are configured to load by default, which is crucial for error management in production.


98-187: Comprehensive testing of plugin loading based on various configurations.

These tests cover a wide range of scenarios, ensuring that the PluginsManager behaves as expected under different configuration states.


256-265: Proper handling of cases where the logger is not supplied.

This test ensures that no logging occurs when the logger is not provided, which is important for scenarios where logging might need to be suppressed.

packages/analytics-js/src/components/pluginsManager/PluginsManager.ts (3)

99-177: Efficient management of plugin loading based on configuration.

The method getPluginsToLoadBasedOnConfig effectively determines which plugins to load based on the current configuration, which is crucial for dynamic plugin management.


179-206: Proper handling of missing plugins with appropriate logging.

The method addMissingPlugins correctly handles the scenario where certain plugins are missing from the configuration but are required, and logs warnings appropriately.


15-16: Use of utility functions for checks and constants.

The use of utility functions like isDefined and constants from logMessages helps in maintaining code cleanliness and reusability.

Also applies to: 23-23

packages/analytics-js/__tests__/components/configManager/commonUtil.test.ts (1)

533-575: The new test suite for updateDataPlaneEventsStateFromLoadOptions is well-structured and covers the necessary scenarios effectively.

packages/analytics-js-integrations/CHANGELOG.md (1)

13-15: Confirm the spelling of "autoConfig" and "FBPixel" to ensure they match the project's terminology.

packages/analytics-js/__tests__/components/core/Analytics.test.ts (1)

Line range hint 120-137: Verify global state manipulation in tests.

The test cases for the load method manipulate global state and expect certain methods to be called. It's important to verify that these global state changes do not affect other tests due to shared state. Consider isolating each test or resetting state appropriately to ensure test independence.

packages/analytics-js/CHANGELOG.md (1)

5-5: Ensure the version number in the changelog title matches the latest version described in the changes.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 89.24731% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 54.14%. Comparing base (711180c) to head (d2e5fe0).

Files Patch % Lines
...js-integrations/src/integrations/Criteo/browser.js 0.00% 5 Missing ⚠️
...s-js-integrations/src/integrations/Criteo/utils.js 66.66% 4 Missing ⚠️
...mon/src/constants/integrations/Criteo/constants.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1703      +/-   ##
==========================================
+ Coverage   53.92%   54.14%   +0.21%     
==========================================
  Files         461      462       +1     
  Lines       15615    15648      +33     
  Branches     3098     3113      +15     
==========================================
+ Hits         8421     8472      +51     
+ Misses       5899     5848      -51     
- Partials     1295     1328      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Apr 26, 2024

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

Out of diff range and nitpick comments (23)
packages/analytics-js-common/CHANGELOG_LATEST.md (1)

6-6: Consider revising the phrase "supporting add to cart for criteo" to "added support for 'add to cart' in Criteo" for grammatical correctness.

examples/symfony/USAGE.md (1)

Line range hint 9-11: Correct the capitalization in the anchor links to ensure they are valid and match the actual section IDs.

-#Webpack-Encore
-#Twig-template
-#External-resources
+#webpack-encore
+#twig-template
+#external-resources
packages/analytics-js-integrations/src/integrations/TVSquared/browser.js (1)

Line range hint 1-1: Ensure that the ESLint rules are appropriately configured to maintain code quality and avoid disabling them unless absolutely necessary.

packages/analytics-js-integrations/src/integrations/Criteo/browser.js (2)

80-80: Consider whether the warning log in the page method is necessary or if it could be handled more gracefully.


103-103: Review the necessity of the warning log when properties are missing in the track method.

packages/analytics-js-common/CHANGELOG.md (2)

10-10: Clarify the description for the feature related to Criteo.

Consider changing "supporting add to cart for criteo" to "Added support for 'add to cart' events in Criteo integration."


Line range hint 148-148: Correct heading levels to ensure they increment by one level at a time.

- ### Features
+ ## Features
packages/analytics-js-plugins/CHANGELOG.md (2)

Line range hint 15-15: Clarify the description of the bug fix for better understanding.

Consider rephrasing to explicitly state what the backward compatibility entails.


Line range hint 25-25: Ensure proper markdown list formatting for bug fixes.

- * optimize localstorage transactions ([#1651](https://github.com/rudderlabs/rudder-sdk-js/issues/1651)) ([1289217](https://github.com/rudderlabs/rudder-sdk-js/commit/12892176578dd3628fded2311ea2548e3ff5802c))
+ - Optimize localstorage transactions ([#1651](https://github.com/rudderlabs/rudder-sdk-js/issues/1651)) ([1289217](https://github.com/rudderlabs/rudder-sdk-js/commit/12892176578dd3628fded2311ea2548e3ff5802c))
packages/analytics-js-integrations/CHANGELOG.md (2)

Line range hint 22-22: Consider changing "warn" to "warning" to clarify the log level.

- * making the error message as warn ([#1686](https://github.com/rudderlabs/rudder-sdk-js/issues/1686)) ([56e34be](https://github.com/rudderlabs/rudder-sdk-js/commit/56e34be3575f66531bfe4910ff4aa970ed2ee208))
+ * making the error message as warning ([#1686](https://github.com/rudderlabs/rudder-sdk-js/issues/1686)) ([56e34be](https://github.com/rudderlabs/rudder-sdk-js/commit/56e34be3575f66531bfe4910ff4aa970ed2ee208))

Line range hint 255-255: Correct the heading level for consistency in document structure.

- ### [3.0.0-beta.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2023-08-21)
+ ## [3.0.0-beta.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) - 2023-08-21
packages/analytics-js/__tests__/components/core/Analytics.test.ts (3)

Line range hint 58-89: Refactor lifecycle state tests for clarity and maintainability.

The test case for startLifecycle method is complex and involves many state changes and spy checks. Consider breaking it down into smaller, more focused tests. This will improve both clarity and maintainability. Each state transition could potentially be its own test, which would make it easier to understand what each part of the test is verifying.


Line range hint 230-260: Enhance test coverage for user session changes.

The test cases for the identify method focus on whether the user ID is set and if the session needs to be reset. However, they could be enhanced by verifying that all user-related state changes are handled correctly, especially when the user ID changes. This would ensure that the method behaves correctly in all scenarios.


Line range hint 350-400: Clarify and simplify consent handling tests.

The test cases for the consent method are quite complex, involving multiple settings and state changes. Consider simplifying these tests or breaking them down into smaller units. This would make it easier to understand and maintain the tests, and ensure that each aspect of consent handling is thoroughly tested.

packages/analytics-js/CHANGELOG.md (9)

14-14: Add a brief description for the patch added to storejs for clarity on what the change entails.


Line range hint 223-223: Change the heading level from h3 to h2 to maintain a proper incremental sequence.

- ### Dependency Updates
+ ## Dependency Updates

Line range hint 242-242: Change the heading level from h3 to h2 to maintain a proper incremental sequence.

- ### Features
+ ## Features

Line range hint 253-253: Change the heading level from h3 to h2 to maintain a proper incremental sequence.

- ### Bug Fixes
+ ## Bug Fixes

Line range hint 264-264: Change the heading level from h3 to h2 to maintain a proper incremental sequence.

- ### Dependency Updates
+ ## Dependency Updates

Line range hint 276-276: Change the heading level from h3 to h2 to maintain a proper incremental sequence.

- ### Features
+ ## Features

Line range hint 236-238: Remove the extra blank lines to maintain consistency.

-
-
-

Line range hint 30-30: Add a blank line above the heading for better readability and to adhere to markdown best practices.

+

Line range hint 220-220: Ensure there is only one top-level heading in the document to adhere to best practices.

- # Change Log
+ ## Change Log

packages/analytics-js/CHANGELOG.md Show resolved Hide resolved
packages/analytics-js-plugins/CHANGELOG.md Show resolved Hide resolved
packages/analytics-js-plugins/CHANGELOG.md Show resolved Hide resolved
examples/v3-legacy/index.html Show resolved Hide resolved
examples/v3-minimum-plugins/index.html Show resolved Hide resolved
examples/v3-legacy-minimum-plugins/index.html Show resolved Hide resolved
examples/v3-beacon/index.html Show resolved Hide resolved
Copy link

size-limit report 📦

Name Size (Base) Size (Current) Size Limit Status
Common Code - No bundling 15.81 KB 15.78 KB (-0.22% ▼) 16.5 KB
Remote Module Federation Mapping - CDN 330 B 330 B (0%) 512 B
Remote Module Federated Plugins - CDN 5.71 KB 5.71 KB (0%) 6 KB
Core ESM - NPM 7.64 KB 7.68 KB (+0.49% ▲) 8 KB
Core CJS - NPM 22.45 KB 22.88 KB (+1.91% ▲) 23 KB
Core - NPM 22.54 KB 23.03 KB (+2.15% ▲) 23.5 KB
Core Legacy - CDN 42.92 KB 43.41 KB (+1.17% ▲) 44 KB
Core - CDN 22.71 KB 23.18 KB (+2.09% ▲) 23.5 KB
Core (legacy build) - CDN - v1.1 31.55 KB 31.53 KB (-0.06% ▼) 32 KB
Core - NPM - v1.1 31.53 KB 31.55 KB (+0.05% ▲) 32 KB
Service Worker Module 22.64 KB 22.64 KB (0%) 24 KB
All Integrations (legacy build) - CDN 98.6 KB 98.69 KB (+0.09% ▲) 105 KB

@MoumitaM MoumitaM merged commit 727804c into main Apr 29, 2024
12 checks passed
@MoumitaM MoumitaM deleted the release/3.7.0 branch April 29, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants