Comments (6)
I like it for these shorter audits. When the audits get bigger (which I think they will with things like Speed Index, CRP, etc), then I'd be more inclined to see things a little wrapped up, as opposed to a collection of functions, which is what this would probably give us. In any case, whichever way we go, we'll need to be consistent across all the audits.
This approach currently makes it more difficult for us to ensure that an audit correctly sets its name, tags and description as they're not exposed in a testable way. Making them properties of the function would solve that, but then they'd need to be getters (as they currently are in the class) so they can't be overridden, and that's not really then buying us that much.
from lighthouse.
This approach currently makes it more difficult for us to ensure that an audit correctly sets its name, tags and description as they're not exposed in a testable way
IF we export the object, we can just check the shape of the object exported from the audit to verify.
from lighthouse.
I'm a fan of the reorganization. The current implementation seems over-complicated by using inheritance for what is essentially a mixin of a utility function, which we could just as easily require
(although the utility of that utility function is declining as so many arguments get added to it :). Ensuring an Audit
interface would get us a compile-time check of required properties (and if we want to, a runtime check can be put in auditor.js
). Audit utility functions can easily live on auditor.js
(or audit-utilities.js
or whatever) and be imported where needed.
In general I'd really like to avoid inheritance unless there's actually a class hierarchy. The implicit importing of functions causes a good bit of mental overhead without a conceptual model to back it up, while a require
statement is super clear.
from lighthouse.
Yeah. I do admit it's a bit funny that we are agreeing gathers could use stronger base classes, and meanwhile I'm advocating for removing that structure from audits.. but ... so it goes. 😝
from lighthouse.
I see it, and generally I favor composition over inheritance, I just think it's premature to refactor this. When we know more about the stronger base classes I think we should be in a better position to make the call. As it is it feels like we would be choosing without a fuller picture.
from lighthouse.
works for me.
lets get the perf diagnosis moving to see what parts we need to excercise
closing.
from lighthouse.
Related Issues (20)
- TraceElements: `impactedNodes` is not iterable HOT 3
- Allow clicking on timeline images to open the full-size image
- Lighthouse SEO section shows "unable to download a robots.txt file" for every site HOT 5
- layout-shifts `details.headings[n].subHeadings` is missing `valueType: 'node'` HOT 1
- zstd not recognized as compression (new in M123)
- Mobile test should also emulate having a `coarse` pointer device. HOT 6
- How to configure triggered of the end of a navigation?
- Utilize localized failure messages from axe HOT 1
- Excessive style recalcs caused by CSS usage tracking HOT 4
- Improve documentation on standalone mode runners HOT 5
- Page crashes when running test from large DOM.getDocument response HOT 4
- Unexpected changes in main thread time reported around March 8th HOT 8
- Sequential network requests are simulated as parallel and the first rtt is ignored
- Lone surrogate character breaks PSI proto conversion HOT 4
- Was filing bug report when site crashed multiple before I could get the first report in HOT 2
- On certain audited pages, `totalBodyElements` are different from `MainDocumentContent` body nodes count HOT 1
- The Future of WordPress in the Age of AI Integration HOT 2
- Site security issues while making payment to Comcast. HOT 1
- SEO updates from recent search conversations
- Unexpected changes on main thread work from 11.6.0 to 11.7.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lighthouse.