Skip to content

fix: service-worker#233

Open
lalyos wants to merge 1 commit intotractordev:mainfrom
lalyos:fix-sw
Open

fix: service-worker#233
lalyos wants to merge 1 commit intotractordev:mainfrom
lalyos:fix-sw

Conversation

@lalyos
Copy link
Copy Markdown
Contributor

@lalyos lalyos commented Mar 23, 2026

I was unable to reproduce the yt wanix demo, where a new Iframe's src points to opfs via /:/web/opfs.
I found 2 issues, the service worker wasn't registered, and once it was it was caching the opfs file, so any change had no effect.

@lalyos
Copy link
Copy Markdown
Contributor Author

lalyos commented Mar 23, 2026

this was my test:

cat > /web/opfs/iframe.sh <<'EOF'
[ -e /web/opfs/a.txt ] || echo hello > /web/opfs/a.txt
cd /web/dom
id=$(cat new/iframe)
echo append-child $id >> body/ctl
echo src=/:/web/opfs/a.txt >> $id/attrs
EOF
chmod +x /web/opfs/iframe.sh
./iframe.sh

@lalyos lalyos changed the title Fix sw Fix service-worker Mar 23, 2026
@lalyos lalyos changed the title Fix service-worker fix: service-worker Mar 23, 2026
@progrium
Copy link
Copy Markdown
Contributor

cool. i know stuff has probably broken since last release (but also more developed). i'm curious what are the changes to the wasi worker lib.js?

@lalyos
Copy link
Copy Markdown
Contributor Author

lalyos commented Mar 24, 2026

Hmmm actually I'm not sure where those changes originated?!
I just saw that runtime/wasi/worker/lib.js is generated by esbuild,
and thought maybe I got a newer esbuild version, as te changes seemed minor/cosmetic.

But deleted it and tried to regenerate ... and couldn't.

So just removed that commit from the PR, and it still fixes the 404 error reproducible by iframe.sh

@lalyos
Copy link
Copy Markdown
Contributor Author

lalyos commented Mar 24, 2026

I was thinking that as we already use cloudflare:
We could use its pages feature for being able to deploy every commit/branch on its on preview url. So a PR could be easily checked by letting cf-pages serve a static dir from wanix export + the bundle.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants