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

refactor: remove redundant code #114

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

johanbook
Copy link

@johanbook johanbook commented Jun 11, 2024

🚀 This description was created by Ellipsis for commit 394dcff

Summary:

Refactored getWriteKey in standalone-analytics.ts to remove redundant script tag parsing, simplifying the write key retrieval process.

Key points:

  • Removed redundant script tag parsing code from getWriteKey in standalone-analytics.ts.
  • Simplified write key retrieval, relying on embeddedWriteKey() and getGlobalAnalytics().

Generated with ❤️ by ellipsis.dev

@johanbook johanbook marked this pull request as ready for review June 11, 2024 06:33
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 394dcff in 47 seconds

More details
  • Looked at 41 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_1il339y9MgdbtpKt


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

5 hours left in your free trial, upgrade for $20/seat/month or contact us.

@@ -17,35 +17,6 @@ function getWriteKey(): string | undefined {
if (analytics?._writeKey) {
Copy link

Choose a reason for hiding this comment

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

The removal of the script tag parsing logic in getWriteKey might lead to scenarios where the write key cannot be retrieved if it's not embedded or part of the global analytics object. This could break the analytics functionality where the script is dynamically loaded with the write key in the script's URL. Please ensure that all use cases for obtaining the write key are still supported after this change.

@johanbook johanbook marked this pull request as draft June 11, 2024 06:42
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.

1 participant