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(fr): initial gatherer migration for snapshot, navigation #11993
Conversation
@@ -30,10 +30,6 @@ function remoteObjectToString(obj) { | |||
return `[${type} ${className}]`; | |||
} | |||
|
|||
/** | |||
* @implements {LH.Gatherer.GathererInstance} | |||
* @implements {LH.Gatherer.FRGathererInstance} |
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.
This seemed unnecessary.
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.
Depends on how explicit we want to be with knowing whether each gatherer supports FR and legacy or not :)
I erred on the side of "it's not yet obvious enough that a require('../../fraggle-rock/gather/base-gatherer.js');
at the top means this gatherer supports both APIs", but if everyone on the team feels it's already clear, wfm 👍
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 would prefer keeping this around to keep it more explicit. The @implements
was helpful when reviewing.
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.
const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
class ... extends FRGatherer
?
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.
That works for me.
One possible issue is that I already knew FRGatherer
supports legacy mode. Probably not a big deal, I was mostly worried about missing the require('../../fraggle-rock/gather/base-gatherer.js');
at the top of the file.
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.
LGTM, though would love for someone else on the team who I haven't explained anything to if the @implements
is helpful for their understanding/clarity.
@adamraine perhaps? :)
@@ -5,35 +5,40 @@ | |||
*/ | |||
'use strict'; | |||
|
|||
const Gatherer = require('./gatherer.js'); | |||
const Gatherer = require('../../fraggle-rock/gather/base-gatherer.js'); | |||
|
|||
/** | |||
* @fileoverview Tracks unused CSS rules. | |||
*/ | |||
class CSSUsage extends Gatherer { |
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.
Conceptually, I don't think this should be a snapshot gatherer. Let's flag it in the FR issue for discussion and a potential rewrite soon?
const driver = passContext.driver; | ||
|
||
await driver.sendCommand('DOM.enable'); | ||
await driver.defaultSession.sendCommand('DOM.enable'); |
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.
hm, unrelated but that's weird why do we enable/disable DOM if everything is in driver.evaluate
anyway? 🤔
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.
removed
const driver = passContext.driver; | ||
|
||
const formElements = await driver.evaluate(collectFormElements, { |
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.
nit: revert
when I see this structure I assume it's because there was a time where debugging this was necessary and console.log(formElements)
seems useful + easy to keep :)
shoot @connorjclark I forgot to ask you to add these to the fraggle rock default config so we can check for any errors, could you pick that up next? |
ya |
This migrates the gatherers (14) that only use
afterPass
, the interface already supported byFRTransitionalContext
, and noloadData
.ref #11313