Repository: QwikDev/partytown Branch: main Commit: bf2a980f205e Files: 437 Total size: 18.3 MB Directory structure: gitextract_d9ts_aht/ ├── .changeset/ │ ├── README.md │ ├── changelog-github-custom.cjs │ ├── changelog-github-custom.ts │ └── config.json ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug.yaml │ │ ├── docs_suggestion.yml │ │ └── feature.yaml │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows/ │ ├── ci.yml │ ├── linter.yml │ ├── pr.yml │ └── release.yml ├── .gitignore ├── .nvmrc ├── .prettierignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bin/ │ └── partytown.cjs ├── docs/ │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc.js │ ├── .vscode/ │ │ ├── launch.json │ │ ├── qwik-router.code-snippets │ │ └── qwik.code-snippets │ ├── README.md │ ├── adapters/ │ │ └── cloudflare-pages/ │ │ └── vite.config.mts │ ├── package.json │ ├── postcss.config.cjs │ ├── public/ │ │ ├── _headers │ │ ├── _redirects │ │ ├── manifest.json │ │ └── robots.txt │ ├── qwik.env.d.ts │ ├── recma-provide-components.ts │ ├── src/ │ │ ├── components/ │ │ │ ├── Aside/ │ │ │ │ └── Aside.tsx │ │ │ ├── CodeSnippet/ │ │ │ │ └── CodeSnippet.tsx │ │ │ ├── Footer/ │ │ │ │ └── Footer.tsx │ │ │ ├── Header/ │ │ │ │ └── Header.tsx │ │ │ ├── Highlight/ │ │ │ │ └── Highlight.tsx │ │ │ ├── Icons/ │ │ │ │ ├── CloseIcon.tsx │ │ │ │ ├── GitHubIcon.tsx │ │ │ │ ├── MenuIcon.tsx │ │ │ │ ├── ThemeDarkIcon.tsx │ │ │ │ └── ThemeLightIcon.tsx │ │ │ ├── MdxComponents/ │ │ │ │ └── MdxComponents.tsx │ │ │ ├── RouterHead/ │ │ │ │ └── RouterHead.tsx │ │ │ ├── ThemeSelector/ │ │ │ │ └── ThemeSelector.tsx │ │ │ └── Toc/ │ │ │ └── Toc.tsx │ │ ├── config.ts │ │ ├── entry.cloudflare-pages.tsx │ │ ├── entry.dev.tsx │ │ ├── entry.preview.tsx │ │ ├── entry.ssr.tsx │ │ ├── global.scss │ │ ├── root.tsx │ │ ├── routes/ │ │ │ ├── 404.tsx │ │ │ ├── angular/ │ │ │ │ └── index.mdx │ │ │ ├── astro/ │ │ │ │ └── index.mdx │ │ │ ├── atomics/ │ │ │ │ └── index.mdx │ │ │ ├── browser-support/ │ │ │ │ └── index.mdx │ │ │ ├── common-services/ │ │ │ │ └── index.mdx │ │ │ ├── configuration/ │ │ │ │ └── index.mdx │ │ │ ├── copy-library-files/ │ │ │ │ └── index.mdx │ │ │ ├── cross-origin/ │ │ │ │ └── index.ts │ │ │ ├── debugging/ │ │ │ │ └── index.mdx │ │ │ ├── distribution/ │ │ │ │ └── index.mdx │ │ │ ├── drupal/ │ │ │ │ └── index.mdx │ │ │ ├── facebook-pixel/ │ │ │ │ └── index.mdx │ │ │ ├── faq/ │ │ │ │ └── index.mdx │ │ │ ├── forwarding-events/ │ │ │ │ └── index.mdx │ │ │ ├── gatsby/ │ │ │ │ └── index.mdx │ │ │ ├── getting-started/ │ │ │ │ └── index.mdx │ │ │ ├── google-tag-manager/ │ │ │ │ └── index.mdx │ │ │ ├── how-does-partytown-work/ │ │ │ │ └── index.mdx │ │ │ ├── html/ │ │ │ │ └── index.mdx │ │ │ ├── index.mdx │ │ │ ├── integrations/ │ │ │ │ └── index.mdx │ │ │ ├── layout.tsx │ │ │ ├── magento2/ │ │ │ │ └── index.mdx │ │ │ ├── menu.md │ │ │ ├── nextjs/ │ │ │ │ └── index.mdx │ │ │ ├── nuxt/ │ │ │ │ └── index.mdx │ │ │ ├── partytown-scripts/ │ │ │ │ └── index.mdx │ │ │ ├── proxying-requests/ │ │ │ │ └── index.mdx │ │ │ ├── react/ │ │ │ │ └── index.mdx │ │ │ ├── remix/ │ │ │ │ └── index.mdx │ │ │ ├── sandboxing/ │ │ │ │ └── index.mdx │ │ │ ├── shopify-hydrogen/ │ │ │ │ └── index.mdx │ │ │ ├── shopify-os2/ │ │ │ │ └── index.mdx │ │ │ ├── solid/ │ │ │ │ └── index.mdx │ │ │ ├── sveltekit/ │ │ │ │ └── index.mdx │ │ │ └── trade-offs/ │ │ │ └── index.mdx │ │ ├── types.ts │ │ └── utils/ │ │ └── cn.ts │ ├── tailwind.config.js │ ├── tsconfig.json │ └── vite.config.mts ├── package.json ├── playwright.atomics.config.ts ├── playwright.config.ts ├── scripts/ │ ├── build-api.ts │ ├── build-atomics.ts │ ├── build-integration.ts │ ├── build-main-snippet.ts │ ├── build-media-implementations.ts │ ├── build-react.ts │ ├── build-service-worker.ts │ ├── build-services.ts │ ├── build-utils.ts │ ├── build-web-worker.ts │ ├── index.ts │ ├── minify.ts │ ├── rollup.config.js │ ├── serve.cjs │ ├── server.cjs │ └── utils.ts ├── src/ │ ├── integration/ │ │ ├── api-extractor.json │ │ ├── api.md │ │ ├── index.ts │ │ ├── package.json │ │ └── snippet.ts │ ├── lib/ │ │ ├── atomics/ │ │ │ ├── sync-create-messenger-atomics.ts │ │ │ └── sync-send-message-to-main-atomics.ts │ │ ├── build-modules/ │ │ │ ├── sync-create-messenger.ts │ │ │ ├── sync-send-message-to-main.ts │ │ │ ├── version.ts │ │ │ ├── web-worker-blob.ts │ │ │ └── web-worker-url.ts │ │ ├── log.ts │ │ ├── main/ │ │ │ ├── snippet-entry.ts │ │ │ └── snippet.ts │ │ ├── sandbox/ │ │ │ ├── index.ts │ │ │ ├── main-access-handler.ts │ │ │ ├── main-constants.ts │ │ │ ├── main-custom-element.ts │ │ │ ├── main-forward-trigger.ts │ │ │ ├── main-globals.ts │ │ │ ├── main-instances.ts │ │ │ ├── main-register-window.ts │ │ │ ├── main-serialization.ts │ │ │ ├── on-messenge-from-worker.ts │ │ │ ├── read-main-platform.ts │ │ │ └── read-main-scripts.ts │ │ ├── service-worker/ │ │ │ ├── fetch.ts │ │ │ ├── index.ts │ │ │ ├── sync-create-messenger-sw.ts │ │ │ └── sync-send-message-to-main-sw.ts │ │ ├── types.ts │ │ ├── utils.ts │ │ └── web-worker/ │ │ ├── index.ts │ │ ├── init-web-worker.ts │ │ ├── media/ │ │ │ ├── bridge.ts │ │ │ ├── canvas.ts │ │ │ ├── index.ts │ │ │ ├── media.ts │ │ │ └── utils.ts │ │ ├── worker-anchor.ts │ │ ├── worker-constants.ts │ │ ├── worker-constructors.ts │ │ ├── worker-css-style-declaration.ts │ │ ├── worker-custom-elements.ts │ │ ├── worker-document.ts │ │ ├── worker-element.ts │ │ ├── worker-environment.ts │ │ ├── worker-exec.ts │ │ ├── worker-form.ts │ │ ├── worker-forwarded-trigger.ts │ │ ├── worker-iframe.ts │ │ ├── worker-image.ts │ │ ├── worker-location.ts │ │ ├── worker-media.ts │ │ ├── worker-named-node-map.ts │ │ ├── worker-navigator.ts │ │ ├── worker-node.ts │ │ ├── worker-performance.ts │ │ ├── worker-proxy.ts │ │ ├── worker-script.ts │ │ ├── worker-serialization.ts │ │ ├── worker-src-element.ts │ │ ├── worker-state.ts │ │ ├── worker-storage.ts │ │ ├── worker-style.ts │ │ ├── worker-svg.ts │ │ └── worker-window.ts │ ├── modules.d.ts │ ├── react/ │ │ ├── api-extractor.json │ │ ├── api.md │ │ ├── index.ts │ │ ├── package.json │ │ └── snippet.tsx │ ├── services/ │ │ ├── api-extractor.json │ │ ├── api.md │ │ ├── facebook-pixel.ts │ │ ├── freshpaint.ts │ │ ├── google-tag-manager.ts │ │ ├── index.ts │ │ └── package.json │ └── utils/ │ ├── api-extractor.json │ ├── api.md │ ├── copy-lib-files.ts │ ├── fs.ts │ ├── index.ts │ ├── package.json │ ├── rollup.ts │ └── vite.ts ├── tests/ │ ├── 404.html │ ├── atomics/ │ │ └── index.html │ ├── benchmarks/ │ │ ├── benchmark.js │ │ ├── index.html │ │ ├── run.cjs │ │ └── services/ │ │ └── index.html │ ├── index.html │ ├── integrations/ │ │ ├── clarity/ │ │ │ ├── clarity.bundle.js │ │ │ ├── clarity.spec.ts │ │ │ ├── index.html │ │ │ └── standard.html │ │ ├── config/ │ │ │ ├── config.spec.ts │ │ │ └── index.html │ │ ├── event-forwarding/ │ │ │ ├── event-forwarding.spec.ts │ │ │ └── index.html │ │ ├── facebook-pixel/ │ │ │ ├── facebook-pixel.spec.ts │ │ │ ├── index.html │ │ │ └── standard.html │ │ ├── full-story/ │ │ │ ├── full-story.spec.ts │ │ │ ├── gtm-fullstory.html │ │ │ ├── index.html │ │ │ └── standard.html │ │ ├── gtm/ │ │ │ ├── gtag.js │ │ │ ├── gtm.js │ │ │ ├── gtm.spec.ts │ │ │ ├── index.html │ │ │ ├── preserve-behavior.html │ │ │ └── standard.html │ │ ├── hubspot/ │ │ │ ├── 20632911.js │ │ │ ├── analytics-20632911.js │ │ │ ├── banner-20632911.js │ │ │ ├── collectedforms.js │ │ │ ├── forms-standard.html │ │ │ ├── forms.html │ │ │ ├── hubspot.spec.ts │ │ │ ├── leadflows.js │ │ │ ├── scripts-20632911.js │ │ │ └── shell.js │ │ ├── intercom/ │ │ │ ├── app-modern.e4d2d085.js │ │ │ ├── frame-modern.5069da72.js │ │ │ ├── index.html │ │ │ ├── shim.latest.js │ │ │ ├── standard.html │ │ │ ├── vendor-modern.d054d6ff.js │ │ │ └── vendors~app-modern.c7bfd661.js │ │ ├── javascript-request/ │ │ │ ├── execute.js │ │ │ ├── index.html │ │ │ ├── javascript-request.spec.ts │ │ │ └── some-text.txt │ │ ├── jquery/ │ │ │ ├── index.html │ │ │ ├── jquery.js │ │ │ ├── jquery.spec.ts │ │ │ └── standard.html │ │ ├── kiwisizing/ │ │ │ ├── index.html │ │ │ ├── kiwisizing.SizingPlugin.js │ │ │ ├── kiwisizing.spec.ts │ │ │ ├── shopify-dynamic-checkout.js │ │ │ └── standard.html │ │ ├── load-scripts-on-main-thread/ │ │ │ ├── background-test-script.js │ │ │ ├── index.html │ │ │ ├── load-scripts-on-main-thread.spec.ts │ │ │ ├── regex-test-script.js │ │ │ ├── snippet.html │ │ │ ├── test-script.js │ │ │ └── wait-for-class.js │ │ ├── main-window-accessors/ │ │ │ ├── index.html │ │ │ └── main-window-accessors.spec.ts │ │ ├── mermaid/ │ │ │ ├── index.html │ │ │ ├── mermaid.js │ │ │ ├── mermaid.spec.ts │ │ │ └── standard.html │ │ ├── twitter/ │ │ │ ├── index.html │ │ │ ├── standard.html │ │ │ ├── twitter.spec.ts │ │ │ └── widgets.js │ │ ├── underoutfit/ │ │ │ ├── index.html │ │ │ └── standard.html │ │ ├── underoutfit_kiwi/ │ │ │ ├── index.html │ │ │ ├── kiwisizing.SizingPlugin.js │ │ │ └── standard.html │ │ └── wistia/ │ │ ├── E-v1.js │ │ ├── assets/ │ │ │ └── external/ │ │ │ ├── airplay.js │ │ │ ├── engines/ │ │ │ │ ├── hls_video.js │ │ │ │ ├── manual_quality_video.js │ │ │ │ └── native_hls_video.js │ │ │ ├── playPauseLoadingControl.js │ │ │ ├── vulcanV2Player/ │ │ │ │ └── video/ │ │ │ │ ├── controls/ │ │ │ │ │ └── VolumeSliderControl/ │ │ │ │ │ └── VolumeSliderControl.js │ │ │ │ └── ui_components/ │ │ │ │ └── Storyboard.js │ │ │ └── wistia-mux.js │ │ ├── embed/ │ │ │ └── medias/ │ │ │ └── varrf62cw4.json │ │ ├── index.html │ │ ├── standard.html │ │ └── varrf62cw4.jsonp │ ├── nextjs/ │ │ ├── README.md │ │ ├── next.config.js │ │ ├── nextjs.spec.ts │ │ ├── package.json │ │ ├── pages/ │ │ │ ├── _app.js │ │ │ └── index.js │ │ └── playwright.nextjs.ts │ ├── platform/ │ │ ├── anchor/ │ │ │ ├── anchor.spec.ts │ │ │ └── index.html │ │ ├── audio/ │ │ │ ├── audio-scripts.js │ │ │ ├── audio.spec.ts │ │ │ └── index.html │ │ ├── canvas/ │ │ │ ├── canvas.spec.ts │ │ │ └── index.html │ │ ├── custom-element/ │ │ │ ├── custom-element.spec.ts │ │ │ └── index.html │ │ ├── document/ │ │ │ ├── current-script-src.js │ │ │ ├── document.spec.ts │ │ │ └── index.html │ │ ├── document-prod/ │ │ │ ├── current-script-src.js │ │ │ ├── document-prod.spec.ts │ │ │ └── index.html │ │ ├── element/ │ │ │ ├── element.spec.ts │ │ │ └── index.html │ │ ├── element-class/ │ │ │ ├── element-class.spec.ts │ │ │ └── index.html │ │ ├── element-style/ │ │ │ ├── element-style.spec.ts │ │ │ └── index.html │ │ ├── error/ │ │ │ ├── error.spec.ts │ │ │ └── index.html │ │ ├── event/ │ │ │ ├── event.spec.ts │ │ │ └── index.html │ │ ├── fetch/ │ │ │ ├── data.json │ │ │ ├── fetch.spec.ts │ │ │ ├── index.html │ │ │ └── text.txt │ │ ├── form/ │ │ │ ├── form.spec.ts │ │ │ └── index.html │ │ ├── history/ │ │ │ ├── history.spec.ts │ │ │ ├── iframe-history.html │ │ │ └── index.html │ │ ├── iframe/ │ │ │ ├── call-fn-on-parent.js │ │ │ ├── content.html │ │ │ ├── cookie.html │ │ │ ├── current-script.js │ │ │ ├── external-js.html │ │ │ ├── external.js │ │ │ ├── fn-on-window.js │ │ │ ├── global-var.html │ │ │ ├── iframe-cookie-localstorage.spec.ts │ │ │ ├── iframe1.spec.ts │ │ │ ├── iframe2.spec.ts │ │ │ ├── index-cookie-localstorage.html │ │ │ ├── index.html │ │ │ ├── index2.html │ │ │ ├── localstorage.html │ │ │ ├── location1.html │ │ │ ├── location2.html │ │ │ ├── location2.js │ │ │ ├── no-deadlock.html │ │ │ ├── no-deadlock.js │ │ │ ├── no-global-share.html │ │ │ ├── no-global-share.js │ │ │ ├── onload.js │ │ │ ├── parent-window.js │ │ │ ├── post-message.html │ │ │ ├── src-change1.html │ │ │ └── src-change2.html │ │ ├── image/ │ │ │ ├── image.spec.ts │ │ │ └── index.html │ │ ├── intersection-observer/ │ │ │ ├── index.html │ │ │ └── intersection-observer.spec.ts │ │ ├── klaviyo/ │ │ │ ├── current-script-src.js │ │ │ ├── document.spec.ts │ │ │ └── index.html │ │ ├── multiple-tabs/ │ │ │ ├── index.html │ │ │ └── multiple-tabs.spec.ts │ │ ├── mutation-observer/ │ │ │ ├── index.html │ │ │ └── mutation-observer.spec.ts │ │ ├── navigator/ │ │ │ ├── api.js │ │ │ ├── index.html │ │ │ └── navigator.spec.ts │ │ ├── no-partytown-script/ │ │ │ ├── index.html │ │ │ └── no-partytown-script.spec.ts │ │ ├── node/ │ │ │ ├── index.html │ │ │ └── node.spec.ts │ │ ├── node-list/ │ │ │ ├── index.html │ │ │ └── node-list.spec.ts │ │ ├── resize-observer/ │ │ │ ├── index.html │ │ │ └── resize-observer.spec.ts │ │ ├── screen/ │ │ │ ├── index.html │ │ │ └── screen.spec.ts │ │ ├── script/ │ │ │ ├── async-1.js │ │ │ ├── async-2.js │ │ │ ├── defer-1.js │ │ │ ├── defer-2.js │ │ │ ├── index.html │ │ │ ├── jsonp-a.js │ │ │ ├── jsonp-b.js │ │ │ ├── jsonp-c.js │ │ │ ├── script-1.js │ │ │ ├── script.spec.ts │ │ │ ├── set-get-attr.js │ │ │ └── source-mapping-url.js │ │ ├── storage/ │ │ │ ├── index.html │ │ │ ├── storage-access.html │ │ │ ├── storage-access.spec.ts │ │ │ └── storage.spec.ts │ │ ├── style/ │ │ │ ├── index.html │ │ │ └── style.spec.ts │ │ ├── svg/ │ │ │ ├── index.html │ │ │ └── svg.spec.ts │ │ ├── video/ │ │ │ ├── index.html │ │ │ └── video.spec.__ts │ │ └── window/ │ │ ├── index.html │ │ └── window.spec.ts │ ├── react-app/ │ │ ├── package.json │ │ ├── public/ │ │ │ └── index.html │ │ ├── src/ │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── index.css │ │ │ ├── index.tsx │ │ │ └── react-app-env.d.ts │ │ └── tsconfig.json │ └── unit/ │ ├── forward.spec.ts │ ├── html-replace.spec.ts │ ├── integration.spec.ts │ ├── snippet.spec.ts │ ├── utils.spec.ts │ ├── utils.ts │ ├── worker-exec.spec.ts │ └── worker-image.spec.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .changeset/README.md ================================================ # Changesets Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets) We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) ================================================ FILE: .changeset/changelog-github-custom.cjs ================================================ 'use strict'; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator['throw'](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [], }, f, y, t, g; return ( (g = { next: verb(0), throw: verb(1), return: verb(2) }), typeof Symbol === 'function' && (g[Symbol.iterator] = function () { return this; }), g ); function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError('Generator is already executing.'); while ((g && ((g = 0), op[0] && (_ = 0)), _)) try { if ( ((f = 1), y && (t = op[0] & 2 ? y['return'] : op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) ) return t; if (((y = 0), t)) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if ( !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2) ) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports, '__esModule', { value: true }); // @ts-ignore var get_github_info_1 = require('@changesets/get-github-info'); var dotenv_1 = require('dotenv'); (0, dotenv_1.config)(); var changelogFunctions = { getDependencyReleaseLine: function (changesets, dependenciesUpdated, options) { return __awaiter(void 0, void 0, void 0, function () { var changesetLink, _a, updatedDepenenciesList; return __generator(this, function (_b) { switch (_b.label) { case 0: if (!options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } if (dependenciesUpdated.length === 0) return [2 /*return*/, '']; _a = '- Updated dependencies ['.concat; return [ 4 /*yield*/, Promise.all( changesets.map(function (cs) { return __awaiter(void 0, void 0, void 0, function () { var links; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!cs.commit) return [3 /*break*/, 2]; return [ 4 /*yield*/, (0, get_github_info_1.getInfo)({ repo: options.repo, commit: cs.commit, }), ]; case 1: links = _a.sent().links; return [2 /*return*/, links.commit]; case 2: return [2 /*return*/]; } }); }); }), ), ]; case 1: changesetLink = _a.apply('- Updated dependencies [', [ _b .sent() .filter(function (_) { return _; }) .join(', '), ']:', ]); updatedDepenenciesList = dependenciesUpdated.map(function (dependency) { return ' - '.concat(dependency.name, '@').concat(dependency.newVersion); }); return [ 2 /*return*/, __spreadArray([changesetLink], updatedDepenenciesList, true).join('\n'), ]; } }); }); }, getReleaseLine: function (changeset, type, options) { return __awaiter(void 0, void 0, void 0, function () { var prFromSummary, commitFromSummary, usersFromSummary, replacedChangelog, linkifyIssueHints, _a, firstLine, futureLines, links, users, suffix, emojiFirstline; return __generator(this, function (_b) { switch (_b.label) { case 0: if (!options || !options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } usersFromSummary = []; replacedChangelog = changeset.summary .replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, function (_, pr) { var num = Number(pr); if (!isNaN(num)) prFromSummary = num; return ''; }) .replace(/^\s*commit:\s*([^\s]+)/im, function (_, commit) { commitFromSummary = commit; return ''; }) .replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, function (_, user) { usersFromSummary.push(user); return ''; }) .trim(); linkifyIssueHints = function (line) { return line.replace( /(?<=\( ?(?:fix|fixes|see) )(#\d+)(?= ?\))/g, function (issueHash) { return '[' .concat(issueHash, '](https://github.com/') .concat(options.repo, '/issues/') .concat(issueHash.substring(1), ')'); }, ); }; (_a = replacedChangelog.split('\n').map(function (l) { return linkifyIssueHints(l.trimEnd()); })), (firstLine = _a[0]), (futureLines = _a.slice(1)); return [ 4 /*yield*/, (function () { return __awaiter(void 0, void 0, void 0, function () { var links_1, shortCommitId, commitToFetchFrom, links_2; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!(prFromSummary !== undefined)) return [3 /*break*/, 2]; return [ 4 /*yield*/, (0, get_github_info_1.getInfoFromPullRequest)({ repo: options.repo, pull: prFromSummary, }), ]; case 1: links_1 = _a.sent().links; if (commitFromSummary) { shortCommitId = commitFromSummary.slice(0, 7); links_1 = __assign(__assign({}, links_1), { commit: '[`' .concat(shortCommitId, '`](https://github.com/') .concat(options.repo, '/commit/') .concat(commitFromSummary, ')'), }); } return [2 /*return*/, links_1]; case 2: commitToFetchFrom = commitFromSummary || changeset.commit; if (!commitToFetchFrom) return [3 /*break*/, 4]; return [ 4 /*yield*/, (0, get_github_info_1.getInfo)({ repo: options.repo, commit: commitToFetchFrom, }), ]; case 3: links_2 = _a.sent().links; return [2 /*return*/, links_2]; case 4: return [ 2 /*return*/, { commit: null, pull: null, user: null, }, ]; } }); }); })(), ]; case 1: links = _b.sent(); users = usersFromSummary.length ? usersFromSummary .map(function (userFromSummary) { return '[@' .concat(userFromSummary, '](https://github.com/') .concat(userFromSummary, ')'); }) .join(', ') : links.user; suffix = ''; if (links.pull || links.commit || users) { suffix = '(' .concat(users ? 'by '.concat(users, ' ') : '', 'in ') .concat(links.pull || links.commit, ')'); } emojiFirstline = firstLine .replace(/feat:/i, '✨ ') .replace(/fix:/i, '🐞🩹') .replace(/docs:/i, '📃'); return [ 2 /*return*/, '\n\n- ' .concat(emojiFirstline, ' ') .concat(suffix, '\n') .concat( futureLines .map(function (l) { return ' '.concat(l); }) .join('\n'), ), ]; } }); }); }, }; exports.default = changelogFunctions; ================================================ FILE: .changeset/changelog-github-custom.ts ================================================ import { ChangelogFunctions } from '@changesets/types'; // @ts-ignore import { getInfo, getInfoFromPullRequest } from '@changesets/get-github-info'; import { config } from 'dotenv'; config(); const changelogFunctions: ChangelogFunctions = { getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => { if (!options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } if (dependenciesUpdated.length === 0) return ''; const changesetLink = `- Updated dependencies [${( await Promise.all( changesets.map(async (cs) => { if (cs.commit) { let { links } = await getInfo({ repo: options.repo, commit: cs.commit, }); return links.commit; } }), ) ) .filter((_) => _) .join(', ')}]:`; const updatedDepenenciesList = dependenciesUpdated.map( (dependency) => ` - ${dependency.name}@${dependency.newVersion}`, ); return [changesetLink, ...updatedDepenenciesList].join('\n'); }, getReleaseLine: async (changeset, type, options) => { if (!options || !options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } let prFromSummary: number | undefined; let commitFromSummary: string | undefined; let usersFromSummary: string[] = []; const replacedChangelog = changeset.summary .replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => { let num = Number(pr); if (!isNaN(num)) prFromSummary = num; return ''; }) .replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => { commitFromSummary = commit; return ''; }) .replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => { usersFromSummary.push(user); return ''; }) .trim(); const linkifyIssueHints = (line: string) => line.replace(/(?<=\( ?(?:fix|fixes|see) )(#\d+)(?= ?\))/g, (issueHash) => { return `[${issueHash}](https://github.com/${ options.repo }/issues/${issueHash.substring(1)})`; }); const [firstLine, ...futureLines] = replacedChangelog .split('\n') .map((l) => linkifyIssueHints(l.trimEnd())); const links = await (async () => { if (prFromSummary !== undefined) { let { links } = await getInfoFromPullRequest({ repo: options.repo, pull: prFromSummary, }); if (commitFromSummary) { const shortCommitId = commitFromSummary.slice(0, 7); links = { ...links, commit: `[\`${shortCommitId}\`](https://github.com/${options.repo}/commit/${commitFromSummary})`, }; } return links; } const commitToFetchFrom = commitFromSummary || changeset.commit; if (commitToFetchFrom) { let { links } = await getInfo({ repo: options.repo, commit: commitToFetchFrom, }); return links; } return { commit: null, pull: null, user: null, }; })(); const users = usersFromSummary.length ? usersFromSummary .map( (userFromSummary) => `[@${userFromSummary}](https://github.com/${userFromSummary})`, ) .join(', ') : links.user; let suffix = ''; if (links.pull || links.commit || users) { suffix = `(${users ? `by ${users} ` : ''}in ${links.pull || links.commit})`; } const emojiFirstline = firstLine .replace(/feat:/i, '✨ ') .replace(/fix:/i, '🐞🩹') .replace(/docs:/i, '📃'); return `\n\n- ${emojiFirstline} ${suffix}\n${futureLines .map((l) => ` ${l}`) .join('\n')}`; }, }; export default changelogFunctions; ================================================ FILE: .changeset/config.json ================================================ { "$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json", "changelog": ["./changelog-github-custom.cjs", { "repo": "QwikDev/partytown" }], "commit": false, "fixed": [], "linked": [], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] } ================================================ FILE: .gitattributes ================================================ tests/** linguist-vendored ================================================ FILE: .github/ISSUE_TEMPLATE/bug.yaml ================================================ name: 🐞 Bug Report description: Something does not work or is flaky! Let us know! labels: [bug, triage] title: '[🐞]' body: - type: markdown attributes: value: | Thanks for taking the time to fill out this bug report! - type: textarea id: description attributes: description: 'A clear and concise description of what you expected to happen instead. If you intend to submit a PR for this issue, tell us in the description. Thanks!' label: Describe the bug placeholder: I am doing ... What I expect is ... What actually happening is ... validations: required: true - type: input id: reproduction attributes: label: Reproduction description: Please provide a link to a repo that can reproduce the problem you ran into. Please see the [contributing docs](https://github.com/BuilderIO/partytown/blob/main/CODE_OF_CONDUCT.md) for suggestions on create a reproduction. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed. placeholder: Reproduction URL validations: required: true - type: textarea id: reproduction_steps attributes: label: Steps to reproduce description: Please provide any reproduction steps that may need to be described. validations: required: true - type: input id: browser_info attributes: label: Browser Info description: Which browser did you experience the issue on? placeholder: Chrome, Safari, Firefox, Edge validations: required: true - type: textarea id: additional_information attributes: label: Additional Information validations: required: false ================================================ FILE: .github/ISSUE_TEMPLATE/docs_suggestion.yml ================================================ name: 📖 Documentation Suggestion description: Suggestions on how we can improve the documentation. title: '[📖]' labels: [documentation] body: - type: markdown attributes: value: | Thanks for taking the time to fill out docs suggestion! However, if you think it's something you can fix yourself, please submit a PR instead. In every doc page, you will be able to find the "Edit this page" in the right menu! - type: textarea id: description attributes: description: 'A clear and concise description of your suggestion to improve the docs.' label: Suggestion validations: required: true ================================================ FILE: .github/ISSUE_TEMPLATE/feature.yaml ================================================ name: ✨ Feature Request description: Suggest an idea for this project. labels: [enhancement, triage] title: '[✨]' body: - type: textarea id: use_case attributes: label: 'Is your feature request related to a problem?' description: 'A clear and concise description of what the problem is.' validations: required: true - type: textarea id: solution attributes: label: "Describe the solution you'd like" description: 'A clear and concise description of what you want to happen.' validations: required: true - type: textarea id: alternatives attributes: label: "Describe alternatives you've considered" description: "A clear and concise description of any alternative solutions or features you've considered." validations: required: true - type: textarea id: additional_context attributes: label: 'Additional context' description: 'Add any other context or screenshots about the feature request here.' validations: required: false ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ # What is it? - [ ] Feature / enhancement - [ ] Bug - [ ] Docs / tests # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. # Use cases and why - 1. One use case - 2. Another use case # Checklist: - [ ] My code follows the [developer guidelines of this project](https://github.com/BuilderIO/partytown/blob/main/CONTRIBUTING.md) - [ ] 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 ================================================ FILE: .github/workflows/ci.yml ================================================ name: Partytown CI on: [push, pull_request] jobs: test-chromium: name: Test Chromium (Ubuntu) runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 - uses: pnpm/action-setup@v4.0.0 - name: Setup Node uses: actions/setup-node@v4.0.2 with: node-version: 20.10.0 cache: 'pnpm' registry-url: https://registry.npmjs.org/ - run: corepack enable - name: Install NPM Dependencies run: pnpm install --frozen-lockfile - name: Build run: npm run build - name: Install Chromium Playwright run: npx playwright install chromium && npx playwright install-deps chromium - name: Run Chromium E2E Tests (Service Worker) run: npm run test.chromium - name: Run Chromium E2E Tests (Atomics) run: npm run test.atomics - name: Run Unit Tests run: npm run test.unit - name: Upload Chromium E2E Test Videos uses: actions/upload-artifact@v4.3.1 if: always() with: name: Chromium E2E Test Videos path: tests/videos test-webkit: name: Test WebKit (MacOS) runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 - uses: pnpm/action-setup@v4.0.0 - name: Setup Node uses: actions/setup-node@v4.0.2 with: node-version: 20.10.0 cache: 'pnpm' registry-url: https://registry.npmjs.org/ - run: corepack enable - name: Install NPM Dependencies run: pnpm install --frozen-lockfile - name: Build run: npm run build - name: Install WebKit Playwright run: npx playwright install webkit && npx playwright install-deps webkit - name: Run WebKit E2E Tests run: npm run test.webkit - name: Upload WebKit E2E Test Videos uses: actions/upload-artifact@v4.3.1 if: always() with: name: WebKit E2E Test Videos Videos path: tests/videos benchmark-chromium: name: Benchmark Chromium (Ubuntu) runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 - uses: pnpm/action-setup@v4.0.0 - name: Setup Node uses: actions/setup-node@v4.0.2 with: node-version: 20.10.0 cache: 'pnpm' registry-url: https://registry.npmjs.org/ - run: corepack enable - name: Install NPM Dependencies run: pnpm install --frozen-lockfile - name: Build run: npm run build - name: Install Chromium Playwright run: npx playwright install chromium && npx playwright install-deps chromium - name: Run Chromium Benchmark run: npm run benchmark - name: Upload Chromium Benchmark Screenshots uses: actions/upload-artifact@v4.3.1 if: always() with: name: Chromium Benchmark Screenshots path: tests/benchmarks/screenshots ================================================ FILE: .github/workflows/linter.yml ================================================ name: PR Prettier Check on: pull_request_target: types: - opened - edited - synchronize - ready_for_review permissions: pull-requests: read jobs: ########### LINT PACKAGE ############ lint-package: name: Lint Package runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 - uses: pnpm/action-setup@v4.0.0 - name: Setup Node uses: actions/setup-node@v4.0.2 with: node-version: 20.10.0 cache: 'pnpm' registry-url: https://registry.npmjs.org/ - run: corepack enable - name: Install NPM Dependencies run: pnpm install --frozen-lockfile - name: Prettier Check if: ${{ always() }} run: pnpm fmt.check ================================================ FILE: .github/workflows/pr.yml ================================================ name: PR Title Check on: pull_request_target: types: - opened - edited - synchronize - ready_for_review permissions: pull-requests: read jobs: ############ SEMANTIC PR TITLE VALIDATION ############ semantic-pr: name: Validate PR title runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .github/workflows/release.yml ================================================ name: Release on: pull_request: push: branches: - main permissions: id-token: write contents: write pull-requests: write jobs: release: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - name: Checkout all commits uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup git user shell: bash run: | git config --global user.name '@partytown' git config --global user.email 'partytown@users.noreply.github.com' - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 9.7.0 - name: Use Node uses: actions/setup-node@v4 with: node-version: 20.x registry-url: https://registry.npmjs.org cache: 'pnpm' - name: Install dependencies shell: bash run: pnpm install --frozen-lockfile - name: Build packages shell: bash run: pnpm build.prod # - name: Publish any commit / build for testing # run: pnpm release.pkg-pr-new # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release Pull Request or Publish if: github.ref == 'refs/heads/main' id: changesets uses: changesets/action@v1 with: publish: pnpm release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ================================================ FILE: .gitignore ================================================ .cache/ .next/ .DS_Store /dist/ /docs/site/dist/ /docs/site/public/~partytown/ /docs/site/src/table-of-contents.ts /docs/site/src/pages/ node_modules/ /integration/ /lib/ /react/ /tests/nextjs/public/ /tests/benchmarks/screenshots/ /tests/posts/ /tests/react-app/public/~partytown/ /tests/videos/ /services/ /tsc/ /utils/ /index.cjs /index.mjs /index.d.ts .idea .history test-results/ tests/integrations/load-scripts-on-main-thread/snippet.js # AI Aritfacts .planning ================================================ FILE: .nvmrc ================================================ 20.10.0 ================================================ FILE: .prettierignore ================================================ .cache /lib /node_modules /react /tsc api.md tests/platform/script/source-mapping-url.js ================================================ FILE: CHANGELOG.md ================================================ # @qwik.dev/partytown ## 0.13.0 ### Minor Changes - ✨ add new documentation for Drupal integration (by [@OulipianSummer](https://github.com/OulipianSummer) in [#701](https://github.com/QwikDev/partytown/pull/701)) This commit adds a new section to the integrations section of the documentation, detailing how to install, configure, and use the Drupal integration for PartyTown. ### Patch Changes - patch: expand docs on manual Drupal module installation, fix typos (by [@OulipianSummer](https://github.com/OulipianSummer) in [#703](https://github.com/QwikDev/partytown/pull/703)) Although uncommon, some Drupal web sites do install all of their third-party modules without composer. In these cases, it is still possible to use the contributed PartyTown module to manage PartyTown from a GUI, though the setup does require some extra explanation. I've added some notes on this uncommon setup in the hope it will be helpful to those users. ## 0.12.0 ### Minor Changes - Add `strictProxyHas` configuration option for accurate namespace conflict detection (by [@chadgauth](https://github.com/chadgauth) in [#692](https://github.com/QwikDev/partytown/pull/692)) **Summary:** This release adds a new configuration option `strictProxyHas` that enables accurate property existence checks using the `in` operator. This is required for scripts like FullStory that check for namespace conflicts when loaded via Google Tag Manager (GTM). **Key Changes:** - Add `strictProxyHas?: boolean` config option to enable accurate `in` operator behavior - Update window proxy's `has` trap to use `Reflect.has()` when `strictProxyHas: true` - Default is `false` for backwards compatibility - Add FullStory GTM integration test with production-ready snippet - Document the configuration and provide usage guide **Usage:** ```html ``` **Backwards Compatibility:** This is a non-breaking change. The default behavior remains unchanged (`strictProxyHas: false`), so existing implementations will continue to work without modifications. ## 0.11.2 ### Patch Changes - ✨ Implement full attribute methods for HTMLImageElement (by [@mws19901118](https://github.com/mws19901118) in [#681](https://github.com/QwikDev/partytown/pull/681)) Implemented complete attribute handling for HTMLImageElement class including getAttribute(), setAttribute(), hasAttribute(), removeAttribute(), and toggleAttribute() methods. Added attributes Map to store element attributes and enhanced setAttribute() to properly handle src attribute. Includes comprehensive unit tests covering all attribute methods. ## 0.11.1 ### Patch Changes - Add adoptedStyleSheets.get() to patched `document` in worker. (by [@leeroybrun](https://github.com/leeroybrun) in [#674](https://github.com/QwikDev/partytown/pull/674)) ## 0.11.0 ### Minor Changes - Bunch of fixes and a new release system.. (by [@shairez](https://github.com/shairez) in [#652](https://github.com/QwikDev/partytown/pull/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) ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: - The use of sexualized language or imagery, and sexual attention or advances of any kind - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or email address, without their explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at info@builder.io. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ================================================ FILE: CONTRIBUTING.md ================================================ # Local Development Welcome 🎉!! If you've found a bug, or have an idea to add a feature we'd love to hear from you. It may save time to first ping the group on [Partytown's Discord channel](https://discord.gg/aHKdpdWv7a) to talk through any ideas or any issues that may be a bug. ## Installation ``` npm install npm run dev ``` See the [distribution](https://partytown.qwik.dev/distribution) section about the various files created. Note that both the root directory, and the `tests` directory receive a copy of the build files, such as `tests/~partytown/partytown.js`. ## Submitting Issues And Writing Tests We need your help! If you found a bug, it's best to create a [Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) that replicates the issue using a test page. - Minimal Reproduction Case: If maintainers and contributors are unable to reproduce the same error, then it makes it very difficult to debug and fix. Any issued opened without a minimal reproduction example will be closed. - E2E Test: A good example of an End-to-end test is one where the test fails before the fix, and passes after the fix. But also, all the other tests pass too. In the [tests directory](https://github.com/BuilderIO/partytown/tree/main/tests), copy one of the directories, such as `tests/platform/document`, and recreate the issue you've found. Follow the [manual testing](#manual-testing) directions on how to start the local dev server. Next, the more you can describe the debug and pin-point the issue the better, and any fixes to the runtime to solve the problem would be awesome. 🎉 If the PR fixes the issue, then creating an [end-to-end test](#e2e-testing) would help ensure no regressions happen over time. Additionally, Github issues is a place to explain a problem in detail, along with a reproduction case for maintainers. However, Github issues is not the best place to ask how-to questions since project contributors and maintainers don’t have the capacity to debug external websites and the many third-party scripts. Any issues opened asking that are not following these guidelines will be closed. Please also see the [FAQ section](https://partytown.qwik.dev/faq) for more info ## Plugin Authors / Developers If you are the author / developer of any 3rd party plugin / library, and want to ensure that your library works with Partytown, we would love to work with you to ensure it does! The easiest way to verify is to create a small, standalone replica in our [integration tests directory](https://github.com/BuilderIO/partytown/tree/main/tests/integrations). Our standard practice is to: - Create a `standard.html` which loads your library / plugin as it normally is loaded, as a ` /* Inlined Partytown Snippet */ ``` ================================================ FILE: docs/src/routes/astro/index.mdx ================================================ --- title: Astro --- # Astro There is a first-class [Astro integration for partytown](https://github.com/withastro/astro/tree/main/packages/integrations/partytown). ## Automatic Setup Astro includes a CLI tool for adding integrations. Using the `astro add` command will automatically install Partytown and configure your project. ```bash npx astro add partytown yarn astro add partytown pnpx astro add partytown ``` ## Partytown Script Add `type: 'text/partytown'` [attribute](/partytown-scripts) to any scripts you want to be handled by Partytown. ```html ``` Note that the [Astro Partytown](https://github.com/withastro/astro/tree/main/packages/integrations/partytown) integration already handles copying the library files to the correct location. ================================================ FILE: docs/src/routes/atomics/index.mdx ================================================ --- title: Atomics --- # Atomics Partytown will use [Atomics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics) and [SharedArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) when they're available by the browser. Some of the advantages include: - 10x faster communication between threads compared to the service-worker requests - 5% smaller build file compared to the service-worker build - No `proxytown` requests in the network tab - Fewer http requests to initialize the Partytown library - Partytown service-worker and iframe is no longer used It's important to note that [not all browsers support Atomics](#browser-atomics-support), and the server hosting the site must be configured with the correct response headers. If neither of those are true, then Partytown will fallback to using the service-worker communication layer instead. ## Document Response Headers To enable Atomics communication, the browser's [crossOriginIsolated](https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated) readonly property should be `true`. The `crossOriginIsolated` property is only set to true, by the browser, when the document includes these http response headers: ``` Cross-Origin-Embedder-Policy: credentialless Cross-Origin-Opener-Policy: same-origin ``` - [Cross-Origin-Embedder-Policy (COEP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy) response header prevents a document from loading any cross-origin resources that don't explicitly grant the document permission. At the time of writing, `credentialless` is not a supported value in Safari, so Safari will fallback to using the Service Worker communication. An alternative to `credentialless` is to use `require-corp`, which does work in Safari too. Please see [Setting Cross-Origin Attribute](#setting-cross-origin-attribute) for more info. - [Cross-Origin-Opener-Policy (COOP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy) response header allows you to ensure a top-level document does not share a browsing context group with cross-origin documents. ## Setting Cross-Origin Attribute An alternative to setting `Cross-Origin-Embedder-Policy: credentialless`, is to instead use `Cross-Origin-Embedder-Policy: require-corp`. The biggest thing to highlight is that the `require-corp` does not allow images, scripts, videos, etc. to be loaded from another origin. For example, when this header is set, any scripts or images to a CDN will no longer work. However, the [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) attribute can be used on individual elements, such as `