Skip to content

Send analytics in background#7615

Draft
gonzaloriestra wants to merge 1 commit into
mainfrom
background-analytics
Draft

Send analytics in background#7615
gonzaloriestra wants to merge 1 commit into
mainfrom
background-analytics

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented May 22, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

HackDays project: https://vault.shopify.io/hackdays/154/projects/24279-Shopify-CLI-UX-improvements

Analytics delivery currently blocks command completion, adding noticeable latency to every CLI invocation.

WHAT is this pull request doing?

Writes the completed analytics payload to a temporary file and sends it from a detached internal command, allowing the original command to exit immediately.

Benchmark for shopify version:

Version Average time (10 runs)
4.5.0 1.352s
snapshot 0.248s
demo.mp4

How to test your changes?

  • pnpm i -g @shopify/cli@0.0.0-snapshot-20260724084707
  • shopify version --verbose

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@gonzaloriestra

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label May 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260522143741

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra
gonzaloriestra force-pushed the background-analytics branch 3 times, most recently from 972e250 to f72a8d8 Compare May 29, 2026 11:40
@github-actions

Copy link
Copy Markdown
Contributor

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

@gonzaloriestra
gonzaloriestra force-pushed the background-analytics branch 3 times, most recently from 375d96d to a23f004 Compare July 21, 2026 09:45

gonzaloriestra commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/analytics.d.ts
@@ -6,6 +6,7 @@ interface ReportAnalyticsEventOptions {
     errorMessage?: string;
     exitMode: CommandExitMode;
 }
+export declare function sendAnalyticsEventFromFile(payloadFile: string): Promise<void>;
 /**
  * Report an analytics event, sending it off to Monorail -- Shopify's internal analytics service.
  *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant