partytown README

The project's README from github.com/QwikDev/partytown. As one markdown file: README.md.

Partytown 🎉

Partytown github fit 2x

A fun location for your third-party scripts to hang out

Partytown is a lazy-loaded library to help relocate resource intensive scripts into a web worker, and off of the main thread. Its goal is to help speed up sites by dedicating the main thread to your code, and offloading third-party scripts to a web worker.

Note: Partytown is still in beta and not guaranteed to work in every scenario. Please see our FAQ and Trade-Off sections for more info.

The philosophy is that the main thread should be dedicated to your code, and any scripts that are not required to be in the critical path should be moved to a web worker. Main thread performance is, without question, more important than web worker thread performance.

Without Partytown and With Partytown: Your code and third-party code compete for main thread resources

Community



Made with love by Builder.io

partytown (QwikDev/partytown)

Searching Database…

13.8K ·GitHub
What is this?Partytown is a lazy-loaded library that relocates resource-intensive third-party scripts off the main thread and into a web worker, so your own code gets the main thread.
Is it a framework or a library?It is a library you drop into a webpage, not a framework; it hooks third-party ` ` tags and proxies their DOM access into a web worker.
How do I add it to a project?You add Partytown to your site following the Getting Started guide, and there are ready-made integrations for popular frameworks and page builders.
What do I need to run or build it?It requires Node >=18 to build/develop; for a web page you just include Partytown's worker script, no backend dependencies are listed.
Does it work for every third-party script out of the box?No — the project is explicitly still in beta and not guaranteed to work in every scenario, with documented trade-offs to review before relying on it.
Where does this run — in the browser?It runs entirely in the browser, using a web worker as the execution environment for the offloaded scripts.
What kinds of scripts is this meant for?Typically analytics, ads, and other third-party embeds that are heavy but not part of your core app logic — moving them to a worker keeps the main thread free for your own code.
Why does moving scripts to a web worker help performance?Scripts running on the main thread compete with your app's rendering and interactivity; Partytown proxies DOM access so these scripts execute in a web worker instead, improving metrics like Lighthouse and Core Web Vitals.
Are there ready-made integrations for popular frameworks?Yes, Partytown ships an Integrations section covering common setups so you don't have to wire the worker proxying by hand.
Creator
QwikDev
Size
22.7 MB
Stars
13.8K
Age
5y
Commits · 90 Days