LibreCAD in the Browser
19 hours ago
- #LibreCAD
- #Porting
- #WebAssembly
- The author needed a quick 2D drawing tool accessible in a browser without installation, leading to porting LibreCAD to WebAssembly via AI prompting.
- The port relies on Qt's WebAssembly support and WebAssembly JSPI to handle nested modal dialogs and event loops, which traditional Asyncify couldn't manage.
- Performance optimizations included switching the backing store format to ARGB32 for faster rendering and bundling fonts/patterns for offline use.
- File operations are handled through JavaScript shims and MEMFS, with settings persisted via IndexedDB and exports (PDF, SVG) working via browser downloads.
- The final build is ~18 MB compressed, runs in Chromium-based browsers, and keeps changes minimal behind conditionals to maintain desktop compatibility.