Skip to content

Add Webxdc packaging via make build-xdc - #42

Open
omidz4t wants to merge 1 commit into
pablostanley:mainfrom
omidz4t:feat/webxdc-package
Open

Add Webxdc packaging via make build-xdc#42
omidz4t wants to merge 1 commit into
pablostanley:mainfrom
omidz4t:feat/webxdc-package

Conversation

@omidz4t

@omidz4t omidz4t commented Aug 8, 2026

Copy link
Copy Markdown

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-xdc runs a static export (WEBXDC=1) and zips out/ into dist/squig.xdc
  • When WEBXDC=1, Next uses output: "export" and unoptimized images; plain pnpm build is unchanged
  • Ships public/manifest.toml + icon.png for the messenger; public/webxdc.js is a local-dev shim and is excluded from the zip (the host injects its own)
  • Marks the social image routes force-static so static export can succeed

What is Webxdc?

Webxdc is a format for small web apps that run inside a chat message (most commonly in Delta Chat). A .xdc file is just a zip of static assets — HTML, JS, CSS, images — plus a manifest.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’s window.webxdc API (sendUpdate / setUpdateListener, etc.). That API is provided by the messenger at runtime — projects often keep a stub webxdc.js for 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:

  • Document sync over Delta Chat’s sendUpdate / setUpdateListener (likely Yjs + something like y-webxdc, as in that fork)
  • Live strokes / cursors on the messenger’s P2P realtime channel (Delta Chat 1.48+), so peers see each other draw without waiting on full updates
  • Multi-peer local testing with @webxdc/webxdc-dev (same pattern as make run-sim there)

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 build still succeeds (server / squig.sh path)
  • make build-xdc produces dist/squig.xdc containing index.html, manifest.toml, and icon.png
  • Confirm webxdc.js is not inside the .xdc
  • Open dist/squig.xdc in Delta Chat (or webxdc-dev) and check the canvas loads and basic drawing works offline

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.
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@omidz4t is attempting to deploy a commit to the Pabs' projects Team on Vercel.

A member of the Team first needs to authorize it.

@omidz4t

omidz4t commented Aug 8, 2026

Copy link
Copy Markdown
Author

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!

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.

1 participant