Add Webxdc packaging via make build-xdc - #42
Conversation
Export a static site when WEBXDC=1 and zip it into dist/squig.xdc so the app can run offline as a Delta Chat mini-app, without changing the normal server build for squig.sh.
|
@omidz4t is attempting to deploy a commit to the Pabs' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey — if you’re interested, I’d be happy to help make squig collaborative in Delta Chat later (same general approach as excalidraw-webxdc: document sync + live cursors over the messenger). I think this project has a lot of potential when people can use it inside Delta Chat — wireframing together in a chat feels like a natural fit for how squig already works (local files, sketchy fidelity, no accounts). Also, if you get a chance, it would be nice if you could try the Excalidraw webxdc port for a feel of how collab works in that setup: https://github.com/omidz4t/excalidraw-webxdc Happy to iterate on feedback either way. Thanks for squig! |
Summary
Adds a way to package squig as a Webxdc mini-app for Delta Chat, without changing the normal production build used for squig.sh.
make build-xdcruns a static export (WEBXDC=1) and zipsout/intodist/squig.xdcWEBXDC=1, Next usesoutput: "export"and unoptimized images; plainpnpm buildis unchangedpublic/manifest.toml+icon.pngfor the messenger;public/webxdc.jsis a local-dev shim and is excluded from the zip (the host injects its own)force-staticso static export can succeedWhat is Webxdc?
Webxdc is a format for small web apps that run inside a chat message (most commonly in Delta Chat). A
.xdcfile is just a zip of static assets — HTML, JS, CSS, images — plus amanifest.toml(and usually an icon) at the root of the archive.When someone sends the file into a chat and taps Start, the messenger opens it in an embedded webview. There is no app store and no separate install step: the app travels with the message. State can stay local in the webview (e.g.
localStorage), and apps that need multi-user sync can use the host’swindow.webxdcAPI (sendUpdate/setUpdateListener, etc.). That API is provided by the messenger at runtime — projects often keep a stubwebxdc.jsfor browser development, but it must not be shipped inside the.xdc.This PR only packages squig as a self-contained offline app. It does not add multiplayer sync over webxdc updates; documents still live in the browser’s storage, same idea as on the web.
Docs: webxdc.org · spec
Later plan: realtime collaboration
Out of scope for this PR. Once the static package is solid, a follow-up can add multi-user editing the same way as omidz4t/excalidraw-webxdc:
sendUpdate/setUpdateListener(likely Yjs + something likey-webxdc, as in that fork)@webxdc/webxdc-dev(same pattern asmake run-simthere)Until then, each open instance keeps its own local file drawer; sharing a canvas across a chat is intentionally not wired yet.
Test plan
pnpm buildstill succeeds (server / squig.sh path)make build-xdcproducesdist/squig.xdccontainingindex.html,manifest.toml, andicon.pngwebxdc.jsis not inside the.xdcdist/squig.xdcin Delta Chat (orwebxdc-dev) and check the canvas loads and basic drawing works offline