You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been exploring what it takes to run partytown. I was able to create a simple HTML page with the partytown js files in same dir. I thought it might be useful to others so am sharing here.
# Setup folder for our demo
mkdir ./demo
mkdir ./demo/~partytown
cd demo/~partytown
# Fetch the partytown library code and worker code to local dir
curl -O -L https://unpkg.com/@qwik.dev/partytown@latest/lib/partytown-sw.js
curl -O -L https://unpkg.com/@qwik.dev/partytown@latest/lib/partytown.js
# Add the demo.html script into this file
nano ./demo.html
# Important, we must be able to serve the ~partytown folder from server
cd ..
# Run the demo folder using http python server
python3 -m http.server 8092
# Open browser at
http://localhost:8092/~partytown/demo.html
HTML
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8" /><metaname="viewport" content="width=device-width, initial-scale=1.0" /><title>Simple HTML with Partytown</title></head><body><!-- Include Partytown JS from the same directory --><scriptsrc="partytown.js"></script><!-- Mark this script to run inside a Web Worker (Partytown) --><scripttype="text/partytown">functionhello(message){console.log(`Hello, ${message}!`);}hello('world');</script></body></html>
When the page loads (it will be blank) you should see in the JavaScript Console:
The text was updated successfully, but these errors were encountered:
Hi @thomas-optimove as you can see from the warning in the console now the project is under a different org.
Would you like to transform this issue into a doc PR?
Hi @thomas-optimove as you can see from the warning in the console now the project is under a different org.
Would you like to transform this issue into a doc PR?
Documentation
I have been exploring what it takes to run partytown. I was able to create a simple HTML page with the partytown js files in same dir. I thought it might be useful to others so am sharing here.
I have also created a public gist with the instructions:
https://gist.github.com/thomas-optimove/f0798aaeffaa34f706fdcfa119c91fdd
Setup Script
HTML
When the page loads (it will be blank) you should see in the JavaScript Console:
The text was updated successfully, but these errors were encountered: