Skip to content

refactor: Code cleanup in analytics package#2084

Merged
aklinker1 merged 4 commits intomainfrom
analytics-refactor
Feb 9, 2026
Merged

refactor: Code cleanup in analytics package#2084
aklinker1 merged 4 commits intomainfrom
analytics-refactor

Conversation

@aklinker1
Copy link
Member

Overview

Broken out of #2081.

Manual Testing

CI checks pass

@netlify
Copy link

netlify bot commented Feb 8, 2026

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit e10c6a3
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6988ce065c258a0008946c05
😎 Deploy Preview https://deploy-preview-2084--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines +16 to +30
const INTERACTIVE_TAGS = new Set([
'A',
'BUTTON',
'INPUT',
'SELECT',
'TEXTAREA',
]);
const INTERACTIVE_ROLES = new Set([
'button',
'link',
'checkbox',
'menuitem',
'tab',
'radio',
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

Move up next to other constant.

Comment on lines +81 to +82
// Don't track sessions for the background, it can be running indefinitely
// and will inflate session duration stats.
Copy link
Member Author

Choose a reason for hiding this comment

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

80 column line length

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 8, 2026

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2084

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2084

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2084

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2084

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2084

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2084

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2084

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2084

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2084

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2084

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2084

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2084

wxt

npm i https://pkg.pr.new/wxt@2084

commit: e10c6a3

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.83%. Comparing base (1fe0730) to head (e10c6a3).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2084      +/-   ##
==========================================
- Coverage   76.03%   75.83%   -0.20%     
==========================================
  Files         113      113              
  Lines        3050     3050              
  Branches      686      686              
==========================================
- Hits         2319     2313       -6     
- Misses        648      652       +4     
- Partials       83       85       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines -42 to +50
const wxtAnalyticsCode = [
`import { createAnalytics } from '${
process.env.NPM
? clientModuleId
: normalizePath(relative(wxtAnalyticsFolder, clientModuleId))
}';`,
`import { useAppConfig } from '#imports';`,
``,
`export const analytics = createAnalytics(useAppConfig().analytics);`,
``,
].join('\n');
const wxtAnalyticsCode = `import { createAnalytics } from '${
process.env.NPM
? clientModuleId
: normalizePath(relative(wxtAnalyticsFolder, clientModuleId))
}';
import { useAppConfig } from '#imports';

export const analytics = createAnalytics(useAppConfig().analytics);
`;
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove join for performance.

@aklinker1 aklinker1 self-assigned this Feb 8, 2026
@aklinker1 aklinker1 marked this pull request as ready for review February 8, 2026 17:54
@aklinker1 aklinker1 requested a review from Timeraa as a code owner February 8, 2026 17:54
Co-Authored-By: Patryk Kuniczak <p.kuniczak@gmail.com>
@aklinker1 aklinker1 merged commit aa86ed7 into main Feb 9, 2026
18 checks passed
@aklinker1 aklinker1 deleted the analytics-refactor branch February 9, 2026 07:36
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Thanks for helping make WXT better!

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