Skip to content

Add typed JSON output to theme profile - #8643

Open
gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-checkfrom
gonzalo/json-theme-profile
Open

gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-checkfrom
gonzalo/json-theme-profile

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

theme profile --json returns Speedscope data without a discoverable result contract.

Related to shop/issues-develop#23691.

WHAT is this pull request doing?

Return validated Speedscope data and move JSON/browser presentation into a presenter. Preserve the server's original JSON bytes, including whitespace, field order and extension fields. JSON progress uses the shared typed event channel on stderr; text output retains the existing task display, generated files and browser behavior.

Normal output shows the profiling task and opens the profile in Speedscope:

Generating Liquid profile for example.myshopify.com /

Matching JSON example:

{
  "$schema": "https://www.speedscope.app/file-format-schema.json",
  "shared": {"frames": [{"name": "layout/theme.liquid"}]},
  "profiles": [{
    "type": "evented",
    "name": "Liquid",
    "unit": "microseconds",
    "startValue": 0,
    "endValue": 10,
    "events": [{"type": "O", "at": 0, "frame": 0}, {"type": "C", "at": 10, "frame": 0}]
  }]
}

Uses the bundled Speedscope format for schema definitions and refreshes generated help and the manifest.

How to manually test your changes?

shopify theme profile --store example.myshopify.com --url /
shopify theme profile --store example.myshopify.com --url / --json
shopify theme profile --json-schema

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
  • A single changeset for all theme migrations is added in the last PR, #8682.

@gonzaloriestra
gonzaloriestra added this pull request to stack #8644 September 24, 2026 09:19
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Sep 24, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 964fa3f to 31cc224 Compare September 24, 2026 10:04
@gonzaloriestra
gonzaloriestra removed this pull request from stack #8644 September 24, 2026 10:04
@gonzaloriestra
gonzaloriestra added this pull request to stack #8655 September 24, 2026 10:05
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 31cc224 to 0473c3d Compare September 24, 2026 10:11
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch 2 times, most recently from 42d0894 to b52a551 Compare September 24, 2026 10:21
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from b52a551 to fffea1c Compare September 24, 2026 10:25
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from fffea1c to 0c0d218 Compare September 24, 2026 11:56
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 0c0d218 to 2139045 Compare September 24, 2026 13:46
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from a1560ac to dd8cc07 Compare September 28, 2026 08:20
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch 2 times, most recently from 28777ed to 0993a7c Compare September 28, 2026 09:52
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 28, 2026
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review September 28, 2026 09:54
@gonzaloriestra
gonzaloriestra requested review from a team as code owners September 28, 2026 09:54
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 0993a7c to 619ca97 Compare September 28, 2026 10:25
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 619ca97 to 20a9534 Compare September 28, 2026 11:39
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch 2 times, most recently from 79ef9f7 to a5c8e13 Compare September 29, 2026 10:28
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from a5c8e13 to 61b111d Compare September 29, 2026 11:11
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 61b111d to 8a2dfe7 Compare September 29, 2026 11:38
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch 2 times, most recently from 00c153b to 5ad8644 Compare September 29, 2026 14:18
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 5ad8644 to 7542d09 Compare September 29, 2026 14:40
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-profile branch from 7542d09 to a8cef4b Compare October 1, 2026 08:52
@github-actions

github-actions Bot commented Oct 1, 2026

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/base-command.d.ts
@@ -35,6 +35,7 @@ declare abstract class BaseCommand extends Command {
         argv: string[];
     }>;
     protected environmentsFilename(): string | undefined;
+    protected validateNonTTYFlags(flags: FlagOutput): void;
     protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
     private failMissingNonTTYFlagRequirements;
     private applicableNonTTYFlagRequirements;

This branch has not been deployed

No deployments
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