Skip to content

fix(utils): deprecated-api-warnings-from-lighthouse-fixed#697

Open
AlexJohnSadowski wants to merge 4 commits intoQwikDev:mainfrom
AlexJohnSadowski:fix/utils/deprecated-api-warnings-from-lighthouse
Open

fix(utils): deprecated-api-warnings-from-lighthouse-fixed#697
AlexJohnSadowski wants to merge 4 commits intoQwikDev:mainfrom
AlexJohnSadowski:fix/utils/deprecated-api-warnings-from-lighthouse

Conversation

@AlexJohnSadowski
Copy link

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

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:

image

AFTER
The warnings are gone.
image

Use cases and why

Cause it's dragging the beautiful green lighthouse score to the orange one and it triggers my OCD.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation.
  • Added new tests to cover the fix / functionality -> I built it, linked it and checked it myself on my pet project that had the same issue.

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: 50d3171

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@qwik.dev/partytown Patch

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

@SurceBeats
Copy link

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.

@AlexJohnSadowski
Copy link
Author

Hey @SurceBeats, feel free to commit directly to my branch on my fork, so you could earn some contributions as well! :)
I think we can just have one pull request for that issue. Wasn't adding the other path, cause I saw it's specifically the method from the utils tanking my score, but we can get the other path covered as well - no problemo

SurceBeats and others added 2 commits February 26, 2026 14:59
…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
@AlexJohnSadowski
Copy link
Author

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 :)

@SurceBeats
Copy link

SurceBeats commented Feb 26, 2026

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!!!! ❤️

@418labllc
Copy link

418labllc commented Mar 16, 2026

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

[warn] Code style issues found in the above file. Run Prettier with --write to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants