-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(replay): @puppeteer/replay stringify extension #14146
Conversation
lighthouse-core/test/fraggle-rock/scenarios/stringified-replay-test-pptr.js
Outdated
Show resolved
Hide resolved
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.
Can you add a description of what a stringify extension is and how this is expected to be used? Are people going to call this code? DT integration?
@@ -46,6 +46,7 @@ jobs: | |||
|
|||
- run: yarn install --frozen-lockfile --network-timeout 1000000 | |||
- run: yarn build-report | |||
- run: yarn reset-link |
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.
is this required to run unit tests after this change?
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.
Yes
@@ -0,0 +1,102 @@ | |||
{ |
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.
what are you thinking about updating these as the replay library changes?
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.
IMO the JSON is small enough where we can make changes manually.
lighthouse-core/test/fraggle-rock/scenarios/stringified-replay-test-pptr.js
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,485 @@ | |||
// Jest Snapshot v1, https://goo.gl/fbAQLP | |||
|
|||
exports[`Running the stringified output script generates a valid desktop flow report 1`] = ` |
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 like a lot of this is snapshotting @puppeteer/replay
code
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.
Yeaaaaah...
The unit test file does some trimming to get rid of a lot of the boilerplait stuff. However, I wanted some tests to validate the entire output though, just so we know what @puppeteer/replay changes when we bump versions.
@@ -7612,6 +7640,19 @@ yargs@16.2.0, yargs@^16.1.1, yargs@^16.2.0: | |||
y18n "^5.0.5" | |||
yargs-parser "^20.2.2" | |||
|
|||
yargs@17.5.1: |
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.
unfortunate that we are now adding another yargs + all this other CLI color crap to our deps with this PR.
At the very least, we could see about upgrading to latest yargs to reduce this a bit. I'll try this now.
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 recently made changes to Server (static-server
), so should update from master first.
🔒 Doc
@puppeteer/replay stringify will take a user flow JSON as input, and output a standalone Puppeteer script. We can use the stringify extension api to inject Lighthouse user flow code into the output script.
The intent is for this to be rolled into DevTools, and used to add an "Export as Puppeteer script w/ Lighthouse" option to the list of export options. We could also support users importing this extension themselves, but that is not 100% necessary at this time.