partytown
Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
What is partytown?
Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
Overview of partytown
What it is
Partytown is a lazy-loaded library that relocates resource-intensive third-party scripts from the main thread to a web worker. Its goal is to speed up websites by dedicating the main thread to your own code and offloading third-party scripts to a web worker. The library is not guaranteed to work in every scenario; users should consult the FAQ and Trade-Off sections for more information.
Key features
- Relocates resource-intensive third-party scripts into a web worker
- Lazy-loaded to avoid blocking the main thread
- Frees the main thread for your own code, improving performance
- Supports sync communication between the main thread and web worker (as described in the project's blog)
Use cases
- Moving analytics scripts (e.g., Google Analytics, Facebook Pixel) off the main thread
- Offloading third-party integrations that are not critical to the initial page load
- Improving time-to-interactive by reducing main thread congestion caused by third-party scripts
Getting started
See the repository README for installation and quick-start instructions.
License and pricing
Partytown is open source under the MIT license. There is no stated pricing; it is free to use.
Based on the project's public README and repository metadata.