Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@qwik.dev/partytown

BuilderIO113.5kMIT0.11.1TypeScript support: included

Relocate resource intensive third-party scripts off of the main thread and into a web worker.

web worker, 3rd-party, third-party, analytics, webapp, performance, lighthouse, core web vitals, react

readme

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

  • Qwik: An open-source framework designed for best possible time to interactive, by focusing on resumability of server-side-rendering of HTML, and fine-grained lazy-loading of code.
  • Mitosis: Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.
  • Builder: Drag and drop page builder and CMS for React, Vue, Angular, and more.


<picture> <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/844291/230786554-eb225eeb-2f6b-4286-b8c2-535b1131744a.png"> Made with love by Builder.io </picture>

changelog

@qwik.dev/partytown

0.11.1

Patch Changes

  • Add adoptedStyleSheets.get() to patched document in worker. (by @leeroybrun in #674)

0.11.0

Minor Changes

  • Bunch of fixes and a new release system.. (by @shairez in #652)

    Here's a list of the changes:

    FEATURES

    • add config fallback timeout (#620)

    FIXES

    • Same-origin iframe set/get cookie/localStorage bug (#600)
    • make sure unknown is mapped to HTMLUnknownElement cstr (#606)

    DOCS

    • making install commands consistent (#638)
    • Add example reverse proxy handler for Facebook Pixel (#648)
    • add integration module for Magento 2 (#594)
    • add clarification that the worker strategy is not supported with app directory (#625)
    • use dummy web property ID (#621)
    • revert recent incorrect change to SvelteKit destination (#622)