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
#8030: add slow/bad selector analysis warnings #8031
Conversation
@@ -197,12 +197,12 @@ msobservers.initialize = function (selector, callback, options) { | |||
}); | |||
|
|||
// Observe the target element. | |||
var defaultObeserverOpts = { | |||
var defaultObserverOpts = { |
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.
Just fixing a spelling mistake
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8031 +/- ##
==========================================
+ Coverage 72.98% 73.09% +0.10%
==========================================
Files 1307 1308 +1
Lines 40588 40711 +123
Branches 7538 7574 +36
==========================================
+ Hits 29625 29756 +131
+ Misses 10963 10955 -8 ☔ View full report in Codecov by Sentry. |
} | ||
} | ||
|
||
override visitBrick( |
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.
It seems like some of the visiting logic could be refactored to a common util as it's not specific to selector analysis.
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.
There's some assumptions in there, e.g., only checking string typed values that aren't general. It will be good to generalize in the future in a base class. See PR's discussion section, we'll likely want a base class implementation that provides a visitValueWithSchema or similar method
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.
likely want a base class implementation that provides a visitValueWithSchema or similar method
That's what I had in mind, yea.
await super.run(component); | ||
} | ||
|
||
checkAction(component: ActionFormState): void { |
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: Looks like checkTrigger
is very similar to this method and we could extract some common logic or helper methods.
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.
Agree there's duplication, but there's enough differences (in the path, message, and etc.) I think that abstracting it will be harder to read vs. just repeating the lines of code. If we add any other brick types, would definitely look to abstract
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
Reviewer Notes
Discussion
Demo
Future Work
pixiebrix-extension/src/utils/inference/selectorInference.ts
Line 79 in 641e539
:nth-child
)Checklist