-
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
FR: Allow external API calls #5547
Comments
Thanks @rviscomi! Just curious what prompted the "there's consideration to allow external API calls in audits" :) Some of the counter-arguments for why we should require all functionality to be part of LH in no particular order:
|
What's the gap between #4359 (or actually #5446 more specifically) and what you're describing? |
@kdzwinel mentioned that it came up in a recent eng meeting. I don't have much context.
No strong opposition to any of these points. All good things to keep in mind but I don't think any of them are necessarily prohibitive to the FR.
Quite a large gap actually. Our initial SD audit focuses only on very basic validation of JSON-LD. The Structured Data Testing Tool for example handles more advanced validation of JSON-LD as well as other SD formats like Microdata and RDFa. |
Currently we dont see a great way to do this and support it across DevTools/CLI/ext/Lightrider/etc. Complications
Other options
|
In conclusion, we want to remain local only on the Lighthouse side, though a specific compelling case may someday change that. However, plugins open an opportunity for non-local services to be used. Plugins are just node modules and so can do what they wish, including connecting to external APIs, and so could provide extra processing or feedback (e.g. calling out to the Structured Data Testing Tool). |
Feature request
I hear there's consideration to allow external API calls in audits. I wanted to create this FR to open up the discussion for anyone else who wants to follow along.
Summary
Rearchitect Lighthouse audits to be able to support async network calls like external APIs.
For example, in the JS vulnerability audit we're maintaining a version of the Snyk vulnerability DB. This was an intentional decision to keep the LH code self-contained and not rely on async API calls over the network. I'm curious if this guideline might be relaxed.
What is the motivation or use case for changing this?
There is no single open source project that validates structured data, similar to how aXe validates a11y. It may be more feasible to hook into a structured data validation API than to create a new open source project. This would allow the audit to provide rich suggestions and also not have to include any additional code dependencies.
How is this beneficial to Lighthouse?
This enables LH audits to make use of external projects like structured data, accessibility, or vulnerability data without requiring the projects to be open source, compatible, and bundled with LH. This could give us access to more high quality audits.
The text was updated successfully, but these errors were encountered: