fix(utils): deprecated-api-warnings-from-lighthouse-fixed#697
fix(utils): deprecated-api-warnings-from-lighthouse-fixed#697AlexJohnSadowski wants to merge 4 commits intoQwikDev:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 50d3171 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hey, I was working on the same fix independently ( see #698 ). My PR takes a similar approach but covers an additional code path: readMainInterfaces() also enumerates window properties via Object.getOwnPropertyNames(window), so I added a filter there too. I also used a centralized Set instead of inline strings, and added unit tests. Happy to close mine if you'd rather incorporate those changes into this one, or vice versa, whatever works best for the maintainers. |
|
Hey @SurceBeats, feel free to commit directly to my branch on my fork, so you could earn some contributions as well! :) |
…se penalty Accessing window.SharedStorage and window.AttributionReporting during sandbox initialization triggers Chrome "Deprecated feature used" warnings, which Lighthouse reads and penalizes Best Practices score (~81 instead of 100). Add a maintainable blocklist (DEPRECATED_WINDOW_PROPERTIES) and filter these properties in both isValidMemberName() and readMainInterfaces() to prevent the property access that triggers the warnings. Closes QwikDev#313
|
Update @SurceBeats, I actually had a minute to do it myself, so just cherry-picked your changes from your fork, so your commits are here now :) |
|
No worries about the contributions @AlexJohnSadowski. I mainly wanted to fix it because it was tanking my Astro site’s best practices score. I noticed your PR after I had everything set up, so if this approach solves it, I’m good with it 🙂 PS: Thank you for the update!!!! ❤️ |
Looks like they want you to run prettier on it. Pipeline is failing
|
What is it?
Description
#694
#693
I've noticed that myself and decided to quickly fix it, cause it's dragging my lighthouse score significantly.
Partytown's readImplementationMember() iterates over all window properties and accesses their values to build the platform API map for the web worker and by just simply reading window.sharedStorage, window.attributionReporting, and related properties triggers Chrome deprecation warnings, hence the bugs mentionned from the repo's issues section.
Added these deprecated property names to the isValidMemberName deny list in utils.ts so they're skipped during introspection. I noticed the same approach used for the Event.path fix in PR #328, so it should be a good-enough band-aid for now, cause it's TANKING the score.
BEFORE:
AFTER

The warnings are gone.
Use cases and why
Cause it's dragging the beautiful green lighthouse score to the orange one and it triggers my OCD.
Checklist: