QwikDev / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.qwik.dev
MIT License
13.09k stars 437 forks source link

fix(worker-window): polyfill CSSMediaRule #614

Closed nicksrandall closed 3 months ago

nicksrandall commented 3 months ago

What is it?

Description

Include polyfill for CSSMediaRule (used by hubspot tracking js)

Use cases and why

Hubspot references CSSMediaRule in their JS and it is currently failing because it doesn't exist in worker context. We already have the polyfill for CSSStyleSheet and CSSMediaRule has the same interface so the same polyfill should work!

Checklist:

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
partytown ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 0:02am
nicksrandall commented 3 months ago

Looks like CI had an issue installing PNPM. Can a maintainer please rerun the CI checks on this PR?

nicksrandall commented 3 months ago

@gioboa Do you see any issues with adding this?

gioboa commented 3 months ago

@gioboa Do you see any issues with adding this?

It looks good to me but I'm no longer on the core team that maintains the library. I'm sorry.

nicksrandall commented 3 months ago

I discovered that microsoft clarity has patched this on their end and I'm not sure this solution makes sense as it only polyfilled the bare minimum of what was needed so I'm going to close for now.

lampask commented 2 months ago

In the end, this should still go in. It wasn't patched in clarity and having this polyfilled inside partytown is arguably a better solution.

azurre99 commented 1 month ago

Is there any update on this or some kind of workaround ? I'm having issues with GTM including clarity Screenshot 2024-10-22 at 12 30 21 Screenshot 2024-10-22 at 12 30 42

AndreAzevedoCoder commented 2 weeks ago

I'm still having this issue with clarity, I think it's a good idea to merge this