@kreijstal/mogan-wasm
v2026.3.7-build.1
Published
Mogan STEM 2026.3.7 (TeXmacs fork) for the browser: the ImGui frontend in WebAssembly with a React shell
Readme
@kreijstal/mogan-wasm
Mogan STEM 2026.3.7 (TeXmacs fork) for the browser: the ImGui frontend in WebAssembly with a React shell
Upstream: https://github.com/MoganLab/mogan
Use
Pinned to this version, from a CDN:
https://cdn.jsdelivr.net/npm/@kreijstal/[email protected]/<file>
https://unpkg.com/@kreijstal/[email protected]/<file>Reproducing this build
Everything here is built from source; nothing prebuilt is repackaged. The script that produced these files is included as build/build.sh, with the patches it applies in build/patches/.
Toolchain
- emscripten:
emcc 6.0.9-git (4e4223852a0835923411059a3929907d7df1232e)from the Arch Linux packageemscripten 6.0.9-1(installed at /usr/lib/emscripten; LLVMclang version 24.0.0git, Binaryenwasm-opt version 132 (version_132-49-gd03c25ea43)) - Node.js v22.23.2, CMake 4.4.3, Arch Linux
- No emsdk: the script puts /usr/lib/emscripten first on PATH and points EMSDK and EM_CONFIG at it, so every object (including emscripten's own libc/libc++) comes from that one emcc
- xmake:
xmake v3.0.4+HEAD.347e268(a static xmake binary inbin/, put first on PATH by the script); packages from xmake-io/xmake-repo at745d74023a324ccd997857d4950d79ac28ca2981plus Mogan's ownxmake/packages - Rust 1.96.1 (installed by Mogan's
xmake/targets/loro.luathrough rustup, targetwasm32-unknown-emscripten) for the Loro FFI static library - npm 10.9.8 + vite (versions from
web/package-lock.json) for the React shell inassets/
Sources
| Source | Pin |
|---|---|
| MoganLab/mogan | tag v2026.3.7 (commit fbea914719fc48b257f2c218c5f477c3453e22cc) + build/patches/mogan-wasm.patch |
| mupdf (with its thirdparty gumbo, lcms2mt, mujs, jbig2dec, openjpeg, extract) | 1.25.1, source tarball sha256 81aa1361252418cc… (Mogan's xmake/packages/m/mupdf) |
| harfbuzz | 13.1.1 (xmake-repo, tarball sha256 8497968914f415d6…) |
| freetype | 2.13.3 (xmake-repo, tarball sha256 5c3a8e78f7b24c20…) |
| libpng | v1.6.58 (xmake-repo, tarball sha256 a9d4df463d36a6e5…) |
| libjpeg | v9e (xmake-repo, tarball sha256 4077d6a6a75aeb01…) |
| zlib | v1.3.2 (xmake-repo, tarball sha256 b99a0b86c0ba9360…) |
| tbox, argh, nlohmann_json, Dear ImGui v1.92.8, s7 / Goldfish Scheme, lolly, moebius | in Mogan's tree at the tag |
| Loro 1.13.7 (CRDT) | in Mogan's tree (3rdparty/loro); 88 crates from 3rdparty/mogan-loro-ffi/Cargo.lock, listed in LICENSES/rust-crates.txt |
| emscripten-glfw | 3.5.1.20260809, emscripten's contrib.glfw3 port |
| react, react-dom, scheduler (in assets/index.js) | 18.3.1, 18.3.1, 0.23.2 (web/package-lock.json) |
build/patches/mogan-wasm.patch makes the wasm build use the system emcc instead of xmake's emscripten 3.1.74 package, and lets the mupdf package build with emscripten (OS=wasm, the wasm zlib). stem.data holds TeXmacs' fonts, styles, packages and Scheme code; the fonts keep their own licenses (LPPL per LICENSES/texmacs-fonts-LICENSE; DejaVu, Noto Sans Symbols, STIX Two Math, Asana Math and Latin Modern Math under theirs).
Not pinned: build.sh runs xmake repo --update, so a rebuild takes xmake-repo's current HEAD (check out the commit above in $XMAKE_GLOBALDIR/.xmake/repositories/xmake-repo to match), and the static xmake binary is not fetched by the script.
Steps
On Arch Linux with the emscripten package (pacman -S emscripten), rustup and Node.js/npm installed, and a static xmake v3.0.4 at ~/git/mogan-wasm/bin/xmake:
git clone --branch v2026.3.7 https://github.com/MoganLab/mogan ~/git/mogan-wasm/src
git -C ~/git/mogan-wasm/src apply /path/to/this/package/build/patches/mogan-wasm.patch
cp /path/to/this/package/build/build.sh ~/git/mogan-wasm/ && ~/git/mogan-wasm/build.shThe paths are fixed in the script. xmake builds the dependency packages into ~/git/mogan-wasm/xmake-global-modern, cargo the Loro FFI and npm the web shell; note that Mogan's loro target runs rustup default 1.96.1. The output lands in ~/git/mogan-wasm/build-modern/wasm/wasm32/release (symlinked as site); the files published here are its index.html, stem.html, stem.{js,wasm,data} and assets/ (not the lib*.a). Compare them against the checksums below.
The comment at the top of the build script, verbatim:
Mogan STEM (MoganLab/mogan, tag v2026.3.7, in src/) for the browser: the ImGui
frontend (target "stem") built with xmake -m release -p wasm and the SYSTEM
emscripten (/usr/lib/emscripten), no emsdk and no emscripten xmake package.
- src/ carries a small patch (mogan-wasm.patch): use the system emcc as the
toolchain, and let the mupdf package build for wasm (OS=wasm, its own zlib)
- C/C++ dependencies (mupdf 1.25.1, harfbuzz, freetype, libpng, libjpeg, zlib)
are xmake packages built from source into XMAKE_GLOBALDIR (xmake-global-modern/);
tbox, s7/goldfish, imgui, lolly, moebius are in Mogan's tree
- the Loro CRDT FFI (Rust) is built by cargo for wasm32-unknown-emscripten with
Rust 1.96.1 via rustup; the React shell in web/ by npm + vite (assets/)
- xmake is bin/xmake (static xmake v3.0.4 binary)
Output: site -> build-modern/wasm/wasm32/release (index.html, stem.{js,wasm,data}, assets/)Checksums of the published files
3e9492216320d7b6cd7111182be8fde43a341ece4f514c785ec55b38c646f416 assets/index.css
344f027d8a8ac0d05158c57b0a0d1a7f943e12882483e78720e8b72d99b00290 assets/index.js
908dad7a6f6bea252347be8113743a73c3268868e6445910a065530cc4429ded index.html
abb78000457270abd1015ca212a2ed3b02b4e807e1ce02b1064abfd04e811d1f stem.data
908dad7a6f6bea252347be8113743a73c3268868e6445910a065530cc4429ded stem.html
0e9a5c546cceaa05b810db185eada4df348eb17b7d2e704183d12989f05fd340 stem.js
3fbf8265844b8b3e155bedd3144183ccf7f6d5b115782afdb241b5caab8fe792 stem.wasmLicenses
GPL-3.0-or-later AND AGPL-3.0-or-later AND Apache-2.0 AND MIT AND BSD-3-Clause AND BSD-2-Clause AND ISC AND 0BSD AND Zlib AND IJG AND libpng-2.0 AND FTL AND MPL-2.0 AND BSL-1.0 AND LPPL-1.0. The license texts of everything compiled in are in LICENSES/.
