-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add theme profile
command
#5109
base: main
Are you sure you want to change the base?
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success2000 tests passing in 904 suites. Report generated by 🧪jest coverage report action from 1a56b88 |
if (import.meta.resolve) { | ||
return import.meta.resolve('speedscope/dist/release/index.html') | ||
} else { | ||
try { | ||
const speedscopePath = require.resolve('speedscope/package.json') | ||
const speedscopeDir = speedscopePath.replace('/package.json', '') | ||
return `file://${speedscopeDir}/dist/release/index.html` | ||
} catch (error) { | ||
throw new Error("Can't find Speedscope package") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work both in tests and with dev shopify
. Is there some packaging magic that could make this not work?
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool project! Excited about this change.
I've added a couple of suggestions around changeset management, 1 of which is blocking change.
I wasn't able to get my 🎩 working, but I'll chock it up to user error and try again tommorow
Are there any edge cases you're aware of that we may want to take note of in case we need to patch / support them in the future?
Hum... I'm a little worried about that error. Can you try w/ the |
I had tried to 🎩 as well and got the same error. The json output is |
@EvilGenius13 what is your store? |
|
`dev shopify theme profile --url https://coded-courses.myshopify.com/` Only opens a browser page for now, no auth.
Since it's used dynamically
And use import.meta.resolve to load Speedscope
And strengthen how we resolve Speedscope
8fa9f2f
to
a0955f7
Compare
Co-authored-by: James Meng <[email protected]>
Co-authored-by: James Meng <[email protected]>
Everything should be working now! We're set to replace https://shopify.dev/docs/storefronts/themes/tools/theme-inspector w/ this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I 🎩 again and it's working both by opening a new window with the speedscope results and also when using --json
to get the output. Also checked with bad routes. Just leaving a super minor question.
env: 'SHOPIFY_FLAG_THEME_ID', | ||
}), | ||
url: Flags.string({ | ||
description: 'The url to be used as context', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor question, when we have the default: /
does that mean if you were to pass the --url
flag without inputting anything after it, that it would default to using /
? I tried that out but it didn't work and was curious if it had another meaning.
WHY are these changes introduced?
https://hackdays.shopify.io/projects/19234
We want to expose Liquid profiling via:
The new
theme profile
command will be called for both. The VSCode extensions will use the--json
flag.WHAT is this pull request doing?
Add a
shopify theme profile --url
command that calls SFR asking for profiling data (using theAccept
header).Left to do
--json
arg.theme dev
command.How to test your changes?
Run
dev shopify theme profile --store [YOUR STORE DOMAIN] --url /
. Should open a browser window with Speedscope in it.Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist