GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.19k stars 9.34k forks source link

Add `fetch` polyfill detection to Legacy javascript audit #10775

Open prateekbh opened 4 years ago

prateekbh commented 4 years ago

Feature request summary the LegacyJavascript audit currently checks for core-js polyfills. https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/audits/legacy-javascript.js#L166-L245

I assume they are aimed at finding stuff no long needed in script type=module compatible browsers. While that list is pretty exhaustive it misses fetch.

Fetch could be shipped by https://polyfill.io/v3/polyfill.min.js?features=fetch or https://www.npmjs.com/package/isomorphic-fetch or https://github.com/github/fetch etc

What is the motivation or use case for changing this? Completness of the feature set for detecting legacy javascript.

How is this beneficial to Lighthouse? It calls out the unnecessary bytes shipped to the browser which doesnt require the polyfill.

brendankenny commented 2 years ago

Seems reasonable to me! Especially now, two years later