* Add xdelta patch support * Fix potential race on reupload to new format + update typings * Fix waiting too long to call showSaveFilePicker * Allow seeing patch format in version history
1.9 KiB
Building and vendoring xdelta WASM
Hackdex patches xdelta (VCDIFF) files in the browser using a WebAssembly build of xdelta3. That binary is not built inside this repo. You build it from a local checkout of the Hackdex fork of xdelta-wasm (forked from kotcrab/xdelta-wasm), then copy two artifacts into public/xdelta/.
Use this guide when you need to rebuild or update those artifacts.
Prerequisites
- A local checkout of Hackdex-App/xdelta-wasm.
- Emscripten (
emcc6.x tested). On macOS:brew install emscripten. Otherwise follow the emsdk install docs. - After cloning xdelta-wasm, initialize the jmacd/xdelta submodule:
git submodule update --init
This populates native/xdelta.
One-time setup (XZ / liblzma)
Secondary LZMA compression (xdelta3 -S lzma) needs static liblzma. Run this if native/xz/ is missing:
./native/build-xz.sh
That downloads XZ Utils and builds it with emconfigure / emmake.
Building
From the xdelta-wasm checkout root:
./native/build.sh
This compiles native/xdelta/xdelta3/xdelta3.c and native/xdelta3-wasm.c, links liblzma, and writes:
public/xdelta3.js(ES6 module)public/xdelta3.wasm(Companion WASM binary)
Vendoring into Hackdex
Copy only those two files into this repo (overwrite existing):
cp public/xdelta3.js public/xdelta3.wasm \
/path/to/hackdex-website/public/xdelta/
Do not overwrite these Hackdex-owned files in public/xdelta/:
xdelta3.worker.js: Hackdex worker (protocol differs from upstream)LICENSE-xdelta3.txtNOTICE.txt
Licensing
See public/xdelta/LICENSE-xdelta3.txt and public/xdelta/NOTICE.txt.